Message85657
| Author |
amaury.forgeotdarc |
| Recipients |
amaury.forgeotdarc, giampaolo.rodola, loewis, marcelo_fernandez |
| Date |
2009年04月06日.17:42:41 |
| SpamBayes Score |
2.598538e-11 |
| Marked as misclassified |
No |
| Message-id |
<1239039763.66.0.441498255465.issue5672@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Some remarks about the patch:
1 - this line causes a buffer overrun:
strncpy(argv[0], name , strlen(name));
A possible solution is to do like posix_putenv(): have a static PyString
that holds the memory, and just change the pointer argv[0]:
argv[0] = PyString_AS_STRING(name);
2 - The function should update sys.argv as well. In this case,
os.getprocname is not necessary. |
|