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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-03-19.23:06:20.175>created_at=<Date2019-03-19.14:57:37.473>labels= ['interpreter-core', '3.8']
title="Objects/structseq.c: warning: 'strncpy' specified bound depends on the length of the source argument"updated_at=<Date2019-03-19.23:32:21.585>user='https://github.com/vstinner'
Warning seen on Fedora 29 with GCC 8.3.1 20190223 (Red Hat 8.3.1-2):
Objects/structseq.c: In function 'structseq_repr': Objects/structseq.c:187:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncpy(pbuf, typ->tp_name, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Objects/structseq.c:185:11: note: length computed here
len = strlen(typ->tp_name) > TYPE_MAXSIZE ? TYPE_MAXSIZE :
^~~~~~~~~~~~~~~~~~~~
Attached PR rewrites structseq_repr() using _PyUnicodeWriter for better performance and remove the arbitrary limit of 512 bytes.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: