From a64fa7b83c529f7cd864bfadc4c72fed02c99dbe Mon Sep 17 00:00:00 2001 From: tabudz Date: Sat, 7 Mar 2026 22:46:24 +0800 Subject: [PATCH] igd_desc_parse.c: fix buffer overflow --- 3rdparty/miniupnpc/igd_desc_parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/3rdparty/miniupnpc/igd_desc_parse.c b/3rdparty/miniupnpc/igd_desc_parse.c index 892a0902..e9f079bb 100644 --- a/3rdparty/miniupnpc/igd_desc_parse.c +++ b/3rdparty/miniupnpc/igd_desc_parse.c @@ -2,7 +2,7 @@ /* Project : miniupnp * http://miniupnp.free.fr/ * Author : Thomas Bernard - * Copyright (c) 2005-2014 Thomas Bernard + * Copyright (c) 2005-2015 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ @@ -15,7 +15,9 @@ void IGDstartelt(void * d, const char * name, int l) { struct IGDdatas * datas = (struct IGDdatas *)d; - memcpy( datas->cureltname, name, l); + if(l >= MINIUPNPC_URL_MAXSIZE) + l = MINIUPNPC_URL_MAXSIZE-1; + memcpy(datas->cureltname, name, l); datas->cureltname[l] = '\0'; datas->level++; if( (l==7) && !memcmp(name, "service", l) ) {