emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use of memcmp in font.c


From: Chong Yidong
Subject: Use of memcmp in font.c
Date: Mon, 09 Jun 2008 17:55:05 -0400

Is the use of memcmp in font.c:1384 safe?  It seems to me that if the
string being parsed ends early, we'll get a segmentation fault.

  /* Now parse ":KEY=VAL" patterns.  Store known keys and values in
     extra, copy unknown ones to COPY.  It is stored in extra slot by
     the key QCfc_unknown_spec.  */
  while (*p0)
    {
      Lisp_Object key, val;
      int prop;

      for (p1 = p0 + 1; *p1 && *p1 != '=' && *p1 != ':'; p1++);
      if (*p1 != '=')
        {
          /* Must be an enumerated value.  */
          val = font_intern_prop (p0 + 1, p1 - p0 - 1);
          if (memcmp (p0 + 1, "light", 5) == 0
              || memcmp (p0 + 1, "medium", 6) == 0
  .....




reply via email to

[Prev in Thread] Current Thread [Next in Thread]