mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-14 03:21:44 +03:00
Limit sprintf modes to 10 characters
This commit is contained in:
parent
b5c15e93f2
commit
5f4504bb03
|
@ -1594,9 +1594,8 @@ convert(
|
|||
#ifdef notdef
|
||||
return (Imaging)ImagingError_ValueError("conversion not supported");
|
||||
#else
|
||||
static char buf[256];
|
||||
/* FIXME: may overflow if mode is too large */
|
||||
sprintf(buf, "conversion from %s to %s not supported", imIn->mode, mode);
|
||||
static char buf[100];
|
||||
sprintf(buf, "conversion from %.10s to %.10s not supported", imIn->mode, mode);
|
||||
return (Imaging)ImagingError_ValueError(buf);
|
||||
#endif
|
||||
}
|
||||
|
@ -1645,11 +1644,10 @@ ImagingConvertTransparent(Imaging imIn, const char *mode, int r, int g, int b) {
|
|||
}
|
||||
#else
|
||||
{
|
||||
static char buf[256];
|
||||
/* FIXME: may overflow if mode is too large */
|
||||
static char buf[100];
|
||||
sprintf(
|
||||
buf,
|
||||
"conversion from %s to %s not supported in convert_transparent",
|
||||
"conversion from %.10s to %.10s not supported in convert_transparent",
|
||||
imIn->mode,
|
||||
mode);
|
||||
return (Imaging)ImagingError_ValueError(buf);
|
||||
|
|
Loading…
Reference in New Issue
Block a user