public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* re: X.509: Add an ASN.1 decoder
@ 2012-10-03 11:17 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-10-03 11:17 UTC (permalink / raw)
  To: kernel-janitors

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-03 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 11:17 X.509: Add an ASN.1 decoder Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox