1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 23:31:55 -08:00

* xselect.c (x_check_property_data): Return correct size (Bug#8335).

This commit is contained in:
Paul Eggert 2011-03-23 21:17:44 -07:00
parent f86c98305d
commit 44f730c85e
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2011-03-24 Paul Eggert <eggert@cs.ucla.edu>
* xselect.c (x_check_property_data): Return correct size (Bug#8335).
2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
* xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow

View file

@ -2190,7 +2190,8 @@ and t is the same as `SECONDARY'. */)
***********************************************************************/
/* Check that lisp values are of correct type for x_fill_property_data.
That is, number, string or a cons with two numbers (low and high 16
bit parts of a 32 bit number). */
bit parts of a 32 bit number). Return the number of items in DATA,
or -1 if there is an error. */
int
x_check_property_data (Lisp_Object data)
@ -2198,15 +2199,16 @@ x_check_property_data (Lisp_Object data)
Lisp_Object iter;
int size = 0;
for (iter = data; CONSP (iter) && size != -1; iter = XCDR (iter), ++size)
for (iter = data; CONSP (iter); iter = XCDR (iter))
{
Lisp_Object o = XCAR (iter);
if (! NUMBERP (o) && ! STRINGP (o) && ! CONSP (o))
size = -1;
return -1;
else if (CONSP (o) &&
(! NUMBERP (XCAR (o)) || ! NUMBERP (XCDR (o))))
size = -1;
return -1;
size++;
}
return size;