changeset 5804:75435be92103

Avoid make_uninit_string() for the command builder's echo_buf. src/ChangeLog addition: 2014-08-03 Aidan Kehoe <kehoea@parhasard.net> * event-stream.c (allocate_command_builder): * event-stream.c (Fnext_event): Use #'make-string rather than make_uninit_string() when allocating the command builder's echo_buf, avoiding having octets in the string that do not correspond to valid internal-format text.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 03 Aug 2014 20:13:40 +0100
parents b79e1e02bf01
children 8139bdf8db04
files src/ChangeLog src/event-stream.c
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Jul 14 13:42:42 2014 +0100
+++ b/src/ChangeLog	Sun Aug 03 20:13:40 2014 +0100
@@ -1,3 +1,11 @@
+2014-08-03  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* event-stream.c (allocate_command_builder):
+	* event-stream.c (Fnext_event):
+	Use #'make-string rather than make_uninit_string() when allocating
+	the command builder's echo_buf, avoiding having octets in the
+	string that do not correspond to valid internal-format text.
+
 2014-07-14  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* event-stream.c:
--- a/src/event-stream.c	Mon Jul 14 13:42:42 2014 +0100
+++ b/src/event-stream.c	Sun Aug 03 20:13:40 2014 +0100
@@ -380,7 +380,8 @@
   reset_command_builder_event_chain (builder);
   if (with_echo_buf)
     {
-      builder->echo_buf = make_uninit_string (300 * MAX_ICHAR_LEN);
+      builder->echo_buf = Fmake_string (make_fixnum (300 * MAX_ICHAR_LEN),
+                                        make_char (0));
     }
   else
     {
@@ -2176,7 +2177,8 @@
       if (XSTRING_LENGTH (command_builder->echo_buf) < len)
         {
           command_builder->echo_buf
-            = make_uninit_string (len + 200 * MAX_ICHAR_LEN);
+            = Fmake_string (make_fixnum (len + 300 * MAX_ICHAR_LEN),
+                            make_char (0));
         }
 
       args[0] = command_builder->echo_buf;