]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(sexp_transport_iterator_first): Fixed bug,
authorNiels Möller <nisse@lysator.liu.se>
Thu, 7 Nov 2002 08:28:36 +0000 (09:28 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 7 Nov 2002 08:28:36 +0000 (09:28 +0100)
length was mishandled.

Rev: src/nettle/sexp-transport.c:1.3

sexp-transport.c

index 73e8c876408d9a94dcd54a959785e89efed2795e..a0d7b1d3637d02bf2074139eff221a375474f6eb 100644 (file)
@@ -60,7 +60,7 @@ sexp_transport_iterator_first(struct sexp_iterator *iterator,
        {
          /* Found transport encoding */
          struct base64_decode_ctx ctx;
-         unsigned length;
+         unsigned coded_length;
          unsigned end;
 
          for (end = ++in; end < length && input[end] != '}'; end++)
@@ -70,13 +70,13 @@ sexp_transport_iterator_first(struct sexp_iterator *iterator,
            return 0;
            
          base64_decode_init(&ctx);
-         length = end - in;
+         coded_length = end - in;
          
-         if (base64_decode_update(&ctx, &length, input + out,
-                                  length, input + in)
+         if (base64_decode_update(&ctx, &coded_length, input + out,
+                                  coded_length, input + in)
              && base64_decode_final(&ctx))
            {     
-             out += length;
+             out += coded_length;
              in = end + 1;
            }
          else