]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Always initialize addr in parse_port_config()
authorNick Mathewson <nickm@torproject.org>
Mon, 17 Dec 2018 14:38:42 +0000 (09:38 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 Dec 2018 18:52:25 +0000 (13:52 -0500)
It was always analyzed before use, but scan-build wasn't able to
persuade itself of that.

Closes ticket 28881.

changes/ticket28881 [new file with mode: 0644]
src/app/config/config.c

diff --git a/changes/ticket28881 b/changes/ticket28881
new file mode 100644 (file)
index 0000000..1b015a6
--- /dev/null
@@ -0,0 +1,4 @@
+  o Code simplification and refactoring:
+    -  When parsing a port configuration, make it more
+       obvious to static analyzer tools that we will always initialize the
+       address. Closes ticket 28881.
index 81cc3e378f193741bb7e2e1bc2004fb7fd74ce98..4a8f94da0e2098f67a704dc79c4813dbc66b1fa5 100644 (file)
@@ -6913,6 +6913,8 @@ parse_port_config(smartlist_t *out,
 
   for (; ports; ports = ports->next) {
     tor_addr_t addr;
+    tor_addr_make_unspec(&addr);
+
     int port;
     int sessiongroup = SESSION_GROUP_UNSET;
     unsigned isolation = ISO_DEFAULT;