diff options
Diffstat (limited to 'feed/cveid.go')
-rw-r--r-- | feed/cveid.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/feed/cveid.go b/feed/cveid.go index 8796029..5e43ad3 100644 --- a/feed/cveid.go +++ b/feed/cveid.go @@ -21,7 +21,7 @@ func parseCveIdYear(s string) (uint16, error) { } // check bounds - if year < 2000 || year > 2127 { + if year < 1999 || year > 2126 { return 0, fmt.Errorf("year out of bounds: %s", s) } @@ -48,7 +48,7 @@ func parseCveIdNum(s string) (uint32, error) { // Encode CVE ID as uint32. func encodeCveId(year uint16, num uint32) uint32 { - return uint32((uint32((year - 2000) & 0x7f) << 25) | (num & 0x01ffffff)) + return uint32((uint32((year - 1999) & 0x7f) << 25) | (num & 0x01ffffff)) } // Create CVE ID from string. @@ -98,7 +98,7 @@ func (me *CveId) UnmarshalJSON(b []byte) error { // Get year component. func (me CveId) Year() uint16 { - return uint16((uint32(me) >> 25) & 0x7f) + 2000 + return uint16((uint32(me) >> 25) & 0x7f) + 1999 } // Get number component. |