Page MenuHomeFreeBSD

Fix undefined pointer arithmetic in fread()
AbandonedPublic

Authored by arichardson on Aug 2 2021, 2:44 PM.
Tags
None
Referenced Files
F82111507: D31383.diff
Thu, Apr 25, 3:40 PM
Unknown Object (File)
Sat, Apr 20, 2:31 AM
Unknown Object (File)
Tue, Apr 16, 8:44 PM
Unknown Object (File)
Fri, Apr 12, 6:51 AM
Unknown Object (File)
Thu, Mar 28, 10:34 AM
Unknown Object (File)
Dec 20 2023, 6:12 AM
Unknown Object (File)
Dec 12 2023, 11:59 PM
Unknown Object (File)
Nov 27 2023, 8:29 AM
Subscribers

Details

Reviewers
pfg
Summary

lib/libc/stdio/fread.c:133:10: runtime error: applying zero offset to null pointer

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40806
Build 37695: arc lint + arc unit

Event Timeline

Good.

Please also take a look at NetBSD's change 1.23, "Avoid undefined behavior in fread(3)".

This revision is now accepted and ready to land.Aug 2 2021, 3:02 PM
In D31383#707328, @pfg wrote:

Good.

Please also take a look at NetBSD's change 1.23, "Avoid undefined behavior in fread(3)".

Ah nice, that avoids the branch inside the loop. Should I apply the NetBSD change instead?

In D31383#707328, @pfg wrote:

Good.

Please also take a look at NetBSD's change 1.23, "Avoid undefined behavior in fread(3)".

Ah nice, that avoids the branch inside the loop. Should I apply the NetBSD change instead?

I think so ... I haven't had time to test the change .. plus they undid it and then redid it in other commits. :-).

Similar patch (D33903) has been committed.