help-libtasn1
[Top][All Lists]
Advanced

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

Re: [PATCH] Use the smallest of the 2 lengths for the comparison


From: Nikos Mavrogiannopoulos
Subject: Re: [PATCH] Use the smallest of the 2 lengths for the comparison
Date: Mon, 28 Apr 2014 19:22:03 +0200

On Mon, 2014-04-28 at 18:47 +0200, Kurt Roeckx wrote:

> It's really mostly about DER.
> You're basicly doing 2 string compares and you'll stop comparing
> after you see a difference or after "max" bytes because that would
> be the smallest of the 2 strings.  If you continue after that
> you're going to compare things you shouldn't compare anymore and
> possible read past the end of the array.

Is it the part that says that comparison should be done assuming zero
values in the part that exceeds one string? It may be better to name the
variable length, or something more neutral than max. As it changes the
current encoding semantics it would also be good to refer in the log
message to the DER document paragraph that lists the new behavior (I
assume you also read X.690).

regards,
Nikos





reply via email to

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