We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e65e44f + c80540c commit 82b128aCopy full SHA for 82b128a
source/FreeRTOS_DNS.c
@@ -282,7 +282,8 @@
282
283
( void ) memset( pxAddrInfo, 0, sizeof( *pxAddrInfo ) );
284
pxAddrInfo->ai_canonname = pxAddrInfo->xPrivateStorage.ucName;
285
- ( void ) strncpy( pxAddrInfo->xPrivateStorage.ucName, pcName, sizeof( pxAddrInfo->xPrivateStorage.ucName ) );
+ ( void ) strncpy( pxAddrInfo->xPrivateStorage.ucName, pcName, sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1 );
286
+ pxAddrInfo->xPrivateStorage.ucName[ sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1 ] = '\0';
287
288
pxAddrInfo->ai_addr = ( ( struct freertos_sockaddr * ) &( pxAddrInfo->xPrivateStorage.sockaddr ) );
289
0 commit comments