[BeOS]Doubtful condition check in random noise generator

RESOLVED FIXED in 4.7

Status

NSPR
NSPR
--
minor
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Sergei Dolgov, Assigned: Wan-Teh Chang)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
if ( size >= 0 ) {
http://lxr.mozilla.org/seamonkey/source/nsprpub/pr/src/md/beos/brng.c#60

should be rather 
if ( size > 0 ) {

like in other platforms
(Reporter)

Comment 1

11 years ago
Created attachment 238623 [details] [diff] [review]
patch

excludes size == 0 case from treatment
(Reporter)

Updated

11 years ago
Blocks: 349526
(Reporter)

Comment 2

11 years ago
Comment on attachment 238623 [details] [diff] [review]
patch

asking review.

needs also 1.8.1 branch checkin if reviewed and approved
Attachment #238623 - Flags: review?(wtchang)
(Assignee)

Comment 3

11 years ago
Comment on attachment 238623 [details] [diff] [review]
patch

r=wtc.

It shouldn't be necessary to check this in on the
MOZILLA_1_8_BRANCH.  memcpy(dst, src, 0) should be
a no-op.  Are we crashing in memcpy?
Attachment #238623 - Flags: review?(wtchang) → review+
(Reporter)

Comment 4

11 years ago
Opps, I didn't look at branch code actually, and browser don't crash in branch.

So I will look then there and see if I can get some wisdom:)

And crash happens not in random generator code itself, but "can" happen if it returns 0. So this change is made to narrow area of possible crash reasons.
(Assignee)

Comment 5

11 years ago
Sergei, your patch won't change the return value of PR_GetRandomNoise.
(Reporter)

Comment 6

11 years ago
That's why I didn't mark bug as critical or even major and put "Doubtful" not "Wrong" in summary. So no rush with checkin.

Anyway, looks like no reason to call memcpy which does nothing.
(Assignee)

Comment 7

11 years ago
Right, this is a good patch.  My point is that we don't need
to bother with requesting the mozilla 1.8.1 branch checkin approval.

I checked in the patch on the NSPR trunk (NSPR 4.7).  Thanks.

Checking in brng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/beos/brng.c,v  <--  brng.c
new revision: 3.6; previous revision: 3.5
done
Severity: normal → trivial
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.7
(Assignee)

Updated

11 years ago
Severity: trivial → minor
(Assignee)

Comment 8

11 years ago
I checked in the patch on the NSPRPUB_PRE_4_2_CLIENT_BRANCH
for the Mozilla trunk (1.9 alpha 2).

Checking in brng.c;
/cvsroot/mozilla/nsprpub/pr/src/md/beos/brng.c,v  <--  brng.c
new revision: 3.4.4.2; previous revision: 3.4.4.1
done

Comment 9

11 years ago
(In reply to comment #8)
> I checked in the patch on the NSPRPUB_PRE_4_2_CLIENT_BRANCH
> for the Mozilla trunk (1.9 alpha 2).
> 
> Checking in brng.c;
> /cvsroot/mozilla/nsprpub/pr/src/md/beos/brng.c,v  <--  brng.c
> new revision: 3.4.4.2; previous revision: 3.4.4.1
> done
> 
Thank you, Wan-Teh!
You need to log in before you can comment on or make changes to this bug.