bug #408: prevent invalid data or crash by not reading beyond end of string

This commit is contained in:
Jim Monte
2019-08-13 23:35:17 +02:00
committed by Holger Vogt
parent 30565e45c4
commit 0fbff063b8
+2 -1
View File
@@ -44,7 +44,8 @@ cp_bquote(wordlist *wlist)
*s++ = *t++;
/* What the heck, let "echo `foo" work... */
*s = '\0';
t++; /* Get past the second ` */
if (*t != '\0')
t++; /* Get past the second ` */
if ((nwl = backeval(buf)) == NULL) {
wlist->wl_word = NULL;
return (wlist);