then the actual stuff. */
sb_reset (&t);
idx = get_token (idx, in, &t);
- if (in->ptr[idx] != '=')
+ if (idx >= in->len || in->ptr[idx] != '=')
{
err = _("confusion in formal parameters");
break;
if (f->type != FORMAL_VARARG)
idx = get_any_string (idx, in, &f->actual);
- else
+ else if (idx < in->len)
{
sb_add_buffer (&f->actual, in->ptr + idx, in->len - idx);
idx = in->len;
idx = sb_skip_comma (idx, in);
else
{
- if (in->ptr[idx] == ',')
+ if (idx < in->len && in->ptr[idx] == ',')
++idx;
- if (ISWHITE (in->ptr[idx]))
+ if (idx < in->len && ISWHITE (in->ptr[idx]))
break;
}
}