From: claudio Date: Thu, 9 Jun 2022 17:33:47 +0000 (+0000) Subject: Properly error out if a variable does not exist. Need to pass back X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=222bf2cfd60c50abbe338c1e839a43609086829f;p=openbsd Properly error out if a variable does not exist. Need to pass back ERROR to yylex() to make the parser fail nicely. OK tb@ --- diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index dfd00462759..89b5c672d88 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.428 2022/06/02 11:12:47 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.429 2022/06/09 17:33:47 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -3248,8 +3248,10 @@ expand_macro(void) break; } val = symget(buf); - if (val == NULL) + if (val == NULL) { yyerror("macro '%s' not defined", buf); + return (ERROR); + } p = val + strlen(val) - 1; lungetc(DONE_EXPAND); while (p >= val) {