Hello!

After updating sigrock and pulseview on FreeBSD, I could not use my
fx2lafw device anymore.  After investigating the issue, I found out the
culpit: when usb_get_port_path() is called while the device is open, the
function fails, but since the return value is never tested, the
uninitialized memory that was supposed to receive the path is copied and
considered valid, and execution continues.

As a consequence, when attempting to compare the device path and
uninitialized memory later on, no match is found.

Here are tw commits, the first one ensure the device is closed before
calling usb_get_port_path() (I could only test with the fx2lafw driver,
but some drivers had the wrong order and where changed too).  The second
patch test the return value of usb_get_port_path() so that errors are
not ignored anymore.

Please note that I am not used to git format-patch / git send-email, so
in case this change request is a PITA for the maintaners, feel free to
educate me with a better way to send patches.  Thanks!


Romain Tartière (2):
  Ensure device is closed before usb_get_port_path()
  Check usb_get_port_path() return value

 src/device.c                                   | 4 +++-
 src/hardware/chronovu-la/api.c                 | 5 +++--
 src/hardware/dreamsourcelab-dslogic/api.c      | 5 +++--
 src/hardware/dreamsourcelab-dslogic/protocol.c | 4 +++-
 src/hardware/fx2lafw/api.c                     | 5 +++--
 src/hardware/fx2lafw/protocol.c                | 4 +++-
 src/hardware/hantek-6xxx/api.c                 | 3 ++-
 src/hardware/hantek-6xxx/protocol.c            | 4 +++-
 src/hardware/hantek-dso/api.c                  | 3 ++-
 src/hardware/hantek-dso/protocol.c             | 4 +++-
 src/hardware/lecroy-logicstudio/api.c          | 6 ++++--
 src/hardware/saleae-logic-pro/api.c            | 3 ++-
 src/hardware/saleae-logic16/api.c              | 7 +++++--
 src/hardware/testo/api.c                       | 3 ++-
 src/hardware/victor-dmm/api.c                  | 3 ++-
 src/hardware/zeroplus-logic-cube/api.c         | 3 ++-
 16 files changed, 45 insertions(+), 21 deletions(-)

-- 
2.15.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to