Hello,
I'm the maintainer off the sane-backends package for OpenBSD.
After working with some OpenBSD developers, I'm sending you a couple of
patches so you might consider them for inclusion in the official release.
Regards,
Antoine
-------------- next part --------------
$OpenBSD: patch-frontend_scanimage_c,v 1.1.1.1 2005/10/03 21:15:04 alek Exp $
--- frontend/scanimage.c.orig Sun Oct 2 16:17:35 2005
+++ frontend/scanimage.c Sun Oct 2 16:23:55 2005
@@ -172,7 +172,7 @@ auth_callback (SANE_String_Const resourc
else
len = strlen (resource);
- while (fgets (tmp, 512, pass_file))
+ while (fgets (tmp, sizeof(tmp), pass_file))
{
if ((strlen (tmp) > 0) && (tmp[strlen (tmp) - 1] == '\n'))
-------------- next part --------------
$OpenBSD: patch-backend_fujitsu_c,v 1.1.1.1 2005/10/03 21:15:04 alek Exp $
--- backend/fujitsu.c.orig Sun Oct 2 16:01:38 2005
+++ backend/fujitsu.c Sun Oct 2 16:13:22 2005
@@ -7629,7 +7629,7 @@ setDefaults3096 (struct fujitsu *scanner
scanner->imprinter_direction = S_im_dir_top_bottom;
scanner->imprinter_y_offset = 7;
- memcpy(scanner->imprinter_string, "%05ud", max_imprinter_string_length);
+ strlcpy(scanner->imprinter_string, "%05ud", max_imprinter_string_length);
scanner->imprinter_ctr_init = 0;
scanner->imprinter_ctr_step = 1;
scanner->imprinter_ctr_dir = S_im_dir_inc;
From [email protected] Thu Oct 6 16:30:03 2005
From: [email protected] (Frank Zago)
Date: Thu Oct 6 16:30:41 2005
Subject: [!SPAM!] [DSBL][sane-devel] 2 patches for sane-backends
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>
Hi Antoine,
> Hello,
>
> I'm the maintainer off the sane-backends package for OpenBSD.
> After working with some OpenBSD developers, I'm sending you a couple
> of patches so you might consider them for inclusion in the official
> release.
>
> Regards,
>
> Antoine
>
>------------------------------------------------------------------------
>
>$OpenBSD: patch-backend_fujitsu_c,v 1.1.1.1 2005/10/03 21:15:04 alek Exp $
>--- backend/fujitsu.c.orig Sun Oct 2 16:01:38 2005
>+++ backend/fujitsu.c Sun Oct 2 16:13:22 2005
>@@ -7629,7 +7629,7 @@ setDefaults3096 (struct fujitsu *scanner
>
> scanner->imprinter_direction = S_im_dir_top_bottom;
> scanner->imprinter_y_offset = 7;
>- memcpy(scanner->imprinter_string, "%05ud", max_imprinter_string_length);
>+ strlcpy(scanner->imprinter_string, "%05ud", max_imprinter_string_length);
> scanner->imprinter_ctr_init = 0;
> scanner->imprinter_ctr_step = 1;
> scanner->imprinter_ctr_dir = S_im_dir_inc;
>
>
While this is a correct fix, strlcpy is a BSD only call, so it should be
replaced by strcpy. It's ok because scanner->imprinter_string is 40
bytes long so there's no overflow here.
Frank.