iffy handling 2-03-YYY

Bug #893640 reported by cpb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libECBUFR
Fix Committed
Low
vanh souvanlasy

Bug Description

Code in question is bufr_dataset.c:1778,

      case TYPE_CHNG_REF_VAL_OP :
         ival = bufr_value_get_int32( bd->value );
         if (isdebug)
            {
            sprintf( errmsg, _("INT: %llu "), (unsigned long long)ival );
            bufr_print_debug( errmsg );
            }
         if (ival < 0)
            {
            ival = bufr_negative_ivalue( ival, bd->encoding.nbits );

ival is uint64_t, which makes the "if (ival < 0)" test a NOP. Not entirely sure what was intended here so I added a FIXME comment and left it alone.

cpb (chris-beauregard)
Changed in libecbufr:
assignee: nobody → vanh souvanlasy (vanh-souvanlasy)
importance: Undecided → Low
Revision history for this message
vanh souvanlasy (vanh-souvanlasy) wrote :

The return value could be negative and for this case, the returned value is not just -1 for missing
the ival should be int32_t and then the converted final value should be cast to uint64_t for output.

Changed in libecbufr:
status: New → In Progress
milestone: none → 0.8.4
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.