]> sigrok.org Git - libsigrok.git/commit
agilent-dmm: Fix SEGV during incomplete reply from meter.
authorDaniel Thompson <redacted>
Fri, 4 Oct 2013 07:34:05 +0000 (08:34 +0100)
committerBert Vermeulen <redacted>
Fri, 4 Oct 2013 11:30:49 +0000 (13:30 +0200)
commitfbf07e020995b2d50ef337a2c629b2b8997dd047
treea2ef419d0ad01fc803e13f0c82bf28dadbb6c3e2
parent5715e84fe3335e519148d7f6252b046598a982a8
agilent-dmm: Fix SEGV during incomplete reply from meter.

If buf contains exactly the string "Agilent Technologies" (for example if
there are bugs in the timeout logic or serial driver causing the reply from
the meter to be abridged) then this code will SEGV. This is because tokens[1]
is NULL but only tokens[2] and tokens[3] (both of which are undefined) are
NULL checked.

Can be trivially corrected by NULL checking tokens[1] as well.

Signed-off-by: Daniel Thompson <redacted>
hardware/agilent-dmm/api.c