Closed
Bug 794051
Opened 11 years ago
Closed 11 years ago
Invalid use of fscanf in GonkHal.cpp
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: tzimmermann, Assigned: tzimmermann)
Details
Attachments
(1 file, 2 obsolete files)
1.46 KB,
patch
|
dhylands
:
review+
|
Details | Diff | Splinter Review |
A call to fscanf in uses a wrong parameter to read a string.
> /home/tdz/Projects/mozilla/src/mozilla-inbound/upstream/hal/gonk/GonkHal.cpp: In function 'void mozilla::hal_impl::GetCurrentBatteryInformation(mozilla::hal::BatteryInformation*)':
> /home/tdz/Projects/mozilla/src/mozilla-inbound/upstream/hal/gonk/GonkHal.cpp:353: warning: format '%s' expects type 'char*', but argument 3 has type 'char (*)[16]'
The call should be replaced by fgets, which checks array bounds.
Assignee | ||
Updated•11 years ago
|
Summary: Invalid use of fscanf usage in GankHal.cpp → Invalid use of fscanf usage in GonkHal.cpp
Assignee | ||
Updated•11 years ago
|
Summary: Invalid use of fscanf usage in GonkHal.cpp → Invalid use of fscanf in GonkHal.cpp
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #664842 -
Flags: review?(dhylands)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #664843 -
Flags: review?(dhylands)
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Thomas Zimmermann from comment #1) > Created attachment 664842 [details] [diff] [review] > Read battery status via fgets I verified that the phone still switches correctly among charging states.
Comment 4•11 years ago
|
||
Looks good. r=me if you squash the 2 patches into one.
Assignee | ||
Comment 5•11 years ago
|
||
Squashed and updated. Dave, please commit the patch if you're OK with it.
Attachment #664842 -
Attachment is obsolete: true
Attachment #664843 -
Attachment is obsolete: true
Attachment #664842 -
Flags: review?(dhylands)
Attachment #664843 -
Flags: review?(dhylands)
Attachment #664969 -
Flags: review?(dhylands)
Updated•11 years ago
|
Attachment #664969 -
Flags: review?(dhylands) → review+
Comment 6•11 years ago
|
||
Pushed to inbound https://hg.mozilla.org/integration/mozilla-inbound/rev/20169e3f33b3
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/20169e3f33b3
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•