Date: Sat, 21 Nov 2009 17:40:03 GMT From: Jeremy Huddleston <jeremyhu@apple.com> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/140690: [libc] [patch] swab(3) with negative len should do nothing Message-ID: <200911211740.nALHe3Z5039111@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/140690; it has been noted by GNATS. From: Jeremy Huddleston <jeremyhu@apple.com> To: Paul Procacci <pprocacci@datapipe.com> Cc: bug-followup@FreeBSD.org Subject: Re: kern/140690: [libc] [patch] swab(3) with negative len should do nothing Date: Sat, 21 Nov 2009 09:37:00 -0800 --Apple-Mail-2--802537417 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Nov 21, 2009, at 01:18, Paul Procacci wrote: > I'd like to add to this. >=20 > As for the length argument. Is there really ever a time it would have > to be signed? Yes, when passing in a negative value resulting from a subtraction by = the caller. > If not, then I would suggest declaring the type as size_t and not > ssize_t much like the read/write/etc syscalls. It was changed to ssize_t initially to combat the bug I'm reporting, but = the fix itself was incomplete. --Apple-Mail-2--802537417 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJtzCCAz8w ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA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kFMQ8XDTA5MTEyMTE3 MzcwMFowIwYJKoZIhvcNAQkEMRYEFIutYCezKzXg0BDuaQxNkTzbxfaIMIGFBgkrBgEEAYI3EAQx eDB2MGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQu MSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQXyANwiLwiQMn /K7Db4MbbjCBhwYLKoZIhvcNAQkQAgsxeKB2MGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3 dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1h aWwgSXNzdWluZyBDQQIQXyANwiLwiQMn/K7Db4MbbjANBgkqhkiG9w0BAQEFAASCAQAj3Vp//m1E n9CEuh/hO1VtWun9dVslIZ8Dx890rCFp2MdTaz9r7VhsR6nMFTybgFpKiOxTdAQ3XWlUn8mDCxxz MLQygyf1CCQiRZXgxR1c7Dck9N4FZyBw7zFgH5P3gNxNOwvmHG19RjbiU/JteFuj17LiNKYMAcLs dkBbi3wmlTscbrTLEV12i71X9FjhfkxyLdheTbKb3KDzmeU/ABBwccqzPk0bUjytMlZg642HQBL2 X4CdJjKaU+hT4S4hQtqKZh+QSdYBMxkXvpFrIwDCCSOOwig86sfHJdxZthJ3N70IsrU1OT5tGyuy pTRp6lsiAwSP6OYtnf+U97f7PQyzAAAAAAAA --Apple-Mail-2--802537417--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911211740.nALHe3Z5039111>