[zeromq-dev] [PATCH] decoder asserts

Martin Sustrik sustrik at 250bpm.com
Wed Oct 27 11:18:08 CEST 2010


On 10/27/2010 11:10 AM, Christian Gudrian wrote:
> Am 27.10.2010 10:49, schrieb Christian Gudrian:
>
>> Wouldn't it be wise to check for a null method pointer_before_
>> dereferencing it?
>
> Oh, I see that a null next pointer after the method call is an
> indication for a decoding error. However, since next gets initialized to
> null in the constructor the pointer _might_ still be null when its
> dereferenced at first (in case a derived class did to call next_step).

The derived class (decoder_t) sets the next pointer in the constructor, 
so it should be OK.

Martin



More information about the zeromq-dev mailing list