[evolution-ews] Bug 655337 - Invalid read in OAB
- From: Chenthill Palanisamy <pchen src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Bug 655337 - Invalid read in OAB
- Date: Wed, 21 Sep 2011 08:28:19 +0000 (UTC)
commit 2329965db44a215d6bb1d7081d1879fc567301fe
Author: Chenthill Palanisamy <pchenthill novell com>
Date: Wed Sep 21 13:57:21 2011 +0530
Bug 655337 - Invalid read in OAB
src/addressbook/e-book-backend-ews.c | 3 ++-
src/addressbook/ews-oab-decoder.c | 10 +++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index 2384980..5d57d9c 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -1395,7 +1395,8 @@ ews_remove_old_gal_file (EBookBackendEws *cbews, GError **error)
if (*error)
return FALSE;
- g_unlink (filename);
+ if (filename)
+ g_unlink (filename);
return TRUE;
}
diff --git a/src/addressbook/ews-oab-decoder.c b/src/addressbook/ews-oab-decoder.c
index 77f855e..05590e3 100644
--- a/src/addressbook/ews-oab-decoder.c
+++ b/src/addressbook/ews-oab-decoder.c
@@ -340,11 +340,11 @@ ews_oab_read_uint16 (GInputStream *is, GCancellable *cancellable, GError **error
}
static gint
-get_pos (const gchar *str, gint len, gchar stop)
+get_pos (const gchar *str, gsize len, gchar stop)
{
- gint i = 0;
+ gsize i = 0;
- while (str [i] != stop && i < len)
+ while (i < len && str [i] != stop)
i++;
return i;
}
@@ -358,7 +358,7 @@ ews_oab_read_upto (GInputStream *is, gchar stop, GCancellable *cancellable, GErr
str = g_string_sized_new (size);
do {
- gint len;
+ gsize len;
gsize bytes_read;
gchar *c = g_malloc0 (size);
@@ -374,7 +374,7 @@ ews_oab_read_upto (GInputStream *is, gchar stop, GCancellable *cancellable, GErr
str = g_string_append_len (str, c, len);
if (len == 0 || len < size) {
- goffset seek = len + 1 - (gint) size;
+ goffset seek = (goffset) len + 1 - (goffset) size;
/* seek back */
g_seekable_seek ((GSeekable *) is, seek, G_SEEK_CUR, cancellable, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]