[balsa/gtk3] Use sscanf field limits
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Use sscanf field limits
- Date: Sun, 22 Jul 2012 19:43:41 +0000 (UTC)
commit 8e900402ce1c50ad7f873e0b93a3b8897d049e44
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sun Jul 22 15:26:39 2012 -0400
Use sscanf field limits
* libbalsa/mailbox_mh.c (lbm_mh_parse_mailbox),
(lbm_mh_handle_seq_line), (lbm_mh_check): use sscanf field
limits.
ChangeLog | 6 ++++++
libbalsa/mailbox_mh.c | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4b628b2..65749cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2012-07-22 Peter Bloomfield
+ * libbalsa/mailbox_mh.c (lbm_mh_parse_mailbox),
+ (lbm_mh_handle_seq_line), (lbm_mh_check): use sscanf field
+ limits.
+
+2012-07-22 Peter Bloomfield
+
* libbalsa/mailbox_mbox.c (lbm_mbox_stream_seek_to_message):
avoid unread variable error.
diff --git a/libbalsa/mailbox_mh.c b/libbalsa/mailbox_mh.c
index 1c79755..e529d57 100644
--- a/libbalsa/mailbox_mh.c
+++ b/libbalsa/mailbox_mh.c
@@ -362,7 +362,7 @@ lbm_mh_parse_mailbox(LibBalsaMailboxMh * mh, gboolean add_msg_info)
if (lbm_mh_check_filename(filename) == FALSE)
continue;
- if (sscanf(filename, "%d", &fileno) != 1)
+ if (sscanf(filename, "%10d", &fileno) != 1)
break; /* FIXME report error? */
if (fileno > mh->last_fileno)
mh->last_fileno = fileno;
@@ -442,10 +442,10 @@ lbm_mh_handle_seq_line(LibBalsaMailboxMh * mh, gchar * line)
line = strchr(*seq, '-');
if (line) {
*line++ = '\0';
- if (sscanf(line, "%d", &end) != 1)
+ if (sscanf(line, "%10d", &end) != 1)
break; /* FIXME report error? */
}
- if (sscanf(*seq, "%d", &fileno) != 1)
+ if (sscanf(*seq, "%10d", &fileno) != 1)
break; /* FIXME report error? */
do
lbm_mh_set_flag(mh, fileno, flag);
@@ -589,10 +589,10 @@ lbm_mh_check(LibBalsaMailboxMh * mh, const gchar * path)
p = strchr(*seq, '-');
if (p) {
*p++ = '\0';
- if (sscanf(p, "%d", &end) != 1)
+ if (sscanf(p, "%10d", &end) != 1)
break; /* FIXME report error? */
}
- if (sscanf(*seq, "%d", &fileno) != 1)
+ if (sscanf(*seq, "%10d", &fileno) != 1)
break; /* FIXME report error? */
do {
p = g_strdup_printf("%s/%d", path, fileno);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]