schwehr / generic-sensor-format

Sonar Generic Sensor Format (gsf) codec
Other
13 stars 8 forks source link

Overflow in encoding and decoding #84

Open schwehr opened 9 years ago

schwehr commented 9 years ago

With the scaling by values in gsf_enc and gsf_dec, it is very possible to give malicious values that wrap the max (or min) value of a variable. This might just give garbage values. In which case, it might be good to know if there were an over range. But worse, it might be possible to cause a lookup outside of a table or some such.

possible wrap for garbage data. yes, I know that a value large enough for wrapping doesn't make sense in this case. But users/callers do the darndest things.

    ltemp = htonl((gsfuLong) (nav_error->longitude_error * 10.0 + 0.501));