From 91b8591f05ed2fe7bc050aaafd1c4082118a8785 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Mon, 15 Sep 2025 14:29:35 +0530 Subject: [PATCH] fix(nimble): Address mbuf from different chains traversal during copying --- porting/nimble/src/os_mbuf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/porting/nimble/src/os_mbuf.c b/porting/nimble/src/os_mbuf.c index 0a94ee404..4084c265e 100644 --- a/porting/nimble/src/os_mbuf.c +++ b/porting/nimble/src/os_mbuf.c @@ -513,12 +513,13 @@ os_mbuf_dup(struct os_mbuf *om) struct os_mbuf *head; struct os_mbuf *copy; - omp = om->om_omp; - head = NULL; copy = NULL; for (; om != NULL; om = SLIST_NEXT(om, om_next)) { + + omp = om->om_omp; + if (head) { SLIST_NEXT(copy, om_next) = os_mbuf_get(omp, OS_MBUF_LEADINGSPACE(om));