forked from PsychoticNinja/irssi
Fixed some "buffer overflow" alerts when playing with buggy /EVAL values.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2984 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
da439fdbe4
commit
71442509d0
@ -391,7 +391,7 @@ char *parse_special(char **cmd, SERVER_REC *server, void *item,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nest_free = FALSE; nest_value = NULL;
|
nest_free = FALSE; nest_value = NULL;
|
||||||
if (**cmd == '(') {
|
if (**cmd == '(' && (*cmd)[1] != '\0') {
|
||||||
/* subvariable */
|
/* subvariable */
|
||||||
int toplevel = nested_orig_cmd == NULL;
|
int toplevel = nested_orig_cmd == NULL;
|
||||||
|
|
||||||
@ -407,6 +407,9 @@ char *parse_special(char **cmd, SERVER_REC *server, void *item,
|
|||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nest_value == NULL || *nest_value == '\0')
|
||||||
|
return NULL;
|
||||||
|
|
||||||
while ((*nested_orig_cmd)[1] != '\0') {
|
while ((*nested_orig_cmd)[1] != '\0') {
|
||||||
(*nested_orig_cmd)++;
|
(*nested_orig_cmd)++;
|
||||||
if (**nested_orig_cmd == ')')
|
if (**nested_orig_cmd == ')')
|
||||||
@ -421,6 +424,8 @@ char *parse_special(char **cmd, SERVER_REC *server, void *item,
|
|||||||
brackets = FALSE;
|
brackets = FALSE;
|
||||||
else {
|
else {
|
||||||
/* special value is inside {...} (foo${test}bar -> fooXXXbar) */
|
/* special value is inside {...} (foo${test}bar -> fooXXXbar) */
|
||||||
|
if ((*cmd)[1] == '\0')
|
||||||
|
return NULL;
|
||||||
(*cmd)++;
|
(*cmd)++;
|
||||||
brackets = TRUE;
|
brackets = TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user