tag 329212 patch
thanks dude

Hi there,

the segmentation fault reported in this bug happens because the log
fails to be parsed, hence, there is no user list, and it tries to index
NULL. This happens because the number of users is checked, but too late.
There is a simplish patch attached that fixes the problem by moving the
check up with some tweaks, so it is performed earlier, and before
everything blows up.

Cheers,

-- 
Guilherme de S. Pastore (fatalerror)
<[EMAIL PROTECTED]>
--- src/fisg.c	2003-10-05 03:40:55.000000000 -0300
+++ src/fisg.c.new	2005-12-24 13:01:26.000000000 -0200
@@ -1336,6 +1336,15 @@
  	}
 
  /*
+  * Check if any users have been found
+  */
+ if (myStats->userList == NULL)
+ 	{
+ 	FERR("No users found? Check that you really specified correct log-format!\n");
+ 	return -10;
+ 	}
+
+ /*
   * Index the list for sorting
   */
  if (stats_index(myStats) < 0)
@@ -1362,16 +1371,6 @@
  	return -10;
  	}
 
-
- /*
-  * Check number of users
-  */
- if (myStats->nUsers <= 0)
- 	{
- 	FERR("No users found? Check that you really specified correct log-format!\n");
- 	return -10;
- 	}
-
  /* Calculate time */
  time(&myTime2);
  myStats->nTimeElapsed = (myTime2 - myTime1);

Reply via email to