This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2019-03-19.14:57:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553007457.48.0.128688870738.issue36365@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-03-19 14:57:37vstinnersetrecipients: + vstinner
2019-03-19 14:57:37vstinnersetmessageid: <1553007457.48.0.128688870738.issue36365@roundup.psfhosted.org>
2019-03-19 14:57:37vstinnerlinkissue36365 messages
2019-03-19 14:57:37vstinnercreate