summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-25 16:06:09 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-25 16:06:09 +0000
commit0f8491a254f799b7d850e533827a19ac43eac5e2 (patch)
tree7320f06661df9a9fcd96574ef341e2da207d21d6
parent78c068397a663d450048bfe41ce4a2536732fbdb (diff)
downloadtor-0f8491a254f799b7d850e533827a19ac43eac5e2.tar.gz
tor-0f8491a254f799b7d850e533827a19ac43eac5e2.zip
Backport candidate: remove dangerous free(0) on hashtable init
svn:r8499
-rw-r--r--ChangeLog2
-rw-r--r--src/common/ht.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b7d0dce36c..4ffd2302c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,8 @@ Changes in version 0.1.2.2-alpha - 2006-??-??
- If we're a directory mirror and we ask for "all" network status
documents, we would discard status documents from authorities
we don't recognize.
+ - Avoid a memory corruption bug when creating a hash table for the first
+ time.
o Documentation
- Documented (and renamed) ServerDNSSearchDomains and
diff --git a/src/common/ht.h b/src/common/ht.h
index a83e093264..d51d7c5c00 100644
--- a/src/common/ht.h
+++ b/src/common/ht.h
@@ -307,7 +307,8 @@ ht_string_hash(const char *s)
elm = next; \
} \
} \
- freefn(head->hth_table); \
+ if (head->hth_table) \
+ freefn(head->hth_table); \
head->hth_table = new_table; \
} else { \
unsigned b, b2; \