rx-out-of-memory-20080528
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 29 May 2008 04:35:19 +0000 (04:35 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 29 May 2008 04:35:19 +0000 (04:35 +0000)
LICENSE MIT

in rxi_MorePackets() if osi_Alloc() fails to return the requested memory
call osi_Assert() instead of permitting subsequent null pointer dereferences
to corrupt the stack.

src/rx/rx_packet.c

index 4792327..7f083de 100644 (file)
@@ -544,6 +544,7 @@ rxi_MorePackets(int apackets)
 
     getme = apackets * sizeof(struct rx_packet);
     p = rx_mallocedP = (struct rx_packet *)osi_Alloc(getme);
+    osi_Assert(p);
 
     PIN(p, getme);             /* XXXXX */
     memset((char *)p, 0, getme);
@@ -579,6 +580,7 @@ rxi_MorePackets(int apackets)
 
     getme = apackets * sizeof(struct rx_packet);
     p = rx_mallocedP = (struct rx_packet *)osi_Alloc(getme);
+    osi_Assert(p);
 
     PIN(p, getme);             /* XXXXX */
     memset((char *)p, 0, getme);