fix buffer overrun

This commit is contained in:
Yuichi Nishiwaki 2016-03-03 19:55:27 +09:00
parent 5ce271e9fe
commit 69c13fdcce
1 changed files with 2 additions and 1 deletions

View File

@ -217,8 +217,9 @@ pic_get_args(pic_state *pic, const char *format, ...)
pic_error(pic, "pic_get_args: invalid argument specifier given", 1, pic_char_value(pic, c)); pic_error(pic, "pic_get_args: invalid argument specifier given", 1, pic_char_value(pic, c));
} }
if (format[1] == '+') { if (*format == '+') {
pic_value *p; pic_value *p;
format++;
p = va_arg(ap, pic_value*); p = va_arg(ap, pic_value*);
*p = GET_OPERAND(pic, i); *p = GET_OPERAND(pic, i);
} }