[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 1/4] Prevent SIGSEGV in ipCallback and cidrCallback (#440498)



From: David Cantrell <dcantrell redhat com>

Pass ipcomps rather than &ipcomps as the data for ipCallback and
cidrCallback.  Prevents a SIGSEGV if you enter data that ipCallback or
cidrCallback would deem invalid, occurs during manual network interface
configuration in stage 1.
---
 loader2/net.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/loader2/net.c b/loader2/net.c
index 61b6796..6580e3f 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -1098,8 +1098,8 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg,
         newtGridSetField(egrid, 1, pos, NEWT_GRID_SUBGRID, qgrid,
                          0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
 
-        newtComponentAddCallback(ipcomps->ipv4Entry, ipCallback, &ipcomps);
-        newtComponentAddCallback(ipcomps->cidr4Entry, cidrCallback, &ipcomps);
+        newtComponentAddCallback(ipcomps->ipv4Entry, ipCallback, ipcomps);
+        newtComponentAddCallback(ipcomps->cidr4Entry, cidrCallback, ipcomps);
 
         /* populate fields if we have data already */
         tip = NULL;
@@ -1150,8 +1150,8 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg,
         newtGridSetField(egrid, 1, pos, NEWT_GRID_SUBGRID, rgrid,
                          0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
 
-        newtComponentAddCallback(ipcomps->ipv6Entry, ipCallback, &ipcomps);
-        newtComponentAddCallback(ipcomps->cidr6Entry, cidrCallback, &ipcomps);
+        newtComponentAddCallback(ipcomps->ipv6Entry, ipCallback, ipcomps);
+        newtComponentAddCallback(ipcomps->cidr6Entry, cidrCallback, ipcomps);
 
         /* populate fields if we have data already */
         tip = NULL;
@@ -1218,8 +1218,8 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg,
         newtEntrySet(ipcomps->nsEntry, ret, 1);
     }
 
-    newtComponentAddCallback(ipcomps->gwEntry, ipCallback, &ipcomps);
-    newtComponentAddCallback(ipcomps->nsEntry, ipCallback, &ipcomps);
+    newtComponentAddCallback(ipcomps->gwEntry, ipCallback, ipcomps);
+    newtComponentAddCallback(ipcomps->nsEntry, ipCallback, ipcomps);
 
     /* button bar at the bottom of the window */
     buttons = newtButtonBar(_("OK"), &okay, _("Back"), &back, NULL);
-- 
1.7.2.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]