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 jonheiner
Recipients jonheiner, mark.dickinson, meador.inge
Date 2015-03-30.21:27:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427750823.57.0.914162685824.issue23816@psf.upfronthosting.co.za>
In-reply-to
Content
I believe there is an issue with the _struct.c handling of Pascal style strings.

In the _struct.c:s_unpack_internal() function (reading 2.7.6 and 2.7.9 source from tgz ball), the size parameter 'n' is clamped to code->size-1.

As far as I can tell, 'n' is set to the correct deserialized value, but the code->size value is not set to 255. I could be incorrect, as I'm not running in a debugger.

I've attached a short repro case. Note the use of unpack_from() as otherwise unpac() will thrown an error. Additionally, I may be using it wrong, but this feels correct.
History
Date User Action Args
2015-03-30 21:27:03jonheinersetrecipients: + jonheiner, mark.dickinson, meador.inge
2015-03-30 21:27:03jonheinersetmessageid: <1427750823.57.0.914162685824.issue23816@psf.upfronthosting.co.za>
2015-03-30 21:27:03jonheinerlinkissue23816 messages
2015-03-30 21:27:03jonheinercreate