Commit 3e67a981 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

Avoid more integer overflows on string size calculations.

* category.c (Fmake_category_set):
* xdisp.c (get_overlay_arrow_glyph_row):
* w32font.c (intern_font_name): Prefer ptrdiff_t to int.
parent b98b1a83
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
(x_clipboard_manager_save_all): (x_clipboard_manager_save_all):
* xterm.c (x_term_init): Use build_local_string. * xterm.c (x_term_init): Use build_local_string.
   
Avoid more integer overflows on string size calculations.
* category.c (Fmake_category_set):
* xdisp.c (get_overlay_arrow_glyph_row):
* w32font.c (intern_font_name): Prefer ptrdiff_t to int.
2014-09-15 Eli Zaretskii <eliz@gnu.org> 2014-09-15 Eli Zaretskii <eliz@gnu.org>
   
* sound.c [WINDOWSNT]: Include w32common.h and mbstring.h. * sound.c [WINDOWSNT]: Include w32common.h and mbstring.h.
......
...@@ -96,7 +96,7 @@ those categories. */) ...@@ -96,7 +96,7 @@ those categories. */)
(Lisp_Object categories) (Lisp_Object categories)
{ {
Lisp_Object val; Lisp_Object val;
int len; ptrdiff_t len;
CHECK_STRING (categories); CHECK_STRING (categories);
val = MAKE_CATEGORY_SET; val = MAKE_CATEGORY_SET;
......
...@@ -287,7 +287,7 @@ Lisp_Object ...@@ -287,7 +287,7 @@ Lisp_Object
intern_font_name (char * string) intern_font_name (char * string)
{ {
Lisp_Object str = DECODE_SYSTEM (build_string (string)); Lisp_Object str = DECODE_SYSTEM (build_string (string));
int len = SCHARS (str); ptrdiff_t len = SCHARS (str);
Lisp_Object obarray = check_obarray (Vobarray); Lisp_Object obarray = check_obarray (Vobarray);
Lisp_Object tem = oblookup (obarray, SDATA (str), len, len); Lisp_Object tem = oblookup (obarray, SDATA (str), len, len);
/* This code is similar to intern function from lread.c. */ /* This code is similar to intern function from lread.c. */
......
...@@ -18858,7 +18858,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) ...@@ -18858,7 +18858,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
struct buffer *buffer = XBUFFER (w->contents); struct buffer *buffer = XBUFFER (w->contents);
struct buffer *old = current_buffer; struct buffer *old = current_buffer;
const unsigned char *arrow_string = SDATA (overlay_arrow_string); const unsigned char *arrow_string = SDATA (overlay_arrow_string);
int arrow_len = SCHARS (overlay_arrow_string); ptrdiff_t arrow_len = SCHARS (overlay_arrow_string);
const unsigned char *arrow_end = arrow_string + arrow_len; const unsigned char *arrow_end = arrow_string + arrow_len;
const unsigned char *p; const unsigned char *p;
struct it it; struct it it;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment