Bug#553502: autolog: a segfault patch

2010-11-04 Thread Mehdi Dogguy
On  0, Luis Uribe a...@eviled.org wrote:
 
 Thanks!
 
 I add the patch to the package and it seems that the bug is fixed.
 
 The package is on [1]mentors until my sponsor uploads it.
 
 [1] http://mentors.debian.net/debian/pool/main/a/autolog/
 

Do you still need a sponsor for this upload? I can do that if needed.

Regards,

-- 
Mehdi Dogguy



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#553502: autolog: a segfault patch

2010-10-30 Thread Luis Uribe
package autolog
tags 553502 pending
thanks

Hi,

On Fri, Oct 29, 2010 at 04:40:25PM +0200, Julien Viard de Galbert wrote:
 Anyway, you will find a patch that fixes the one I found.

Thanks!

I add the patch to the package and it seems that the bug is fixed.

The package is on [1]mentors until my sponsor uploads it.

[1] http://mentors.debian.net/debian/pool/main/a/autolog/

-- 
Luis
http://eviled.org


signature.asc
Description: Digital signature


Processed: Re: Bug#553502: autolog: a segfault patch

2010-10-30 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 package autolog
Limiting to bugs with field 'package' containing at least one of 'autolog'
Limit currently set to 'package':'autolog'

 tags 553502 pending
Bug #553502 [autolog] autolog exits on Segmentation Fault
Added tag(s) pending.
 thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
553502: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=553502
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#553502: autolog: a segfault patch

2010-10-29 Thread Julien Viard de Galbert
Package: autolog
Severity: normal

Hi,

I could get a segfault by simply running './autolog -d -o', even by running
'./autolog -d -o -n' which does not even try to kill processes...
So I don't know if this is the same case as the original submitter as I 
didn't have to wait for any warning before getting the segfault.

Anyway, you will find a patch that fixes the one I found.

About the bug:

Basically it parses (using strtok by the way) the output of a ps command line
by line. The line buffer has a size of 256 bytes so if the output line of ps
is longer than that, it get parsed as the next line and it will of course not
parse correctly.

For some reasons, when ran from gdb, the ps command limits its output to 80
chars as if ps was run in a terminal, so it does not segfault ;)

The patch simply read the line until it finds the ending \n so that the parser
will not segfault. (by the way as the config file allows the change the ps
command, the parser should probably be written in a safer way...)

Regards,

Julien Vdg

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -au autolog-0.40.orig/autolog.c autolog-0.40/autolog.c
--- autolog-0.40.orig/autolog.c	2010-10-29 16:15:11.0 +0200
+++ autolog-0.40/autolog.c	2010-10-29 16:14:27.0 +0200
@@ -1082,6 +1082,18 @@
 		}
 	}
 	}
+	/* Read to the end of line to avoid parsing the rest of the command
+	 * line in next round and getting a segfault as ps_pid will be null!!
+	 */
+	i=strlen(iline);
+	while(iline[i-1] != '\n'){
+	if(!fgets(iline, LINELEN, ps)) {
+	  /* end of file, exit*/
+	  fclose(ps);
+	  return;
+	}
+	i=strlen(iline);
+	}
 }
 fclose(ps);
 }
Les sous-répertoires autolog-0.40.orig/debian et autolog-0.40/debian sont identiques.
Les sous-répertoires autolog-0.40.orig/.pc et autolog-0.40/.pc sont identiques.