diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-04-05 09:21:24 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-04-05 09:21:24 +0000 |
commit | bdd253e4505643808eb5d30a18a727683aada5e5 (patch) | |
tree | 2e465cd3b7d5f61f9eb318c1675ef27e164098de /libbb | |
parent | 7d6c9296e7154ef131c318588e66044f71081a05 (diff) | |
download | busybox-w32-bdd253e4505643808eb5d30a18a727683aada5e5.tar.gz busybox-w32-bdd253e4505643808eb5d30a18a727683aada5e5.tar.bz2 busybox-w32-bdd253e4505643808eb5d30a18a727683aada5e5.zip |
- fix segfault in reset_ino_dev_hashtable() when *hashtable was null.
Seen in the testsuite for du -l .../testsuite on exit with CLEAN_UP enabled.
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/inode_hash.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c index 0705102b8..78c1b0f9e 100644 --- a/libbb/inode_hash.c +++ b/libbb/inode_hash.c | |||
@@ -77,7 +77,7 @@ void reset_ino_dev_hashtable(void) | |||
77 | int i; | 77 | int i; |
78 | ino_dev_hashtable_bucket_t *bucket; | 78 | ino_dev_hashtable_bucket_t *bucket; |
79 | 79 | ||
80 | for (i = 0; i < HASH_SIZE; i++) { | 80 | for (i = 0; ino_dev_hashtable && i < HASH_SIZE; i++) { |
81 | while (ino_dev_hashtable[i] != NULL) { | 81 | while (ino_dev_hashtable[i] != NULL) { |
82 | bucket = ino_dev_hashtable[i]->next; | 82 | bucket = ino_dev_hashtable[i]->next; |
83 | free(ino_dev_hashtable[i]); | 83 | free(ino_dev_hashtable[i]); |
@@ -87,4 +87,6 @@ void reset_ino_dev_hashtable(void) | |||
87 | free(ino_dev_hashtable); | 87 | free(ino_dev_hashtable); |
88 | ino_dev_hashtable = NULL; | 88 | ino_dev_hashtable = NULL; |
89 | } | 89 | } |
90 | #else | ||
91 | void reset_ino_dev_hashtable(void); | ||
90 | #endif | 92 | #endif |