mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
Fix off-by-one error in native_image_p
* src/image.c (native_image_format): Make array size explicit, to help keep it consistent with its later fmt descriptor copy. (native_image_p): Parse the correct number of keywords (bug#80191).
This commit is contained in:
parent
8e4f96cffb
commit
8b27802256
1 changed files with 3 additions and 3 deletions
|
|
@ -7867,7 +7867,7 @@ enum native_image_keyword_index
|
|||
|
||||
/* Vector of image_keyword structures describing the format
|
||||
of valid user-defined image specifications. */
|
||||
static const struct image_keyword native_image_format[] =
|
||||
static const struct image_keyword native_image_format[NATIVE_IMAGE_LAST] =
|
||||
{
|
||||
{":type", IMAGE_SYMBOL_VALUE, 1},
|
||||
{":data", IMAGE_STRING_VALUE, 0},
|
||||
|
|
@ -7890,8 +7890,8 @@ native_image_p (Lisp_Object object)
|
|||
struct image_keyword fmt[NATIVE_IMAGE_LAST];
|
||||
memcpy (fmt, native_image_format, sizeof fmt);
|
||||
|
||||
if (!parse_image_spec (object, fmt, 10, Qnative_image))
|
||||
return 0;
|
||||
if (!parse_image_spec (object, fmt, NATIVE_IMAGE_LAST, Qnative_image))
|
||||
return false;
|
||||
|
||||
/* Must specify either the :data or :file keyword. */
|
||||
return fmt[NATIVE_IMAGE_FILE].count + fmt[NATIVE_IMAGE_DATA].count == 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue