closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs.#24239
closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs.#24239benjaminp merged 1 commit intopython:masterfrom benjaminp:buffer
Conversation
…ctypes param reprs.
|
Thanks @benjaminp for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7, 3.8, 3.9. |
|
Sorry, @benjaminp, I could not cleanly backport this to |
|
Sorry @benjaminp, I had trouble checking out the |
00357 # CVE-2021-3177: Replace snprintf with Python unicode formatting in ctypes param reprs Backport of Python3 commit 916610e: https://bugs.python.org/issue42938 python#24239
|
Isn't the commit message here rather misleading? These weren't snprintf calls, which is exactly what allowed them to overflow. If this PR did what it claims to do, this would only be a bug fix for truncated precision when printing some values, not a security patch. One can clearly see in the code that sprintf is being used, not snprintf. |
It is. But I guess this is to be interpreted as "even better than just fixing it with the second best solution, which would be |
That would be the wrong interpretation. To replace means to take the place of, and |
bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. This is a backport of python/cpython#24239 sourced from https://salsa.debian.org/saifelse/python2/-/commit/cac0240f5b8d8460f5e3217fd23de256109b0847
00357 # CVE-2021-3177: Replace snprintf with Python unicode formatting in ctypes param reprs Backport of Python3 commit 916610e: https://bugs.python.org/issue42938 python#24239
00357 # CVE-2021-3177: Replace snprintf with Python unicode formatting in ctypes param reprs Backport of Python3 commit 916610e: https://bugs.python.org/issue42938 python#24239
00357 # CVE-2021-3177: Replace snprintf with Python unicode formatting in ctypes param reprs Backport of Python3 commit 916610e: https://bugs.python.org/issue42938 python#24239
00357 # CVE-2021-3177: Replace snprintf with Python unicode formatting in ctypes param reprs Backport of Python3 commit 916610e: https://bugs.python.org/issue42938 python#24239
https://bugs.python.org/issue42938