Page MenuHomeFreeBSD

Fix undefined pointer arithmetic in fread()
AbandonedPublic

Authored by arichardson on Aug 2 2021, 2:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 2, 5:50 PM
Unknown Object (File)
Mon, Dec 2, 10:04 AM
Unknown Object (File)
Sun, Nov 24, 2:14 AM
Unknown Object (File)
Thu, Nov 21, 12:22 AM
Unknown Object (File)
Tue, Nov 19, 6:45 PM
Unknown Object (File)
Tue, Nov 19, 6:54 AM
Unknown Object (File)
Tue, Nov 19, 4:26 AM
Unknown Object (File)
Fri, Nov 8, 8:44 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.