diff options
| author | Paul Eggert | 2011-06-19 23:03:10 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-19 23:03:10 -0700 |
| commit | 74ca2eb34bb66901b04d33cbef16ff7c8d8df551 (patch) | |
| tree | 36e5c1677c448f55bc64ef00c200fba1170c0b2e | |
| parent | 9bda3520ff9b70be8645e0ebc38cf212208c444b (diff) | |
| download | emacs-74ca2eb34bb66901b04d33cbef16ff7c8d8df551.tar.gz emacs-74ca2eb34bb66901b04d33cbef16ff7c8d8df551.zip | |
* image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
Don't assume string length fits in int.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/image.c | 16 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 16e8342ee0b..4928e209364 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-06-20 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-06-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]: | ||
| 4 | Don't assume string length fits in int. | ||
| 5 | |||
| 3 | * gtkutil.c (style_changed_cb): Avoid need for strlen. | 6 | * gtkutil.c (style_changed_cb): Avoid need for strlen. |
| 4 | 7 | ||
| 5 | * font.c: Don't assume string length fits in int. | 8 | * font.c: Don't assume string length fits in int. |
diff --git a/src/image.c b/src/image.c index 352f8c486e4..b5b93cb5b69 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -3589,25 +3589,14 @@ xpm_load (struct frame *f, struct image *img) | |||
| 3589 | /* XPM support functions for NS where libxpm is not available. | 3589 | /* XPM support functions for NS where libxpm is not available. |
| 3590 | Only XPM version 3 (without any extensions) is supported. */ | 3590 | Only XPM version 3 (without any extensions) is supported. */ |
| 3591 | 3591 | ||
| 3592 | static int xpm_scan (const unsigned char **, const unsigned char *, | ||
| 3593 | const unsigned char **, int *); | ||
| 3594 | static Lisp_Object xpm_make_color_table_v | ||
| 3595 | (void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object), | ||
| 3596 | Lisp_Object (**) (Lisp_Object, const unsigned char *, int)); | ||
| 3597 | static void xpm_put_color_table_v (Lisp_Object, const unsigned char *, | 3592 | static void xpm_put_color_table_v (Lisp_Object, const unsigned char *, |
| 3598 | int, Lisp_Object); | 3593 | int, Lisp_Object); |
| 3599 | static Lisp_Object xpm_get_color_table_v (Lisp_Object, | 3594 | static Lisp_Object xpm_get_color_table_v (Lisp_Object, |
| 3600 | const unsigned char *, int); | 3595 | const unsigned char *, int); |
| 3601 | static Lisp_Object xpm_make_color_table_h | ||
| 3602 | (void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object), | ||
| 3603 | Lisp_Object (**) (Lisp_Object, const unsigned char *, int)); | ||
| 3604 | static void xpm_put_color_table_h (Lisp_Object, const unsigned char *, | 3596 | static void xpm_put_color_table_h (Lisp_Object, const unsigned char *, |
| 3605 | int, Lisp_Object); | 3597 | int, Lisp_Object); |
| 3606 | static Lisp_Object xpm_get_color_table_h (Lisp_Object, | 3598 | static Lisp_Object xpm_get_color_table_h (Lisp_Object, |
| 3607 | const unsigned char *, int); | 3599 | const unsigned char *, int); |
| 3608 | static int xpm_str_to_color_key (const char *); | ||
| 3609 | static int xpm_load_image (struct frame *, struct image *, | ||
| 3610 | const unsigned char *, const unsigned char *); | ||
| 3611 | 3600 | ||
| 3612 | /* Tokens returned from xpm_scan. */ | 3601 | /* Tokens returned from xpm_scan. */ |
| 3613 | 3602 | ||
| @@ -3629,7 +3618,7 @@ static int | |||
| 3629 | xpm_scan (const unsigned char **s, | 3618 | xpm_scan (const unsigned char **s, |
| 3630 | const unsigned char *end, | 3619 | const unsigned char *end, |
| 3631 | const unsigned char **beg, | 3620 | const unsigned char **beg, |
| 3632 | int *len) | 3621 | ptrdiff_t *len) |
| 3633 | { | 3622 | { |
| 3634 | int c; | 3623 | int c; |
| 3635 | 3624 | ||
| @@ -3799,7 +3788,8 @@ xpm_load_image (struct frame *f, | |||
| 3799 | unsigned char buffer[BUFSIZ]; | 3788 | unsigned char buffer[BUFSIZ]; |
| 3800 | int width, height, x, y; | 3789 | int width, height, x, y; |
| 3801 | int num_colors, chars_per_pixel; | 3790 | int num_colors, chars_per_pixel; |
| 3802 | int len, LA1; | 3791 | ptrdiff_t len; |
| 3792 | int LA1; | ||
| 3803 | void (*put_color_table) (Lisp_Object, const unsigned char *, int, Lisp_Object); | 3793 | void (*put_color_table) (Lisp_Object, const unsigned char *, int, Lisp_Object); |
| 3804 | Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int); | 3794 | Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int); |
| 3805 | Lisp_Object frame, color_symbols, color_table; | 3795 | Lisp_Object frame, color_symbols, color_table; |