Issue 2591: ErrorHandler buffer overflow in ?unused? SGI extension module almodule.c (original) (raw)

I don't think any of these SGI modules even get used, but they're really buggy-- you guys might want to consider just dropping them all together.

When printing errors larger than 128 bytes a stack based overflow occurs.

44 static void 45 ErrorHandler(long code, const char *fmt, ...) 46 { 47 va_list args; 48 char buf[128]; 49 50 va_start(args, fmt); 51 vsprintf(buf, fmt, args); 52 va_end(args); 53 PyErr_SetString(ErrorObject, buf); 54 }