summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-11-17 14:22:36 +0000
committerHugo Landau <hlandau@openssl.org>2023-01-13 13:20:10 +0000
commit043a41ddeeaabc192c25aa0b46ccfc4546e4d3df (patch)
treeae68ec6877211734cec427b384471505b47992ed
parent6d5d5fc9a9f6b701fc5e17f05d3df464fe0bc56e (diff)
QUIC RX: Fix QRX packet handling refactor w.r.t. list refactor
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19703)
-rw-r--r--ssl/quic/quic_record_rx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ssl/quic/quic_record_rx.c b/ssl/quic/quic_record_rx.c
index eb975901ed..69a58483a4 100644
--- a/ssl/quic/quic_record_rx.c
+++ b/ssl/quic/quic_record_rx.c
@@ -41,8 +41,8 @@ static ossl_inline int pkt_is_marked(const uint64_t *bitf, size_t pkt_idx)
typedef struct rxe_st RXE;
struct rxe_st {
- OSSL_LIST_MEMBER(rxe, RXE);
OSSL_QRX_PKT pkt;
+ OSSL_LIST_MEMBER(rxe, RXE);
size_t data_len, alloc_len, refcount;
/* Extra fields for per-packet information. */
@@ -381,12 +381,13 @@ static RXE *qrx_resize_rxe(RXE_LIST *rxl, RXE *rxe, size_t n)
* data.
*/
rxe2 = OPENSSL_realloc(rxe, sizeof(RXE) + n);
- if (rxe2 == NULL || rxe == rxe2) {
+ if (rxe2 == NULL) {
+ /* Resize failed, restore old allocation. */
if (p == NULL)
ossl_list_rxe_insert_head(rxl, rxe);
else
ossl_list_rxe_insert_after(rxl, p, rxe);
- return rxe2;
+ return NULL;
}
if (p == NULL)