svn commit: trunk/busybox: coreutils libbb

aldot at busybox.net aldot at busybox.net
Thu Apr 5 02:21:26 PDT 2007


Author: aldot
Date: 2007-04-05 02:21:24 -0700 (Thu, 05 Apr 2007)
New Revision: 18331

Log:
- 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.


Modified:
   trunk/busybox/coreutils/du.c
   trunk/busybox/libbb/inode_hash.c


Changeset:
Modified: trunk/busybox/coreutils/du.c
===================================================================
--- trunk/busybox/coreutils/du.c	2007-04-05 07:04:31 UTC (rev 18330)
+++ trunk/busybox/coreutils/du.c	2007-04-05 09:21:24 UTC (rev 18331)
@@ -235,10 +235,8 @@
 		total += du(*argv);
 		slink_depth = slink_depth_save;
 	} while (*++argv);
-#if ENABLE_FEATURE_CLEAN_UP
-	reset_ino_dev_hashtable();
-#endif
-
+	if (ENABLE_FEATURE_CLEAN_UP)
+		reset_ino_dev_hashtable();
 	if (print_final_total) {
 		print(total, "total");
 	}

Modified: trunk/busybox/libbb/inode_hash.c
===================================================================
--- trunk/busybox/libbb/inode_hash.c	2007-04-05 07:04:31 UTC (rev 18330)
+++ trunk/busybox/libbb/inode_hash.c	2007-04-05 09:21:24 UTC (rev 18331)
@@ -77,7 +77,7 @@
 	int i;
 	ino_dev_hashtable_bucket_t *bucket;
 
-	for (i = 0; i < HASH_SIZE; i++) {
+	for (i = 0; ino_dev_hashtable && i < HASH_SIZE; i++) {
 		while (ino_dev_hashtable[i] != NULL) {
 			bucket = ino_dev_hashtable[i]->next;
 			free(ino_dev_hashtable[i]);
@@ -87,4 +87,6 @@
 	free(ino_dev_hashtable);
 	ino_dev_hashtable = NULL;
 }
+#else
+void reset_ino_dev_hashtable(void);
 #endif



More information about the busybox-cvs mailing list