[minicom-Bugs][313217] runscript crash when using environment variable in script

minicom-bugs at alioth.debian.org minicom-bugs at alioth.debian.org
Sat Jul 23 18:03:31 UTC 2011


Bugs item #313217, was changed at 2011-07-21 14:41 by Adam Lackorzynski
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=100031&aid=313217&group_id=30018

>Status: Closed
Priority: 3
Submitted By: Frederic Germain (fredericgermain-guest)
Assigned to: Nobody (None)
Summary: runscript crash when using environment variable in script 
Category: Debian
Group: None
Resolution: None


Initial Comment:
I got this crash, this is the backtrace using valgrind :
==13439== Invalid write of size 1
==13439==    at 0x8049382: getword (script.c:249)
==13439==    by 0x80499A1: output (script.c:415)
==13439==    by 0x804A036: dosend (script.c:628)
==13439==    by 0x804A87B: s_exec (script.c:969)
==13439==    by 0x804A960: execscript (script.c:995)
==13439==    by 0x804AB3F: main (script.c:1046)
==13439==  Address 0x41e021a is 0 bytes after a block of size 50 alloc'd
==13439==    at 0x4026864: malloc (vg_replace_malloc.c:236)
==13439==    by 0x40268EE: realloc (vg_replace_malloc.c:525)
==13439==    by 0x8049098: getword (script.c:184)
==13439==    by 0x804A7AC: s_exec (script.c:952)
==13439==    by 0x804A960: execscript (script.c:995)
==13439==    by 0x804AB3F: main (script.c:1046)
==13439== 
bigger 100


This is because a buffer which was previously on the stack is now malloced, and we write at the end of it with substituting environment variable.
I include a patch. Can you merge it or correct the problem for the next release ? I saw the problem on Ubuntu 11.04...


----------------------------------------------------------------------

>Comment By: Adam Lackorzynski (al-guest)
Date: 2011-07-23 20:03

Message:
Thanks, fixed (although differently).

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=100031&aid=313217&group_id=30018



More information about the minicom-devel mailing list