Permalink
Browse files

Missing errorchecks incompilation of regsub()

Fixes #1125
  • Loading branch information...
1 parent d499461 commit b54bfa5c2d038cd2ea92a37916821644d56af81b @bsdphk bsdphk committed with Tollef Fog Heen Apr 16, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/libvcl/vcc_expr.c
View
@@ -454,6 +454,8 @@ vcc_Eval_Regsub(struct vcc *tl, struct expr **e, const struct symbol *sym)
SkipToken(tl, '(');
vcc_expr0(tl, &e2, STRING);
+ if (e2 == NULL)
+ return;
if (e2->fmt != STRING)
vcc_expr_tostring(&e2, STRING);
@@ -467,6 +469,8 @@ vcc_Eval_Regsub(struct vcc *tl, struct expr **e, const struct symbol *sym)
SkipToken(tl, ',');
vcc_expr0(tl, &e2, STRING);
+ if (e2 == NULL)
+ return;
if (e2->fmt != STRING)
vcc_expr_tostring(&e2, STRING);
*e = vcc_expr_edit(STRING, "\v1, \v2)", *e, e2);

0 comments on commit b54bfa5

Please sign in to comment.