Opened 6 years ago

Closed 6 years ago

#14798 closed defect (fixed)

Avoid calling SMARTLIST_FOREACH on a NULL smartlist in tests

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.2.6.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Keywords: clang
Cc: nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Two of the test functions could possibly call SMARTLIST_FOREACH on a NULL smartlist.

This branch fixes the issue:

Repository: ​​​
Branch: avoid-NULL-smartlist-foreach

Check if each smartlist is NULL before calling SMARTLIST_FOREACH on it.

Bug discovered by the clang static analyzer.
Apple clang 600.0.56 (LLVM 3.5svn) on x86_64-apple-darwin14.1.0.

Child Tickets

Change History (1)

comment:1 Changed 6 years ago by nickm

Resolution: fixed
Status: newclosed

Nicely done, teor! Nicely done, clang!

Patch merged.

Note: See TracTickets for help on using tickets.