Closed Bug 1085497 Opened 10 years ago Closed 10 years ago

Use typedef for the length of mozilla::pkix::Input/Reader for safer casting

Categories

(Core :: Security: PSM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: briansmith, Assigned: briansmith)

References

Details

Attachments

(1 file)

Attached patch size_type.patchSplinter Review
Let's say you want to compute the diference of lengths of to Inputs: Input::size_type diff; if (a.GetLength() > b.GetLength()) { // The cast is required because operator- returns a signed type. diff = static_cast<Input::size_type>(a.GetLength() - b.GetLength()); } We could just use "uint16_t" but that would be problematic if/when we need to change the maximum length of Input/Reader.
Attachment #8508064 - Flags: review?(mmc)
Attachment #8508064 - Flags: review?(mmc) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: