summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-03-06 11:31:11 -0500
committerNick Mathewson <nickm@torproject.org>2017-03-06 11:31:11 -0500
commit5203cd2f11a1419db57d067d2713c2118787d0c3 (patch)
tree3dfdf11b63d507e4d23e3a135ff2097e11d294f3 /src/or/routerparse.c
parent0a54e5d1481b9d641f5e9e1876818838175485f4 (diff)
downloadtor-5203cd2f11a1419db57d067d2713c2118787d0c3.tar.gz
tor-5203cd2f11a1419db57d067d2713c2118787d0c3.zip
Check for NULL as input to extrainfo_parse_entry_from_string()
We hope this will make the clangalyzer less worried about this function. Closes ticket 21496.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 0336c035b4..c4f329513c 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2030,6 +2030,9 @@ extrainfo_parse_entry_from_string(const char *s, const char *end,
* parse that's covered by the hash. */
int can_dl_again = 0;
+ if (BUG(s == NULL))
+ return NULL;
+
if (!end) {
end = s + strlen(s);
}