From: Chip Salzenberg Date: Thu, 10 Apr 1997 19:49:15 +0000 (+1200) Subject: Fix buffer overflow in a2p X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ece629c6e08b85a766c81ed2b23e0fedd51f8a89;p=p5sagit%2Fp5-mst-13.2.git Fix buffer overflow in a2p --- diff --git a/x2p/a2py.c b/x2p/a2py.c index ad685fe..3a3cb52 100644 --- a/x2p/a2py.c +++ b/x2p/a2py.c @@ -1297,10 +1297,10 @@ int prevargs; numargs = fixrargs(name,ops[arg+3].ival,numargs); } else { - char tmpbuf[128]; - + char *tmpbuf = safemalloc(strlen(name) + (sizeof(prevargs) * 3) + 5); sprintf(tmpbuf,"%s:%d",name,prevargs); str = hfetch(curarghash,tmpbuf); + safefree(tmpbuf); if (str && strEQ(str->str_ptr,"*")) { if (type == OVAR || type == OSTAR) { ops[arg].ival &= ~255;