Array overrun in intl/chardet/tests/DetectCharset.cpp

RESOLVED FIXED in mozilla11

Status

()

Core
Internationalization
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: glandium, Assigned: smontagu)

Tracking

(Blocks: 1 bug)

Trunk
mozilla11
All
Windows 7
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [pvs-studio])

Attachments

(1 attachment, 1 obsolete attachment)

The problematic code is the following:
class nsBaseStatis : public nsStatis {
public:
  ...
  PRUint32 mLWordLen[10]; 
  ...
  nsBaseStatis::nsBaseStatis(...)
  {
    ...
    for(PRUint32 i = 0; i < 20; i++)
       mLWordLen[i] = 0;
    ...
  }
  ...
};

Now, there are a few interesting things to note about this:
- This code is in a testcase
- The nsBaseStatis class is never used
- The test is only built on Windows
- AFAICS, the test is actually never run

Considering the above, I'm tempted to say the solution is rm -rf intl/chardet/tests.
Duplicate of this bug: 710982
Whiteboard: [pvs-studio]
(Assignee)

Comment 2

5 years ago
(In reply to Mike Hommey [:glandium] from comment #0)
> Considering the above, I'm tempted to say the solution is rm -rf
> intl/chardet/tests.

I agree with this, especially since intl/chardet has been almost entirely superseded by extensions/universalchardet.
(Assignee)

Comment 3

5 years ago
Created attachment 582188 [details] [diff] [review]
remove it
Attachment #582188 - Flags: review?(VYV03354)
You need to modify intl/chardet/Makefile.in as well.
(Assignee)

Comment 5

5 years ago
Created attachment 582193 [details] [diff] [review]
Patch v.2
Attachment #582188 - Attachment is obsolete: true
Attachment #582188 - Flags: review?(VYV03354)
Attachment #582193 - Flags: review?(VYV03354)
> I agree with this, especially since intl/chardet has been almost entirely
> superseded by extensions/universalchardet.
Is it possible to remove intl/chardet entirely?
It will steer Win PGO builds away from the 3GB virtual address space limit a bit.
Comment on attachment 582193 [details] [diff] [review]
Patch v.2

r=me anyway.
Attachment #582193 - Flags: review?(VYV03354) → review+
(Assignee)

Comment 8

5 years ago
(In reply to Masatoshi Kimura [:emk] from comment #6)
> Is it possible to remove intl/chardet entirely?

Filed bug 711790
(Assignee)

Comment 9

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/28cd0159472e
Flags: in-testsuite-
Target Milestone: --- → mozilla11
https://hg.mozilla.org/mozilla-central/rev/28cd0159472e
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.