Page MenuHomeFreeBSD

Fix undefined pointer arithmetic in fread()
AbandonedPublic

Authored by arichardson on Aug 2 2021, 2:44 PM.
Tags
None
Referenced Files
F68074702: D31383.diff
Fri, Sep 22, 12:03 PM
Unknown Object (File)
Wed, Sep 6, 7:07 PM
Unknown Object (File)
Wed, Sep 6, 8:26 AM
Unknown Object (File)
Aug 14 2023, 11:24 PM
Unknown Object (File)
Aug 14 2023, 12:07 PM
Unknown Object (File)
Aug 2 2023, 12:44 PM
Unknown Object (File)
Jul 6 2023, 2:51 PM
Unknown Object (File)
Jul 6 2023, 1:50 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.