re: X.509: Add an ASN.1 decoder

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

 



Hello David Howells,

The patch 788380fa26a6: "X.509: Add an ASN.1 decoder" from Sep 24, 
2012, leads to the following warning:
lib/asn1_decoder.c:320 asn1_ber_decoder()
	 warn: unsigned 'len' is never less than zero.

lib/asn1_decoder.c
   315          skip_data:
   316                  if (!(flags & FLAG_CONS)) {
   317                          if (flags & FLAG_INDEFINITE_LENGTH) {
   318                                  len = asn1_find_indefinite_length(
   319                                          data + dp, datalen - dp, &errmsg, &dp);
   320                                  if (len < 0)
                                            ^^^^^^^
asn1_find_indefinite_length() returns -1 on error but "len" is unsigned.

   321                                          goto error;
   322                          }
   323                          pr_debug("- LEAF: %zu\n", len);
   324                          dp += len;
   325                  }

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux