corrected possible overrun when inserting into GStrings

-Yosh
This commit is contained in:
Manish Singh 1998-04-04 01:20:45 +00:00
parent 07a8601adf
commit 59d586e2ff
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Fri Apr 3 17:03:18 PST 1998 Manish Singh <yosh@gimp.org>
* gstring.c: corrected possible overrun when inserting into
GStrings (thanks Elrond)
Fri Apr 3 18:05:45 1998 Owen Taylor <owt1@cornell.edu>
* testglib.c: Removed literal german from strings
@ -13,7 +18,7 @@ Wed Mar 25 15:23:37 1998 Owen Taylor <owt1@cornell.edu>
* Makefile.am: Switched glibconfig.h rule from HEADERS
to DATA, so that it is not added to DISTFILES
Wed Mar 18 22:27:08 PST 1998
Wed Mar 18 22:27:08 PST 1998 Manish Singh <yosh@gimp.org>
* garray.c: g_rarray_truncate length done correctly

View File

@ -324,7 +324,7 @@ g_string_insert (GString *fstring, gint pos, gchar *val)
g_string_maybe_expand (string, len);
g_memmove (string->str + pos + len, string->str + pos, string->len);
g_memmove (string->str + pos + len, string->str + pos, string->len - pos);
strncpy (string->str + pos, val, len);
@ -344,7 +344,7 @@ g_string_insert_c (GString *fstring, gint pos, gchar c)
g_string_maybe_expand (string, 1);
g_memmove (string->str + pos + 1, string->str + pos, string->len);
g_memmove (string->str + pos + 1, string->str + pos, string->len - pos);
string->str[pos] = c;