Closed Bug 1391556 Opened 4 years ago Closed 4 years ago

firefox-55.0.2/media/libstagefright/system/core/liblog/fake_log_device.c:155: array index out of bounds ?

Categories

(Core :: Audio/Video, enhancement)

All
Other
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: dcb314, Assigned: jhlin)

Details

(Whiteboard: [specification][type:bug])

Attachments

(1 file)

What did you do?
================
1. 
2. 
3. 

What happened?
==============
firefox-55.0.2/media/libstagefright/system/core/liblog/fake_log_device.c:155]: (error) Array 'openLogTable[16]' accessed at index 127, which is out of bounds.

Source code is

    for (i = 0; i < sizeof(openLogTable); i++) {

but

static LogState *openLogTable[MAX_OPEN_LOGS];


What should have happened?
==========================
Better source code 

    for (i = 0; i < MAX_OPEN_LOGS; i++) {


Is there anything else we should know?
======================================
Component: Untriaged → Audio/Video
Product: Firefox → Core
(In reply to David Binderman from comment #0)
> ==========================
> Better source code 
> 
>     for (i = 0; i < MAX_OPEN_LOGS; i++) {
> 

 Or |i < (sizeof(openLogTable) / sizeof(openLogTable[0]))|, but I like your solution better.

 It's a fixed issue in upstream stagefright that isn't pulled into Gecko.
Assignee: nobody → jolin
Comment on attachment 8899656 [details]
Bug 1391556 - fix incorrect out of bound check.

https://reviewboard.mozilla.org/r/170968/#review176122
Attachment #8899656 - Flags: review?(jwwang) → review+
Pushed by jolin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a402ebd682d2
fix incorrect out of bound check. r=jwwang
https://hg.mozilla.org/mozilla-central/rev/a402ebd682d2
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.