]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix contrib/fastrpz.patch asprintf return value checks.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 23 Aug 2019 06:41:46 +0000 (08:41 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 23 Aug 2019 06:41:46 +0000 (08:41 +0200)
contrib/fastrpz.patch
doc/Changelog

index d82226a25b6a23af04c5637b7cbe918a8fae85ff..3b1b07885269ee41382ca9987ca576371840d8fc 100644 (file)
@@ -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;
index e4bb719233f7fd7b5b1f688f74c7ef6874ed769e..fd139cb0f5e75dfc1c059249fb6192cc014659e8 100644 (file)
@@ -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.