Closed Bug 2079751 Opened 1 month ago Closed 1 month ago

Clamp the MOZ_LOG rotate and maxsize sizes

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: dcarver, Assigned: dcarver)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

LogModuleManager::Init converts the rotate and maxsize megabytes to bytes on 32 bits, so large or negative values wrap around silently: rotate:4096 disables rotation, rotate:-5 rotates files of about 1 GiB, and maxsize:2048 is ignored.

Assignee: nobody → dcarver
Status: NEW → ASSIGNED

The megabytes were converted to bytes on 32 bits, so large or negative values
wrapped around silently. Large values are now clamped to 2047 MB so that the
sizes fit in an int32_t, and negative values disable the option, as values
that overflow an int32_t already did in the MOZ_LOG parser.

Using an int64_t would require replacing ftell(), which returns a 32-bit long
on Windows and on 32-bit platforms.

Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: