Re: expand: Fix buffer overflow in expandmeta

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/26/18 7:12 AM, Herbert Xu wrote:
FWIW your patch when built with -O2 with gcc 4.7.2 is actually
16 bytes bigger than my version.

Interesting. Not sure what might cause that.

@@ -1344,6 +1335,8 @@ expmeta(char *enddir, char *name)
  			metaflag++;
  		p = name;
  		do {
+			if (enddir == expdir + PATH_MAX)
+				return;
  			if (*p == '\\')
  				p++;
  			*enddir++ = *p;

Also there is another loop in between these two hunks that also
needs to check enddir.

Indeed, thanks.

Cheers,
Harald van Dijk
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux