From a374dfb669b704f183fbc43cf747fab069b80764 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 23 Aug 2019 08:41:46 +0200 Subject: [PATCH] - Fix contrib/fastrpz.patch asprintf return value checks. --- contrib/fastrpz.patch | 8 ++++---- doc/Changelog | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/fastrpz.patch b/contrib/fastrpz.patch index d82226a25..3b1b07885 100644 --- a/contrib/fastrpz.patch +++ b/contrib/fastrpz.patch @@ -3264,8 +3264,8 @@ index 10227a2f..a519fcc7 100644 + + OUTYY(("P(rpz_zone:%s)\n", $2)); + old_cstr = cfg_parser->cfg->rpz_cstr; -+ (void)asprintf(&new_cstr, "%s\nzone %s", old_cstr?old_cstr:"", $2); -+ if(!new_cstr) ++ if(asprintf(&new_cstr, "%s\nzone %s", old_cstr?old_cstr:"", $2) == -1) {new_cstr = NULL; yyerror("out of memory");} ++ else if(!new_cstr) + yyerror("out of memory"); + free(old_cstr); + cfg_parser->cfg->rpz_cstr = new_cstr; @@ -3277,8 +3277,8 @@ index 10227a2f..a519fcc7 100644 + + OUTYY(("P(rpz_option:%s)\n", $2)); + old_cstr = cfg_parser->cfg->rpz_cstr; -+ (void)asprintf(&new_cstr, "%s\n%s", old_cstr ? old_cstr : "", $2); -+ if(!new_cstr) ++ if(asprintf(&new_cstr, "%s\n%s", old_cstr ? old_cstr : "", $2) == -1) {new_cstr = NULL; yyerror("out of memory");} ++ else if(!new_cstr) + yyerror("out of memory"); + free(old_cstr); + cfg_parser->cfg->rpz_cstr = new_cstr; diff --git a/doc/Changelog b/doc/Changelog index e4bb71923..fd139cb0f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +23 August 2019: Wouter + - Fix contrib/fastrpz.patch asprintf return value checks. + 22 August 2019: Wouter - Fix that pkg-config is setup before --enable-systemd needs it. - 1.9.3rc2 release candidate tag. -- 2.47.3