You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change was done along with other strcpy replacements since its known that pucUDPPayloadBuffer is big enough to hold the pcHostName as its allocated with the size of pcHostName accounted for in the size calculation here.
Since its causing compiler warnings with strict settings, it makes sense to update it, probably back to strcpy or memcpy.
GCC version: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 doesn't produce this warning with any of the -Wstringop-overflow= types [0 to 4]. Are you using any other compiler flags?
Describe the bug
GCC (with strict settings) raises the following error
error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
for the line below
FreeRTOS-Plus-TCP/source/FreeRTOS_DNS.c
Line 1507 in fbb668a
and it is not wrong. Why use
strncpy()
if we do not have a useful length parameter in this scope?I see 3 possible fixes:
prvGetPayloadBuffer()
strcpy()
again (revert change from 4c4223a)memcpy()
The text was updated successfully, but these errors were encountered: