svn commit: r272714 - projects/ipfw/sys/netpfil/ipfw
Alexander V. Chernikov
melifaro at FreeBSD.org
Tue Oct 7 18:22:06 UTC 2014
Author: melifaro
Date: Tue Oct 7 18:22:05 2014
New Revision: 272714
URL: https://svnweb.freebsd.org/changeset/base/272714
Log:
Fix possible crash when old value pointer is not updated after array resize.
Modified:
projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c
Modified: projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c
==============================================================================
--- projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c Tue Oct 7 18:00:34 2014 (r272713)
+++ projects/ipfw/sys/netpfil/ipfw/ip_fw_table_value.c Tue Oct 7 18:22:05 2014 (r272714)
@@ -555,8 +555,17 @@ ipfw_link_table_values(struct ip_fw_chai
/* Let's try to link values */
for (i = 0; i < count; i++) {
ptei = &tei[i];
- if (ptei->value != 0)
+ if (ptei->value != 0) {
+
+ /*
+ * We may be here after several process restarts,
+ * so we need to update all fields that might
+ * have changed.
+ */
+ ptv = (struct table_val_link *)ptei->ptv;
+ ptv->pval = &pval[i];
continue;
+ }
/* Check if record has appeared */
mask_table_value(ptei->pvalue, &tval, ts->vmask);
More information about the svn-src-projects
mailing list