]> granicus.if.org Git - p11-kit/commitdiff
Fix off by one in date parsing code
authorStef Walter <stefw@gnome.org>
Thu, 4 Apr 2013 06:04:51 +0000 (08:04 +0200)
committerStef Walter <stefw@gnome.org>
Thu, 4 Apr 2013 06:04:51 +0000 (08:04 +0200)
We didn't treat the two digit year 00 as a valid year, whereas it
actually represents the year 2000. This is in a non-critical code path.

trust/builder.c

index 15999bba5eb45e9b29919a50882c047ce75fd729..698fef11258d247de33e536b23f8e4ef039fdf7d 100644 (file)
@@ -332,7 +332,7 @@ calc_date (node_asn *node,
                return_val_if_fail (len >= 6, false);
 
                year = atoin (buf, 2);
-               return_val_if_fail (year > 0, false);
+               return_val_if_fail (year >= 0, false);
 
                century = century_for_two_digit_year (year);
                return_val_if_fail (century >= 0, false);