Page MenuHomeFreeBSD

ctld: Fix assertion against the wrong field
ClosedPublic

Authored by jhb on Thu, Jan 23, 3:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 29, 12:08 PM
Unknown Object (File)
Wed, Jan 29, 9:33 AM
Unknown Object (File)
Wed, Jan 29, 8:55 AM
Unknown Object (File)
Mon, Jan 27, 7:10 PM
Unknown Object (File)
Mon, Jan 27, 10:39 AM
Unknown Object (File)
Sun, Jan 26, 5:27 PM
Unknown Object (File)
Fri, Jan 24, 4:37 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61918
Build 58802: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Thu, Jan 23, 3:50 PM

I guess this is OK, but I haven't ever done anything with the discovery code, so I don't know how it's supposed to work.

This revision is now accepted and ready to land.Thu, Jan 23, 4:15 PM

yea, this field is a pointer.

usr.sbin/ctld/discovery.c
164

As Warner noted, pg_discovery_filter is an integer field that holds one of the PG_FILTER_* values (an enum in essence), while pg_discovery_auth_group is a pointer to a struct auth_group. This is a type mismatch comparing a pointer to an integer. Not sure why the compiler didn't complain about this earlier. Maybe if PG_FILTER_UNKNOWN is 0 then it gets treated as NULL.

166

Here you can see the PG_FILTER_ values being compared against the integer field.

183

Here you can see the pointer dereferenced.

This revision was automatically updated to reflect the committed changes.