Last Comment Bug 780212 - Fix buffer overflow beyond MAXPATHLEN when querying Android's GRE_HOME
: Fix buffer overflow beyond MAXPATHLEN when querying Android's GRE_HOME
Status: RESOLVED FIXED
:
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: Firefox 17
Assigned To: Chris Peterson [:cpeterson]
:
: Sebastian Kaspari (:sebastian)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-03 10:33 PDT by Chris Peterson [:cpeterson]
Modified: 2012-08-07 07:36 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
fix-GRE_HOME_overflow.patch (863 bytes, patch)
2012-08-03 10:33 PDT, Chris Peterson [:cpeterson]
mh+mozilla: review+
Details | Diff | Splinter Review

Description Chris Peterson [:cpeterson] 2012-08-03 10:33:12 PDT
Created attachment 648764 [details] [diff] [review]
fix-GRE_HOME_overflow.patch

This compiler warning points to a buffer overflow beyond MAXPATHLEN when querying Android's GRE_HOME:

mozilla/central/xpcom/build/BinaryPath.h: In function 'nsresult XRE_GetBinaryPath(const char*, nsIFile**)':
mozilla/central/xpcom/build/BinaryPath.h:79: warning: array subscript is above array bounds
Comment 1 Mike Hommey [:glandium] 2012-08-03 23:31:20 PDT
Comment on attachment 648764 [details] [diff] [review]
fix-GRE_HOME_overflow.patch

Review of attachment 648764 [details] [diff] [review]:
-----------------------------------------------------------------

While you're here, can you fix the XP_UNIX part, which doesn't have that guard at all?
Comment 2 Mike Hommey [:glandium] 2012-08-03 23:32:24 PDT
(In reply to Mike Hommey [:glandium] from comment #1)
> Comment on attachment 648764 [details] [diff] [review]
> fix-GRE_HOME_overflow.patch
> 
> Review of attachment 648764 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> While you're here, can you fix the XP_UNIX part, which doesn't have that
> guard at all?

Actually, it doesn't need it afaics.
Comment 3 Chris Peterson [:cpeterson] 2012-08-06 14:06:50 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/40e682b208cc
Comment 4 Ed Morley [:emorley] 2012-08-07 07:36:43 PDT
https://hg.mozilla.org/mozilla-central/rev/40e682b208cc

Note You need to log in before you can comment on or make changes to this bug.