From df1f27af9e60e8f223cce0f5e5ac4107d87f982e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 20 Jun 2011 18:30:32 -0700 Subject: [PATCH] * xdisp.c (display_mode_element): Don't assume strlen fits in int. --- src/ChangeLog | 1 + src/xdisp.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.2