Closed Bug 238455 Opened 21 years ago Closed 21 years ago

warning C4244: 'argument' : conversion from 'PRInt64' to 'size_t', possible loss of data

Categories

(Core :: XUL, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

Details

(Whiteboard: [sg:nse])

Attachments

(1 file)

tip from now r:/mozilla\widget\src\xpwidgets\nsTransferable.cpp(253) : warning C4244: 'argument' : conversion from 'PRInt64' to 'size_t', possible loss of data r:/mozilla\widget\src\xpwidgets\nsTransferable.cpp(264) : warning C4244: 'argument' : conversion from 'PRInt64' to 'PRUint32', possible loss of data r:/mozilla\widget\src\xpwidgets\nsTransferable.cpp(268) : warning C4244: '=' : conversion from 'PRInt64' to 'PRUint32', possible loss of data r:/mozilla\widget\src\xpwidgets\nsTransferable.cpp(269) : warning C4244: 'argument' : conversion from 'PRInt64' to 'PRUint32', possible loss of data PRInt64 may be a struct, and nsMemory only takes a 32bit creature. So this is silly
Attached patch limit to 32bitsSplinter Review
Attachment #144644 - Flags: superreview?(dveditz+bmo)
Attachment #144644 - Flags: review?(dveditz+bmo)
Comment on attachment 144644 [details] [diff] [review] limit to 32bits Not sure who gives r= in widget these days but it's not me. Despot says roc, who conveniently can see security bugs. I don't think this is a security bug: nsIInputStream::Read truncates the filesize the same way as nsMemory so I don't see how it could overrun. Plus, even if it were exploitable, it's hard to imagine that an attack that depends on first getting a >4Gb file into someone's cache at today's transfer speeds is all that feasible. >+ if ( NS_SUCCEEDED(rv) && *aDataLen == size) { >+ *aDataLen = size; If *aDataLen already == size why assign? Emphatic but unnecessary. sr=dveditz
Attachment #144644 - Flags: superreview?(dveditz+bmo)
Attachment #144644 - Flags: superreview+
Attachment #144644 - Flags: review?(roc)
Attachment #144644 - Flags: review?(dveditz+bmo)
mozilla/widget/src/xpwidgets/nsTransferable.cpp 1.61
Group: security
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → M1
Whiteboard: [sg:nse]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: