components/perl/perl520/patches/a2p_buffer.patch
author Vladimir Marek <Vladimir.Marek@oracle.com>
Sun, 28 Feb 2016 23:58:10 +0100
changeset 5524 7c50b6f98812
permissions -rw-r--r--
21833850 a2p dumps core with -n option due to wrong arguments processing

Upstream bug https://rt.cpan.org/Public/Bug/Display.html?id=100361

This problem probably won't be in more recent perl version as the a2p was
removed fro it's core into external module.

--- perl-5.20.1/x2p/walk.c	2016-02-28 14:47:40.050370036 -0800
+++ perl-5.20.1/x2p/walk.c	2016-02-28 14:38:30.190107484 -0800
@@ -69,8 +69,10 @@ walk(int useval, int level, int node, in
 	if (namelist) {
 	    while (isALPHA(*namelist)) {
 		for (d = tokenbuf,s=namelist;
-		  isWORDCHAR(*s);
+		  d - tokenbuf < sizeof(tokenbuf) && isWORDCHAR(*s);
 		  *d++ = *s++) ;
+		if (d - tokenbuf == sizeof(tokenbuf))
+		    fatal("Internal error: argument longer than %d: %s", sizeof(tokenbuf) - 1, namelist);
 		*d = '\0';
 		while (*s && !isALPHA(*s)) s++;
 		namelist = s;