Menu

#24 sscanf() return value mishaps in pcap-usb-linux.c

Git head
closed-fixed
nobody
None
5
2013-11-20
2007-11-09
No

The first change involves a sscanf() that has '%n' in the format string, which shouldn't be checked for in the return value (stored in "ntok"). This is done correctly elsewhere in the code (and even commented on) such that the return value is checked for everything but the %n modifier.

And a few lines after this, a sscanf() is done for '%d' and the return value is stored in "ret". However, the same exact line from the above mishap is used here, not even checking the right variable or number of conversions! It checks "ntok" for 2 when it should check "ret" for 1.

Discussion

  • Kris Katterjohn

    Kris Katterjohn - 2007-11-09
     
  • Guy Harris

    Guy Harris - 2007-11-30

    Logged In: YES
    user_id=541179
    Originator: NO

    I checked Paolo Abeni's version of the patch into the main and 1.0 branches.

     
  • Guy Harris

    Guy Harris - 2007-11-30
    • status: open --> closed-fixed
     
  • Denis Ovsienko

    Denis Ovsienko - 2013-11-20

    Administrators of the "libpcap" SourceForge project have superseded this tracker item (formerly artifact 1828721, now patch 24) with issue 220 of the "libpcap" GitHub project.