plug a whole bunch of off-by-ones in various scanf routines;

patches submitted upstream, PKGNAME bumped
This commit is contained in:
avsm 2003-06-17 00:52:12 +00:00
parent 47b26d3b14
commit 8c19dbebc8
3 changed files with 95 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.21 2002/12/28 20:03:22 jcs Exp $
# $OpenBSD: Makefile,v 1.22 2003/06/17 00:52:12 avsm Exp $
DISTNAME= gkrellm-1.2.13
PKGNAME= ${DISTNAME}p1
PKGNAME= ${DISTNAME}p2
HOMEPAGE= http://www.gkrellm.net/
COMMENT= "single process stack of system monitors"

View File

@ -0,0 +1,48 @@
$OpenBSD: patch-src_config_c,v 1.1 2003/06/17 00:52:12 avsm Exp $
--- src/config.c.orig Tue Jun 17 01:40:56 2003
+++ src/config.c Tue Jun 17 01:42:01 2003
@@ -886,7 +886,7 @@ assign_gkrellmrc_spacer_height(gchar *so
gchar style_name[32];
gint h;
- if (sscanf(string, "%32s %d", style_name, &h) != 2)
+ if (sscanf(string, "%31s %d", style_name, &h) != 2)
return;
if ((mon = lookup_monitor_from_style_name(style_name)) == NULL)
return;
@@ -1216,7 +1216,7 @@ gkrellm_set_image_border(gchar *image_na
s = list->data;
if ((r = strchr(s, '=')) != NULL)
*r = ' ';
- sscanf(s, "%64s %32s", name, border_string);
+ sscanf(s, "%63s %31s", name, border_string);
if (!strcmp(name, image_name))
{
set_border(&b, border_string);
@@ -1245,7 +1245,7 @@ gkrellm_get_gkrellmrc_image_border(gchar
s = list->data;
if ((r = strchr(s, '=')) != NULL)
*r = ' ';
- sscanf(s, "%64s %32s", name, border_string);
+ sscanf(s, "%63s %31s", name, border_string);
if (!strcmp(name, image_name))
{
set_border(&b, border_string);
@@ -1273,7 +1273,7 @@ gkrellm_get_gkrellmrc_integer(gchar *int
s = list->data;
if ((r = strchr(s, '=')) != NULL)
*r = ' ';
- sscanf(s, "%64s %64s", name, string);
+ sscanf(s, "%63s %63s", name, string);
if (!strcmp(name, int_name) && sscanf(string, "%d", result) == 1)
found = TRUE;
}
@@ -1294,7 +1294,7 @@ gkrellm_get_gkrellmrc_string(gchar *stri
s = list->data;
if ((r = strchr(s, '=')) != NULL)
*r = ' ';
- sscanf(s, "%64s %[^\n]", name, string);
+ sscanf(s, "%63s %[^\n]", name, string);
if (!strcmp(name, string_name))
{
if ((s = cut_quoted_string(string, NULL)) != NULL)

View File

@ -0,0 +1,45 @@
$OpenBSD: patch-src_mail_c,v 1.1 2003/06/17 00:52:12 avsm Exp $
--- src/mail.c.orig Tue Jun 17 01:37:32 2003
+++ src/mail.c Tue Jun 17 01:40:52 2003
@@ -895,7 +895,7 @@ check_pop3(Mailbox *mbox)
/* Set the new_mail_count only if the UIDL is changed to avoid
| re-reporting mail is new after MUA button has been clicked.
*/
- if ( sscanf(mbox->tcp_in->str, "+OK %*d %128s", line) == 1
+ if ( sscanf(mbox->tcp_in->str, "+OK %*d %127s", line) == 1
&& ( gkrellm_dup_string((gchar **) (&mbox->private), line)
|| unseen_is_new
)
@@ -1665,16 +1665,16 @@ make_fetch_tooltip(gchar *line, gint msg
if ((s = strstr(line, "sequence unseen")) != NULL) /* flist */
{
- sscanf(line, "%64s", buf);
+ sscanf(line, "%63s", buf);
account->username = g_strdup(buf);
}
else if ((s = strstr(line, " for ")) != NULL) /* fetchmail */
{
- sscanf(s + 5, "%64s", buf);
+ sscanf(s + 5, "%63s", buf);
account->username = g_strdup(buf);
if ((s = strstr(line, " at ")) != NULL)
{
- sscanf(s + 4, "%64s", buf);
+ sscanf(s + 4, "%63s", buf);
account->server = g_strdup(buf);
}
if ((s = strstr(line, "(folder ")) != NULL)
@@ -2493,10 +2493,10 @@ load_mail_config(gchar *arg)
account = g_new0(MailAccount, 1);
account_prev = NULL;
account->mboxtype = MBOX_REMOTE;
- n = sscanf(item, "%32s %256s \"%64[^\"]\" \"%64[^\"]\" %d %64s",
+ n = sscanf(item, "%31s %255s \"%63[^\"]\" \"%63[^\"]\" %d %63s",
auth, server, username, password, &account->port, folder);
if (n < 5)
- n = sscanf(item, "%32s %256s %64s %64s %d %64s",
+ n = sscanf(item, "%31s %255s %63s %63s %d %63s",
auth, server, username, password, &account->port, folder);
if (n >= 5)
{