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

RESOLVED FIXED in Firefox 57

Status

()

Core
Audio/Video
RESOLVED FIXED
9 months ago
9 months ago

People

(Reporter: David Binderman, Assigned: jolin)

Tracking

unspecified
mozilla57
All
Other
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

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

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

9 months ago
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?
======================================

Updated

9 months ago
Component: Untriaged → Audio/Video
Product: Firefox → Core
(Assignee)

Comment 2

9 months ago
(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 hidden (mozreview-request)

Comment 4

9 months ago
mozreview-review
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+

Comment 5

9 months ago
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
Last Resolved: 9 months ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.