fix signed vs unsigned comparison in nsXMLMIMEDataSource.cpp

VERIFIED FIXED in Future

Status

()

P3
normal
VERIFIED FIXED
19 years ago
16 years ago

People

(Reporter: daa, Assigned: gordon)

Tracking

Trunk
Future
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fix in hand[nsbeta3-][next version])

(Reporter)

Description

19 years ago
cvs blamed listing

352 davidm 1.6                  PRUint32 count;
353 davidm 1.1                  rv = info->GetFileExtensions(& count,
&extensions );
354                             if ( NS_FAILED ( rv ) )
355                                     return rv;
356                             buffer+=kExtensions;
357                             buffer+="=\"";
358   for ( PRInt32 i = 0; i<(count-1); i++ )

patch:
diff -u -r1.11 nsXMLMIMEDataSource.cpp
--- nsXMLMIMEDataSource.cpp	2000/05/17 00:05:52	1.11
+++ nsXMLMIMEDataSource.cpp	2000/05/22 01:24:40
@@ -355,7 +355,7 @@
 			return rv;
 		buffer+=kExtensions;
 		buffer+="=\"";
-		for ( PRInt32 i = 0; i<(count-1); i++ )
+		for ( PRUInt32 i = 0; i<(count-1); i++ )
 		{
 			buffer+=extensions[i];
 			buffer+=",";

Comment 1

19 years ago
Can count be 0? Probably be better to convert count to a signed integer. M20
Status: NEW → ASSIGNED
Summary: fix signed vs unsigned comparison in nsXMLMIMEDataSource.cpp → fix signed vs unsigned comparison in nsXMLMIMEDataSource.cpp
Target Milestone: --- → M20
(Reporter)

Comment 2

19 years ago
since extensions[] can't have a negitive subscript PRUint32 makes more sense to
me

Comment 3

19 years ago
Sure but then you can't do the -1 math since (0-1) is a really big number. 
Unsigned really doesn't prevent negative numbers. It just converts negative 
numbers into really big postive ones which almost never what you want.  See Lare 
Scale c++ for why they are so evil in interfaces. 

Comment 4

19 years ago
David has left netscape and davidm@netscape.com is an invalid email address.
Assigning his five remaining bugs to gagan to find a new owner for them. Thanks

Comment 5

19 years ago
oops i didn't actually reassign to gagan last time. sorry for the spam
Assignee: davidm → gagan
Status: ASSIGNED → NEW

Comment 6

19 years ago
->gordon
Assignee: gagan → gordon
(Assignee)

Updated

18 years ago
Keywords: nsbeta3
Whiteboard: fix in hand

Comment 7

18 years ago
triage team:
nsbeta3- because we don't think we run into this very often.  Marking [next
version] to indicate that we will check this in for next version, just didn't
make this train (bigger fish to fry).
Whiteboard: fix in hand → fix in hand[nsbeta3-][next version]

Updated

18 years ago
Target Milestone: M20 → Future

Comment 8

18 years ago
mass move, v2.
qa to me.
QA Contact: tever → benc
(Assignee)

Comment 9

16 years ago
It looks like this was fixed back in February, 2002, by bzbarasky@mit.edu as
part of bug 68801.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.