segmentation fault in dccproc (1.3.24)

Jeff Mincy mincy@rcn.com
Sat Dec 10 15:48:36 UTC 2005


On Fri, 9 Dec 2005, vjs@calcite.rhyolite.com wrote:

>> From: Jeff Mincy 
> 
>> I get a segmentation fault doing dccproc
>>
>>     bash% /usr/local/bin/dccproc -H -R < /home/jeff/.dcc/my.dhIXQS.2
>>     Segmentation fault
>>
>> The spam message has a broken Return-Path.  dccproc works when the
>> Return-Path is changed.
> 
>>     -Return-Path: <jmuovznlbeafoh@>
> 
>> If needed, I can provide the message or other information.
> 
> I guess I need the headers of the message, because I am unable to
> reproduce the crash.

Attached below.

> On what flavor of UNIX is it running?

Running on 7.3 redhat linux.

gdb reports the segmentation fault occurs at this call to STRLCPY
in dccproc.c while looking at env_from = " <jmuovznlbeafoh@>\n"

	if (env_from
	    && (p = strchr(env_from, '@')) != 0) {
		++p;
		p2 = strchr(p, '>');
		i = sizeof(mail_host);
		if (p2)
			i = min(i, p2-p);
		STRLCPY(mail_host, p, i);
		if (strchr(mail_host, ';') || strchr(mail_host, '@')
		    || strchr(mail_host, ','))
			mail_host[0] = '\0';
	}

The dcc_config.h file has
    #undef HAVE_STRLCPY.
So, I'm presumably getting this definition:
   ./include/dcc_defs.h:#define STRLCPY(d,s,lim) ((d)[(lim)-1] = '\0', strncpy(d,s,(lim)-1))

Doing if (i > 0) { ... } around the STRLCPY prevented the segmentation fault.


gdb output:

  (gdb) run  -H -R < /home/jeff/.dcc/my.dhIXQS.2
  Starting program: /home/jeff/downloads/dcc-1.3.24/dccproc/dccproc -H -R < /home/jeff/.dcc/my.dhIXQS.2
  Program received signal SIGSEGV, Segmentation fault.
  0x42080f92 in strncpy () from /lib/i686/libc.so.6
  (gdb) up
  #1  0x0804b07f in main (argc=3, argv=0xbffff5f4) at dccproc.c:636

  (gdb) print env_from
  $11 = 0x80b7c40 " <jmuovznlbeafoh@>\n"

  (gdb) print i
  $15 = 0


Headers attached here:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: my.dhIXQS.3
Type: application/octet-stream
Size: 1075 bytes
Desc: spam headers
URL: <http://www.rhyolite.com/pipermail/dcc/attachments/20051210/e722e1d9/attachment.obj>


More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.