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)
Fri, Nov 8, 8:44 AM
Unknown Object (File)
Oct 18 2024, 10:48 AM
Unknown Object (File)
Oct 16 2024, 12:50 PM
Unknown Object (File)
Oct 13 2024, 4:59 PM
Unknown Object (File)
Oct 12 2024, 8:29 PM
Unknown Object (File)
Oct 11 2024, 12:16 PM
Unknown Object (File)
Oct 9 2024, 12:14 AM
Unknown Object (File)
Oct 7 2024, 11:52 PM
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.