]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-rx-out-of-memory-20080528
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 29 May 2008 04:38:06 +0000 (04:38 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 29 May 2008 04:38:06 +0000 (04:38 +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.

(cherry picked from commit c5bce0f87dc11cfaf5a7fabe16fe7efd24a4d200)

src/rx/rx_packet.c

index 7d62865f607e33892160a0ca80eb1cc12937a3b5..2035ae77c423d8f8f1e3d628a85558ae67ed07d2 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);