Commit c35a847e by Richard Stallman

(objc_read_string): Allocate string properly.

From-SVN: r6013
parent a5b1eb34
...@@ -617,8 +617,11 @@ objc_read_string (struct objc_typed_stream* stream, ...@@ -617,8 +617,11 @@ objc_read_string (struct objc_typed_stream* stream,
case _B_UCOMM: case _B_UCOMM:
{ {
len = __objc_read_nbyte_uint(stream, (buf[0] & _B_VALUE), &key); char *tmp;
(*string) = hash_value_for_key (stream->stream_table, (void*)key); len = __objc_read_nbyte_uint (stream, (buf[0] & _B_VALUE), &key);
tmp = hash_value_for_key (stream->stream_table, (void*)key);
*string = __objc_xmalloc (strlen (tmp) + 1);
strcpy (*string, tmp);
} }
break; break;
......
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