[!SPAM!] [DSBL][sane-devel] 2 patches for sane-backends
Frank Zago
sane at zago.net
Thu Oct 6 16:30:03 UTC 2005
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.
More information about the sane-devel
mailing list