Module Name: src Committed By: martin Date: Sun Feb 2 15:03:46 UTC 2025
Modified Files: src/external/mpl/dhcp/dist/common [netbsd-10]: options.c Log Message: Pull up following revision(s) (requested by christos in ticket #1045): external/mpl/dhcp/dist/common/options.c: revision 1.8 protect option_dereference like in the other cases (although the option_dereference checks for it too). To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.2.1 src/external/mpl/dhcp/dist/common/options.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/mpl/dhcp/dist/common/options.c diff -u src/external/mpl/dhcp/dist/common/options.c:1.7 src/external/mpl/dhcp/dist/common/options.c:1.7.2.1 --- src/external/mpl/dhcp/dist/common/options.c:1.7 Wed Oct 5 22:20:15 2022 +++ src/external/mpl/dhcp/dist/common/options.c Sun Feb 2 15:03:46 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: options.c,v 1.7 2022/10/05 22:20:15 christos Exp $ */ +/* $NetBSD: options.c,v 1.7.2.1 2025/02/02 15:03:46 martin Exp $ */ /* options.c @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: options.c,v 1.7 2022/10/05 22:20:15 christos Exp $"); +__RCSID("$NetBSD: options.c,v 1.7.2.1 2025/02/02 15:03:46 martin Exp $"); #define DHCP_OPTION_DATA #include "dhcpd.h" @@ -235,7 +235,8 @@ int parse_option_buffer (options, buffer log_error("parse_option_buffer: " "save_option_buffer failed"); buffer_dereference(&bp, MDL); - option_dereference(&option, MDL); + if (option) + option_dereference(&option, MDL); return (0); } } else if (universe->concat_duplicates) { @@ -247,7 +248,8 @@ int parse_option_buffer (options, buffer MDL)) { log_error("parse_option_buffer: No memory."); buffer_dereference(&bp, MDL); - option_dereference(&option, MDL); + if (option) + option_dereference(&option, MDL); return (0); } /* Copy old option to new data object. */ @@ -272,7 +274,8 @@ int parse_option_buffer (options, buffer if (!option_cache_allocate(&nop, MDL)) { log_error("parse_option_buffer: No memory."); buffer_dereference(&bp, MDL); - option_dereference(&option, MDL); + if (option) + option_dereference(&option, MDL); return (0); }