From 2c1ea450c15fc69b8c7b5ccb3de2307a36758cb7 Mon Sep 17 00:00:00 2001 From: hhd227 Date: Tue, 26 May 2026 11:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B6=8A=E7=95=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hhd227 --- services/vendor/src/at_data.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/vendor/src/at_data.c b/services/vendor/src/at_data.c index 2ff8c90..c9d3537 100644 --- a/services/vendor/src/at_data.c +++ b/services/vendor/src/at_data.c @@ -397,6 +397,7 @@ static int32_t QueryAllSupportPDNInfos(PDNInfo *pdnInfo) Line *pLine = NULL; PDNInfo *pdns = pdnInfo; ResponseInfo *pResponse = NULL; + int32_t pdnCount = 0; ret = SendCommandLock("AT+CGDCONT?", "+CGDCONT:", 0, &pResponse); if (ret != 0 || pResponse == NULL || !pResponse->success) { @@ -406,7 +407,7 @@ static int32_t QueryAllSupportPDNInfos(PDNInfo *pdnInfo) FreeResponseInfo(pResponse); return errInfo.errorNo; } - for (pLine = pResponse->head; pLine != NULL; pLine = pLine->next) { + for (pLine = pResponse->head; pLine != NULL && pdnCount < MAX_PDP_NUM; pLine = pLine->next) { pStr = pLine->data; ret = SkipATPrefix(&pStr); if (ret < 0) { @@ -425,6 +426,7 @@ static int32_t QueryAllSupportPDNInfos(PDNInfo *pdnInfo) pdns->cid = INT_DEFAULT_VALUE; } pdns++; + pdnCount++; } FreeResponseInfo(pResponse); return ret;