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 christian.heimes
Recipients christian.heimes
Date 2012-09-10.16:09:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347293386.49.0.00561600810364.issue15905@psf.upfronthosting.co.za>
In-reply-to
Content
In Python/sysmodule.c the function sys_update_path() uses wcscpy to copy data to a fixed size buffer. The input comes from an external source (argv[0]) and could theoretically be larger than the buffer.

Suggested solution:
Increase the buffer a bit:

    wchar_t argv0copy[sizeof(wchar_t)* (MAXPATHLEN+1)];

and use wcsncpy:

    wcsncpy(argv0copy, argv0, MAXPATHLEN);
    argv0copy[MAXPATHLEN] = L'\0';


CID 486850
History
Date User Action Args
2012-09-10 16:09:46christian.heimessetrecipients: + christian.heimes
2012-09-10 16:09:46christian.heimessetmessageid: <1347293386.49.0.00561600810364.issue15905@psf.upfronthosting.co.za>
2012-09-10 16:09:46christian.heimeslinkissue15905 messages
2012-09-10 16:09:45christian.heimescreate