Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#5558 closed defect (fixed)

tor_vsscanf() returns -1 if '%%' doesn't match a '%'.

Reported by: asn Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: easy tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

tor_vsscanf() returns -1 if '%%' doesn't match a '%', but tor_vsscanf() is supposed to return -1 only on malformed patterns.

tor_vsscanf() should return n_matched in this case.

      } else if (*pattern == '%') {
        if (*buf != '%')
          return -1;
        ++buf;
        ++pattern;

Child Tickets

Change History (6)

comment:1 Changed 8 years ago by asn

Status: newneeds_review

Please see bug5558 in https://git.gitorious.org/mytor/mytor.git.

comment:2 Changed 8 years ago by nickm

Looks good; can I have a unit test and a changes file?

comment:3 Changed 8 years ago by asn

Sure. Please see bug5558_take2 in https://git.gitorious.org/mytor/mytor.git.

comment:4 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Thanks! looks good; merging.

comment:5 Changed 7 years ago by nickm

Keywords: tor-client added

comment:6 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.