Reading from a database is now optional.
Compiling terminfo descriptions (including from $TERMINFO) is now optional.
Compat support is now optional.
This removes 17k on amd64 from the binary size, which allows it to be used
again on space constrained ramdisks.
This bug was reported by UBSan runs.
lib/libusbhid/parse.c:246:20
Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.
Reviewed by: kamil@
This bug was reported by UBSan runs.
lib/libusbhid/usage.c:247:27
lib/libusbhid/usage.c:244:28
lib/libusbhid/usage.c:235:13
Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.
Reviewed by: kamil@
This bug was reported by UBSan runs.
lib/libusbhid/data.c:58:25
lib/libusbhid/data.c:91:7
lib/libusbhid/data.c:92:7
Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.
Reviewed by: kamil@
Blindly scanning the capabilities for # and checking that the following
number is bigger than a short isn't reliable because this could be a
string value:
SomeString#1234
Instead, if we process the numeric as normal and if it's value is too big
for v1 then promote the record to v3.
- Modify the writing code to only write entries in the new
format for the terminal descriptions that require it.
- Store new format entries as <name>@v3
- Store old format entries with clamped values as <name> for
backwards compatibility
- Lookup first <name>@v3 and then <name> if that is not found.
- Don't create terminfo2 anymore; old programs keep working with
clamped entries, and new programs be able to use the wide
fields with using the original db file.
result type of strerror() (and strerror_l()). While that once should
really have been present, when strerror() was invented, there was no
"const" qualifier in C to apply, and now the way the code is writtem
(really needs to be because of NLS support) the const is no longer
really appropriate.
Applications still shouldn't attempt to modify the result however.
While here also document (but comment it out since it isn't
available - yet) strerror_lr(). To include that, simply
uncomment the relevant lines, and (twice I think) s/returns/return/
on lines just after currently commented out lines (that is, it
currently says, "A returns" after the comments are returned, we
need it to be "A and B return" - the "and B" appears when the comment
markers are removed, removing the 's' from returns must be done manually.
In addition to adding strerror_l() some additional enhancements were
made to the general strerror() doc.
The restriction that a fd passed to fdatasync(2) must be writable was
added in 2003 in order to comply with POSIX. Since then, POSIX has
removed that requirement, and POSIX-valid programs have been therefore
encountering errors on NetBSD.
Patch by Paul Ripke after discussion on netbsd-users. Issue
discovered with pkgsrc/databases/mongodb3 as used by pkgsrc/net/unifi.
unsigned equivalent of -1.
While here, guarantee, even when !NLS, that nothing here (not even
snprintf deciding to complain about EILSEQ or something) can ever
alter errno (ie: always save and restore it, not only in the NLS case).
The functions here must never alter errno, whatever happens.
has failed, in the hope that some other thread has free'd some memory,
but we want to bound the number of attempts, it helps if we actually
count them - otherwise we never get nearer to the limit.
In practice, malloc() for a reasonable application on a modern system
almost never fails, so the code containing this bug has probably never
been, and never will be, executed, but just in case, someday.
For this, it isn't clear if the intent was to have 10 retries (ie: 11
attempts) or 10 tries, but as the code said "retries > 10", I am
assuming the former (not that it matters, if the malloc() has failed
10 times in a row, with 10 second pauses between, the chances of an
11th succeeding aren't great).