diff libtomcrypt/src/pk/asn1/der/boolean/der_decode_boolean.c @ 1511:5916af64acd4 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Sat, 17 Feb 2018 19:29:51 +0800
parents 6dba84798cd5
children
line wrap: on
line diff
--- a/libtomcrypt/src/pk/asn1/der/boolean/der_decode_boolean.c	Tue Jan 23 23:27:40 2018 +0800
+++ b/libtomcrypt/src/pk/asn1/der/boolean/der_decode_boolean.c	Sat Feb 17 19:29:51 2018 +0800
@@ -5,8 +5,6 @@
  *
  * The library is free for all purposes without any express
  * guarantee it works.
- *
- * Tom St Denis, [email protected], http://libtom.org
  */
 #include "tomcrypt.h"
 
@@ -30,18 +28,18 @@
 {
    LTC_ARGCHK(in  != NULL);
    LTC_ARGCHK(out != NULL);
-   
-   if (inlen != 3 || in[0] != 0x01 || in[1] != 0x01 || (in[2] != 0x00 && in[2] != 0xFF)) {
+
+   if (inlen < 3 || in[0] != 0x01 || in[1] != 0x01 || (in[2] != 0x00 && in[2] != 0xFF)) {
       return CRYPT_INVALID_ARG;
    }
-   
+
    *out = (in[2]==0xFF) ? 1 : 0;
-   
+
    return CRYPT_OK;
 }
 
 #endif
 
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref:         $Format:%D$ */
+/* git commit:  $Format:%H$ */
+/* commit time: $Format:%ai$ */