mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug#340358: mem/string-handling crasher fix.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13894 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
fd3164b629
commit
014a0bf8a2
@ -1,3 +1,9 @@
|
|||||||
|
2006-05-01 Joshua Sled <jsled@asynchronous.org>
|
||||||
|
|
||||||
|
* src/register/register-gnome/pricecell-gnome.c
|
||||||
|
(gnc_price_cell_direct_update): null-terminate strings we traffic
|
||||||
|
in, leading to less crashes! :( Bug#340358.
|
||||||
|
|
||||||
2006-04-30 David Hampton <hampton@employees.org>
|
2006-04-30 David Hampton <hampton@employees.org>
|
||||||
|
|
||||||
* src/gnome/reconcile-list.c: Patch from Mike Alexander to fix the
|
* src/gnome/reconcile-list.c: Patch from Mike Alexander to fix the
|
||||||
|
@ -127,7 +127,8 @@ gnc_price_cell_direct_update (BasicCell *bcell,
|
|||||||
end = MAX(*start_selection, *end_selection);
|
end = MAX(*start_selection, *end_selection);
|
||||||
|
|
||||||
/* length in bytes, not chars. do not use g_utf8_strlen. */
|
/* length in bytes, not chars. do not use g_utf8_strlen. */
|
||||||
buf = malloc(strlen(bcell->value));
|
buf = malloc(strlen(bcell->value)+1);
|
||||||
|
memset(buf, 0, strlen(bcell->value)+1);
|
||||||
g_utf8_strncpy(buf, bcell->value, start);
|
g_utf8_strncpy(buf, bcell->value, start);
|
||||||
g_string_append(newval_gs, buf);
|
g_string_append(newval_gs, buf);
|
||||||
g_free(buf);
|
g_free(buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user