Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#23584 closed defect (duplicate)

tor-0.3.1.7/src/or/torcert.c:396: bad expression ?

Reported by: dcb314@… Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.1.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 030-backport
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

tor-0.3.1.7/src/or/torcert.c:396]: (style) int result is assigned to long variable.

Source code is

const uint32_t expiration_date = rsa_ed_crosscert_get_expiration(cc);
const uint64_t expiration_time = expiration_date * 3600;

Multiplying something by 3600 doesn't change its type. Suggest new code

const uint32_t expiration_date = rsa_ed_crosscert_get_expiration(cc);
const uint64_t expiration_time = expiration_date * 3600UL;

Child Tickets

Change History (3)

comment:1 Changed 7 months ago by nickm

Keywords: 030-backport added
Milestone: Tor: 0.3.1.x-final
Owner: set to nickm
Status: newaccepted

long is not guaranteed to be 64-bit, though.

What checker are you using here?

comment:2 Changed 7 months ago by nickm

Resolution: duplicate
Status: acceptedclosed

Actually, looks like this is a duplicate of bug #23055. Not planning to backport this one to 0.3.1 or earlier, since it won't trigger until people make certs that expire in Y2106 or later -- at which point probably nobody will be running Tor 0.3.1 or earlier.

comment:3 Changed 7 months ago by nickm

Component: - Select a componentCore Tor/Tor
Note: See TracTickets for help on using tickets.