Loading changes/bug7816.024 +4 −0 Changes for changes/bug7816.024: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,3 +2,7 @@ - Avoid leaking IPv6 policy content if we fail to format it into a router descriptor. Spotted by Coverity. Fixes part of 7816; bugfix on 0.2.4.7-alpha. - Avoid leaking memory if we fail to compute a consensus signature or we generated a consensus we couldn't parse. Spotted by Coverity. Fixes part of 7816; bugfix on 0.2.0.5-alpha. src/or/dirvote.c +11 −9 Changes for src/or/dirvote.c: 11 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -2139,7 +2139,7 @@ networkstatus_compute_consensus(smartlist_t *votes, digest, digest_len, legacy_signing_key)) { log_warn(LD_BUG, "Couldn't sign consensus networkstatus."); return NULL; /* This leaks, but it should never happen. */ goto done; } smartlist_add(chunks, tor_strdup(sigbuf)); } Loading @@ -2147,13 +2147,6 @@ networkstatus_compute_consensus(smartlist_t *votes, result = smartlist_join_strings(chunks, "", 0, NULL); tor_free(client_versions); tor_free(server_versions); SMARTLIST_FOREACH(flags, char *, cp, tor_free(cp)); smartlist_free(flags); SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp)); smartlist_free(chunks); { networkstatus_t *c; if (!(c = networkstatus_parse_vote_from_string(result, NULL, Loading @@ -2161,7 +2154,7 @@ networkstatus_compute_consensus(smartlist_t *votes, log_err(LD_BUG, "Generated a networkstatus consensus we couldn't " "parse."); tor_free(result); return NULL; goto done; } // Verify balancing parameters if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS && added_weights) { Loading @@ -2170,6 +2163,15 @@ networkstatus_compute_consensus(smartlist_t *votes, networkstatus_vote_free(c); } done: tor_free(client_versions); tor_free(server_versions); SMARTLIST_FOREACH(flags, char *, cp, tor_free(cp)); smartlist_free(flags); SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp)); smartlist_free(chunks); return result; } Loading Loading
changes/bug7816.024 +4 −0 Changes for changes/bug7816.024: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,3 +2,7 @@ - Avoid leaking IPv6 policy content if we fail to format it into a router descriptor. Spotted by Coverity. Fixes part of 7816; bugfix on 0.2.4.7-alpha. - Avoid leaking memory if we fail to compute a consensus signature or we generated a consensus we couldn't parse. Spotted by Coverity. Fixes part of 7816; bugfix on 0.2.0.5-alpha.
src/or/dirvote.c +11 −9 Changes for src/or/dirvote.c: 11 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -2139,7 +2139,7 @@ networkstatus_compute_consensus(smartlist_t *votes, digest, digest_len, legacy_signing_key)) { log_warn(LD_BUG, "Couldn't sign consensus networkstatus."); return NULL; /* This leaks, but it should never happen. */ goto done; } smartlist_add(chunks, tor_strdup(sigbuf)); } Loading @@ -2147,13 +2147,6 @@ networkstatus_compute_consensus(smartlist_t *votes, result = smartlist_join_strings(chunks, "", 0, NULL); tor_free(client_versions); tor_free(server_versions); SMARTLIST_FOREACH(flags, char *, cp, tor_free(cp)); smartlist_free(flags); SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp)); smartlist_free(chunks); { networkstatus_t *c; if (!(c = networkstatus_parse_vote_from_string(result, NULL, Loading @@ -2161,7 +2154,7 @@ networkstatus_compute_consensus(smartlist_t *votes, log_err(LD_BUG, "Generated a networkstatus consensus we couldn't " "parse."); tor_free(result); return NULL; goto done; } // Verify balancing parameters if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS && added_weights) { Loading @@ -2170,6 +2163,15 @@ networkstatus_compute_consensus(smartlist_t *votes, networkstatus_vote_free(c); } done: tor_free(client_versions); tor_free(server_versions); SMARTLIST_FOREACH(flags, char *, cp, tor_free(cp)); smartlist_free(flags); SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp)); smartlist_free(chunks); return result; } Loading