+2013-08-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_filename_hint): Check for errors in the
+ alist structure.
+
2013-08-13 Eli Zaretskii <eliz@gnu.org>
* window.c (Fwindow_margins): Return nil when there's no marginal
{
Lisp_Object content_type = image_spec_value (spec, QCcontent_type, NULL);
Lisp_Object symbol = intern ("image-content-type-suffixes");
- Lisp_Object suffix;
+ Lisp_Object val;
char *name, *prefix = "/tmp/foo.";
if (NILP (Fboundp (symbol)))
return NULL;
- suffix = Fcar (Fcdr (Fassq (content_type, Fsymbol_value (symbol))));
- if (! STRINGP (suffix))
+ val = Fassq (content_type, Fsymbol_value (symbol));
+ if (! CONSP (val))
return NULL;
- name = xmalloc (strlen (prefix) + SBYTES (suffix) + 1);
+ val = Fcdr (val);
+ if (! CONSP (val))
+ return NULL;
+
+ val = Fcar (val);
+ if (! STRINGP (val))
+ return NULL;
+
+ name = xmalloc (strlen (prefix) + SBYTES (val) + 1);
strcpy(name, prefix);
- strcat(name, SDATA (suffix));
+ strcat(name, SDATA (val));
return name;
}