diff options
author | Hiro <Hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-05-17 11:27:39 +0000 |
---|---|---|
committer | Hiro <Hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-05-17 11:27:39 +0000 |
commit | 140dfce957ed7512bb9c4eed094a78f191e61c07 (patch) | |
tree | 6129c1c5a5e77d0fd8465ee46a9bab63e414a945 | |
parent | 755f97a9347ce09369cc6f6949c899de6b8acdc5 (diff) |
fixed execution failure when using accessibility module, and character corruption and buffer overflow on sending when using half-width kana.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1068 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libsylph/codeconv.c | 7 | ||||
-rw-r--r-- | src/main.c | 3 |
3 files changed, 11 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2006-05-17 + + * src/main.c: fixed execution failure when using accessibility module. + * libsylph/codeconv.c: conv_sjistojis(): fixed character corruption + and buffer overflow when using half-width kana. + 2006-05-09 * src/summaryview.c: don't decrease new/unread count if zero. diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c index 76d75336..d7c726f0 100644 --- a/libsylph/codeconv.c +++ b/libsylph/codeconv.c @@ -587,7 +587,7 @@ static gchar *conv_sjistojis(const gchar *inbuf, gint *error) gint error_ = 0; guint idx; - outbuf = g_malloc(strlen(inbuf) * 3 + 4); + outbuf = g_malloc(strlen(inbuf) * 5 + 4); out = (guchar *)outbuf; while (*in != '\0') { @@ -614,7 +614,6 @@ static gchar *conv_sjistojis(const gchar *inbuf, gint *error) } else if (issjishwkana(*in)) { if (prefs_common.allow_jisx0201_kana) { HW_IN(); - in++; *out++ = *in++ & 0x7f; } else { guchar jis_ch[2]; @@ -629,10 +628,10 @@ static gchar *conv_sjistojis(const gchar *inbuf, gint *error) (jis_ch, *in, '\0'); if (len == 0) - in += 2; + in++; else { K_IN(); - in += len * 2; + in += len; *out++ = jis_ch[0]; *out++ = jis_ch[1]; } @@ -188,7 +188,8 @@ int main(int argc, char *argv[]) gtk_widget_set_default_visual(gdk_rgb_get_visual()); #if USE_THREADS || USE_LDAP - g_thread_init(NULL); + if (!g_thread_supported()) + g_thread_init(NULL); if (!g_thread_supported()) g_error(_("g_thread is not supported by glib.\n")); #endif |