[File] [PATCH] encoding: Fix backward compatibility with 5.39

Christos Zoulas christos at zoulas.com
Sun Apr 4 21:03:55 UTC 2021


Fixed, thanks!

christos

> On Apr 4, 2021, at 4:10 PM, Anatol Belski <ab at php.net> wrote:
> 
> If a file contains just a short ascii string with repeating bytes, the
> behavior won't be same as before 5.40. This ensures all the bytes have
> been taken into account.
> 
> Signed-off-by: Anatol Belski <ab at php.net>
> ---
> src/encoding.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/encoding.c b/src/encoding.c
> index c8b40439..bf28b997 100644
> --- a/src/encoding.c
> +++ b/src/encoding.c
> @@ -283,7 +283,7 @@ looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \
> 	u = 0; \
> 	for (i = 0; i < __arraycount(dist); i++) { \
> 		if (dist[i]) \
> -			u++; \
> +			u += dist[i]; \
> 	} \
> 	if (u < 3) \
> 		return 0; \
> --
> 2.30.2
> 
> --
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> 
> 
> --
> This message has been 'sanitized'.  This means that potentially
> dangerous content has been rewritten or removed.  The following
> log describes which actions were taken.
> 
> Sanitizer (start="1617569092"):
>  Split unusually long word(s) in header.
>  SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
>    Match (names="unnamed.txt", rule="9"):
>      Enforced policy: accept
> 
>  Total modifications so far: 1
> 
> 
> Anomy 0.0.0 : Sanitizer.pm
> $Id: Sanitizer.pm,v 1.94 2006/01/02 16:43:10 bre Exp $

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20210404/17e2b375/attachment.asc>


More information about the File mailing list