Skip to content

Commit 82b128a

Browse files
authored
Merge branch 'main' into cov
2 parents e65e44f + c80540c commit 82b128a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/FreeRTOS_DNS.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@
282282

283283
( void ) memset( pxAddrInfo, 0, sizeof( *pxAddrInfo ) );
284284
pxAddrInfo->ai_canonname = pxAddrInfo->xPrivateStorage.ucName;
285-
( void ) strncpy( pxAddrInfo->xPrivateStorage.ucName, pcName, sizeof( pxAddrInfo->xPrivateStorage.ucName ) );
285+
( void ) strncpy( pxAddrInfo->xPrivateStorage.ucName, pcName, sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1 );
286+
pxAddrInfo->xPrivateStorage.ucName[ sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1 ] = '\0';
286287

287288
pxAddrInfo->ai_addr = ( ( struct freertos_sockaddr * ) &( pxAddrInfo->xPrivateStorage.sockaddr ) );
288289

0 commit comments

Comments
 (0)