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