[Bro] Small bug in TCP_Rewriter
Martin Casado
casado at cs.stanford.edu
Tue Aug 23 11:40:55 PDT 2005
>>[catching up on some old threads - apologies for the delay]
>>
>>
>>
>>>perhaps ..
>>>
>>> if(!next_packet->AppendData(data, left))
>>> { ASSERT(0); }
>>>
>>>
>>Thanks, that looks like the correct fix. I've added this.
>>
>>By the way, does anyone know whether ASSERT() is guaranteed to be equivalent
>>to a statement, so that the {}'s above can be safely omitted?
>>
>>
>
>
>
if(statement)
;
Is valid C so the braces shouldn't be necessary.
I don't see anywhere in the standard that assert is guaranteed to
be a statement ...
.m
>Mhmm avoid the problem by saying
>
> int success = next_packet->AppendData(data, left);
> ASSERT(success);
>?
>
>Cheers,
>Christian.
>
>
More information about the Bro
mailing list