Steve Dower <[email protected]> added the comment:
According to a couple of scanf docs I found, the '%x' format expects to write
into unsigned int*, just as we already do. So it shouldn't be possible to
overflow there.
The following line (or-ing all the values and checking that it's less than 256)
handles the overflow already.
Limiting each %x specifier to two characters has exactly the same effect, and
could potentially fix overflow errors in C runtimes that assume a larger
destination without the data size prefix ('%zx' or '%llx'), but I don't know of
any of those.
All that said, I'm not opposed to adding the tests. If the parsing logic is a
sticking point, then that can be undone, but I think it's also okay.
----------
nosy: +steve.dower
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue18564>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com