From fb6fc286da47fa74e85b736e25b5d326e6a3909a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 29 May 2008 04:38:06 +0000 Subject: [PATCH] DEVEL15-rx-out-of-memory-20080528 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 7d62865f6..2035ae77c 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -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); -- 2.39.5