On 06/27/2013 09:43 AM, Anoop Saldanha wrote:
> In src/util-streaming-parser.c:
> 
>> +static int StreamingParserGetValue(void *ctx, void *ret_input, uint8_t psize)
>> +{
>> +    StreamingParserCtx *tctx = (StreamingParserCtx *)ctx;
>> +    uint16_t u;
>> +
>> +    if (psize <= tctx->buffer_len) {
>> +        if (psize == 2) {
>> +            *((uint16_t *)ret_input) = tctx->buffer.u16[0];
>> +        } else if (psize == 4) {
>> +            *((uint32_t *)ret_input) = tctx->buffer.u32[0];
>> +        } else {
>> +            *((uint64_t *)ret_input) = tctx->buffer.u64;
>> +        }
>> +        /* Since a type can't be shifted by a value >= width of the type, we
>> +         * need to split it */
>> +        tctx->buffer.u64 >>= (psize * 8 - 1);
> 
> yeah.
> 
> Couple of PRs and you have been cringing over this. Now I know how to
> give you sleepless nights :)

Yes, woke up screaming last night ;)