bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: base64.c vs. newlines


From: Jim Meyering
Subject: Re: base64.c vs. newlines
Date: Fri, 05 Jan 2007 12:34:28 +0100

Simon Josefsson <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>> In the mean time -- sometimes it's easier to review things
>> when they're checked in...
>
> Thanks!  I hope to review it soon.  Sorry about the delay on this...
> I'm still catching up many things after an almost one-month vacation.

No problem.
FYI, I've just found/fixed a bug:

2007-01-05  Jim Meyering  <address@hidden>

        Avoid a used-uninitialized bug for invalid input, i.e., when the size
        of the input, not counting newlines, is 1 % 4.
        * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
        It may be smaller when flushing.

diff --git a/gl/lib/base64.c b/gl/lib/base64.c
index ba7322a..a438d0f 100644
--- a/gl/lib/base64.c
+++ b/gl/lib/base64.c
@@ -506,7 +506,7 @@ base64_decode (struct base64_decode_context *ctx,
            inlen = 0;
            break;
          }
-       if (!decode_4 (non_nl, 4, &out, &outleft))
+       if (!decode_4 (non_nl, inlen, &out, &outleft))
          break;

        inlen = in_end - in;
--
1.4.4.3.g5485




reply via email to

[Prev in Thread] Current Thread [Next in Thread]