[Openvas-commits] r946 - in trunk/openvas-libraries: . libopenvas

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jun 20 16:44:51 CEST 2008


Author: timb
Date: 2008-06-20 16:44:51 +0200 (Fri, 20 Jun 2008)
New Revision: 946

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/libopenvas/hlst.c
Log:
Avoid sorting an hlst if it has no entries since that will lead to an emalloc issue under certain conditions


Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2008-06-20 14:40:32 UTC (rev 945)
+++ trunk/openvas-libraries/ChangeLog	2008-06-20 14:44:51 UTC (rev 946)
@@ -1,3 +1,9 @@
+2008-06-20  Tim Brown <timb at nth-dimension.org.uk>
+
+	* libopenvas/hlst.c (sort_hlst): Avoid sorting an hlst if it has no
+	entries since that will lead to an emalloc issue under certain
+	conditions.
+
 2008-06-12  Michael Wiegand <michael.wiegand at intevation.de>
 
 	* libopenvas/store_internal.h: Increased MAGIC number to reflect

Modified: trunk/openvas-libraries/libopenvas/hlst.c
===================================================================
--- trunk/openvas-libraries/libopenvas/hlst.c	2008-06-20 14:40:32 UTC (rev 945)
+++ trunk/openvas-libraries/libopenvas/hlst.c	2008-06-20 14:44:51 UTC (rev 946)
@@ -783,6 +783,10 @@
 
   if (h == 0) return ;
 
+  /* don't try to run with total_entries == 0, since the -1 below will
+   * cause total_entries to wrap around under certain conditions. */
+  if (h->total_entries == 0) return;
+
   /* create an access array with entry pointers */
   if (h->access != 0) {				/* Flawfinder: ignore */
     /* nothing has changed, yet */



More information about the Openvas-commits mailing list