Summary: | Inconsistent type handling for sizes in sbuf code | ||
---|---|---|---|
Product: | Base System | Reporter: | CTurt <ecturt> |
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | New --- | ||
Severity: | Affects Only Me | CC: | emaste, op |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
CTurt
2016-01-31 18:20:50 UTC
Additional patch also needed for `sbuf.h`: https://github.com/HardenedBSD/hardenedBSD-playground/commit/4cd156684cf38b64d218b97db44c477b9799c2ed.patch These patch breaks the build, see the jenkins log: http://jenkins.hardenedbsd.org:8180/jenkins/job/HardenedBSD-CURRENT-unstable-amd64/lastFailedBuild/consoleFull The error is: /jenkins/workspace/HardenedBSD-CURRENT-unstable-amd64/sy/kern/subr_sbuf.c:226:60: error: format specifies type 'int' but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat] ("attempt to create an sbuf of negative length (%d)", length)); Referring to this line: KASSERT(length >= 0, ("attempt to create an sbuf of negative length (%d)", length)); I find it odd that this would give an error, but the below line doesn't: KASSERT(s->s_len < s->s_size, ("wrote past end of sbuf (%d >= %d)", s->s_len, s->s_size)); Regardless, I've committed a new patch to use the `%zd` format specifier here, instead: https://github.com/HardenedBSD/hardenedBSD-playground/commit/5165b5cc55f09ba357bc1ee41d828ec2864e7d0d.patch |