bug #408: prevent invalid data or crash by not reading beyond end of string
This commit is contained in:
parent
30565e45c4
commit
0fbff063b8
|
|
@ -44,7 +44,8 @@ cp_bquote(wordlist *wlist)
|
||||||
*s++ = *t++;
|
*s++ = *t++;
|
||||||
/* What the heck, let "echo `foo" work... */
|
/* What the heck, let "echo `foo" work... */
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
t++; /* Get past the second ` */
|
if (*t != '\0')
|
||||||
|
t++; /* Get past the second ` */
|
||||||
if ((nwl = backeval(buf)) == NULL) {
|
if ((nwl = backeval(buf)) == NULL) {
|
||||||
wlist->wl_word = NULL;
|
wlist->wl_word = NULL;
|
||||||
return (wlist);
|
return (wlist);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue