From: Paul Eggert Date: Tue, 21 Jun 2011 01:30:32 +0000 (-0700) Subject: * xdisp.c (display_mode_element): Don't assume strlen fits in int. X-Git-Tag: emacs-pretest-24.0.90~104^2~473^2~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=df1f27af9e60e8f223cce0f5e5ac4107d87f982e;p=emacs.git * xdisp.c (display_mode_element): Don't assume strlen fits in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index bcff6fd0831..8c530340927 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,7 @@ not unsigned long, as we prefer signed integers. All callers changed. Detect integer overflow in repeat count. (message_dolog): Don't assume print length fits in 39 bytes. + (display_mode_element): Don't assume strlen fits in int. * termcap.c: Don't assume sizes fit in int and never overflow. (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes. diff --git a/src/xdisp.c b/src/xdisp.c index ce60b658a73..ae5c334447d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18730,8 +18730,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, break; case MODE_LINE_STRING: { - int len = strlen (spec); - Lisp_Object tem = make_string (spec, len); + Lisp_Object tem = build_string (spec); props = Ftext_properties_at (make_number (charpos), elt); /* Should only keep face property in props */ n += store_mode_line_string (NULL, tem, 0, field, prec, props);