[issue33706] Segfault in command line processing due to buffer over-read

Christoph Gohlke report at bugs.python.org
Thu May 31 02:31:10 EDT 2018


New submission from Christoph Gohlke <cgohlke at uci.edu>:

When testing Python 3.7.0b5 x64 (and betas before) on Windows 10, I occasionally get segfaults when passing a program as string on the command line. The shortest command to reproduce this on my system is `python.exe -c 1` with heap detection turned on but that might not be reproducible on other systems.

It turns out there is a buffer over-read when copying the `PyOS_optarg` string in `main.c`. The attached patch fixes the segfault on my system.

----------
files: master...cgohlke patch-1.diff
keywords: patch
messages: 318260
nosy: cgohlke
priority: normal
severity: normal
status: open
title: Segfault in command line processing due to buffer over-read
versions: Python 3.7
Added file: https://bugs.python.org/file47628/master...cgohlke patch-1.diff

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33706>
_______________________________________


More information about the Python-bugs-list mailing list