| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
PR: 215105
Submitted by: <jtd2004a sbcglobal.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Fix possible buffer overflow(s) in link_ntoa(3).
A specially crafted sockaddr_dl argument can trigger a static buffer overflow
in the libc library, with possibility to rewrite with arbitrary data following
static buffers that belong to other library functions.
Reviewed by: kib
Security: FreeBSD-SA-16:37.libc
|
|
|
|
|
|
|
| |
MFC r307220:
r307220 (by br):
Fix typos: use correct string format and value to compare.
|
|
|
|
|
|
|
|
|
|
| |
O_NOFOLLOW.
We return [EMLINK] instead of [ELOOP] when trying to open a symlink with
O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code
like cmp -h and xz takes advantage of this.
PR: 214633
|
|
|
|
|
|
|
| |
r264196 (by theraven):
Move definitions out of rpc_com so that the linker doesn't complain about
multiple definitions.
|
|
|
|
|
|
|
|
|
|
|
| |
r296133 (by pfg):
RPC: update the getrpcbyname() definition to include a const qualifier.
Add const qualifier making getrpcbyname() and getrpcbyname_r()
prototypes match those used in latest Sun RPC code (TI-RPC 2.3).
Obtained from: NetBSD
|
|
|
|
|
|
| |
r301734 (by kevlo):
Fix the rpcb_getaddr() definition to match its declaration.
|
|
|
|
|
|
|
|
| |
r296404 (by pfg):
Stray tabs and spaces.
No functional change.
|
|
|
|
|
|
|
|
| |
r287353 (by rodrigc):
Use unsigned variable.
Eliminates gcc 4.9 compiler warning.
|
|
|
|
|
|
|
|
|
|
|
| |
r296386 (by pfg):
Work around aliasing issues detected in modern GCC.
Avoid casting gymnastics that lead to pointer aliasing by introducing an
inline function as done in NetBSD (but without #if0'd WIP code).
Obtained from: NetBSD (CVS Rev. 1.24, 1.25)
|
|
|
|
|
|
|
|
| |
r278039 (by pfg):
Resource leak
CID: 1016703
|
|
|
|
|
|
|
|
| |
r288017 (by rodrigc):
Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
|
|
|
|
|
|
|
| |
r288995 (by rodrigc):
Use proper function prototypes.
Eliminates -Wstrict-prototypes warning
|
|
|
|
|
|
|
|
| |
r287347 (by rodrigc):
Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r301754 (by pfg):
libc/rpc: Make use of some xdr_* macros.
xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD
but were fixed in r296394. Give them some use hoping they help make
the code somewhat more readable.
r301769 (by pfg):
libc/rpc: Make use of some xdr_* macros. (part 2)
xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older
versions of FreeBSD but fixed in r296394. Give them some use
hoping they help make the code somewhat more readable.
|
|
|
|
|
|
|
|
|
|
|
|
| |
r278041 (by pfg):
rpc: Uninitialized pointer read
Initialize *xprt to avoid exposing a random value
in cleanup_svc_vc_create.
CID: 1018723
Phabric: D1749
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r287341 (by rodrigc):
Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
r287342 (by rodrigc):
Mark unused parameters to reduce gcc 4.9 warnings.
r287348 (by rodrigc):
Use correct function prototype for signal handler.
Eliminates gcc 4.9 warning.
|
|
|
|
|
|
| |
r288113 (by rodrigc):
Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
|
|
|
|
|
|
|
|
|
|
|
| |
r297790 (by pfg):
libc: replace 0 with NULL for pointers.
While here also cleanup some surrounding code; particularly
drop some malloc() casts.
Found with devel/coccinelle.
|
|
|
|
|
|
|
|
| |
r287350 (by rodrigc):
Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r299704 (by vangyzen):
iconvctl(3): remove superfluous NULL pointer tests
convname and dst are guaranteed to be non-NULL by iconv_open(3).
src is an array. Remove these tests for NULL pointers.
While I'm here, eliminate a strlcpy with a correct but suspicious-looking
calculation for the third parameter (i.e. not a simple sizeof).
Compare the strings in-place instead of copying.
Found by: bdrewery
Found by: Coverity
CID: 1130050, 1130056
|
|
|
|
|
|
| |
MFC r307700:
Only build lib/libc/tests/iconv if MK_ICONV != no
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix error reporting from wcstof()
When wcstof() skipped initial space and then parsing failed, it set
endptr to the first non-space character. Fix it to correctly report
failure by setting endptr to the beginning of the input string.
The fix is from theraven@, who fixed this bug in wcstod() and
wcstold() in r227753.
While I'm here:
Move assignments out of declarations in wcstod() and wcstold().
This is against my personal preference, but it is our agreed style(9).
Set endptr correctly on malloc() failure in all three functions.
Remove an incorrect comment: This is pointer arithmetic,
so the code was not actually making that assumption.
wcstold() advanced the wcp pointer beyond leading whitespace
and then reset it back to the beginning of the string.
Do not reset it. This seems to have no functional effect,
since strtold_l() also skips leading whitespace. I'm making
the change to keep this function consistent with wcstof() and
wcstod(), and because the C11 spec prescribes the use of iswspace()
to skip leading space.
Reported by: libc++ unit test for std::stof(std::wstring)
Sponsored by: Dell EMC
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically, use .Ta instead of tabs to separate column entries. While
here fix a few other things:
- Use .Sy for all column headers (previously only the first column header
was bold)
- Use .Dv to markup constants used for MIB names.
- Use "1234" and "4321" for the byte order descriptions without
thousands separators.
- Mark up header files in the first table with .In.
|
|
|
|
|
|
|
|
|
| |
MFC r305920:
Remove spurious newlines from atf_tc_fail calls
This changes the results from broken (incorrect) to failed (correct) on
i386
|
|
|
|
|
|
| |
btree(3): don't shortcut closing if the metadata is dirty.
Obtained from: NetBSD (from krb5 tree)
|
|
|
|
| |
(procctl(PROC_REAP_ACQUIRE)).
|
|
|
|
|
|
|
| |
Document thr_suspend(2) and thr_wake(2).
MFC r306506:
Reword the statement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Microoptimize %p case.
2) Implememt %u for GNU compatibility.
3) Don't forget to advance buf for %w/%u.
4) Fail with incomplete week (week 0) request and no such week in the
year.
5) Fix yday formula when Sunday requested and the week started from Monday.
6) Fail with impossible yday for incomplete week (week 0) and direct %w/%u
request.
7) Shift yday/wday to the first day of the year, if incomplete week
(week 0) requested and no %w/%u used.
8) For already non-standard %z extension implement GNU compatible formats:
+hh and -hh.
9) Check for incorrect values for %z.
PR: 212983 (case 3 only)
|
| |
|
|
|
|
|
| |
Approved by: kib (mentor)
Sponsored by: Dell Technologies
|
|
|
|
|
|
|
|
| |
libc/rpc: replace comma with semicolon when pertinent.
Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.
|
|
|
|
| |
Fix error handling.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Fix errors handling.
2) Prevent out of bounds access to ws[-1] (passed buffer) which happens
when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.
3) Fix n == 1 case. Here should be no physical read (fill buffer) attempt
(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.
What's more, although readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.
Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.
|
|
|
|
|
| |
Since r101651 in 2002, getvfsbyname() has written *vfc using userland
memcpy(), so the [EFAULT] error no longer occurs.
|
|
|
|
|
|
|
| |
fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete
sequence near EOF), so we can't just check for
(wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with
__SERR clearing/restoring.
|
|
|
|
|
|
|
|
| |
'addrlen' does not matter when we need to find the first non-zero bit in
the byte from the left and 'addrlen' already counted in 'lim'.
PR: 212121
Submitted by: Herbie.Robinson@stratus.com
|
|
|
|
|
| |
If error happens, don't overwrite original errno comes from __mbrtowc()
and __srefill().
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not obliterate errno value in the main thread during ptrace(2) call on x86.
MFC r304931:
Follow ABI when calling __error from the ptrace(2) wrapper.
MFC r305012:
Rewrite ptrace(2) wrappers in C.
MFC r305022:
Restore the requirement of setting errno to zero before calling ptrace(2).
|
|
|
|
|
| |
Apply the same qsort() usage fix as in r304911 getaddrinfo.c
qsort() can't be stabilized with just return(-1) alone.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MFC r304033:
Increase timeout from 10 minutes to 20 minutes for all tests
On particular slow networks, it can (on average) take longer to
resolve hosts to IP* addresses. 20 minutes seemed reasonable for
my work network
This will be solved in a more meaningful way (if possible) using
concurrency in the near future
|
|
|
|
| |
Typesetting fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The formal behavior of qsort is unstable with regard to objects that
are equal. Unfortunately, RFC 3484 requires that otherwise equal objects
remain in the order supplied by the DNS server. The present code attempts
to deal with this by returning -1 for objects that are equal (i.e.,
returns that the first parameter is less then the second parameter).
Unfortunately, the qsort API does not state that the first parameter
passed in is in any particular position in the list.
PR: 212122
Submitted by: Herbie.Robinson@stratus.com
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MFC r304034:
Initialize `ai` to NULL and test for `ai` with type-appropriate values
Depending on the address family and ai_flags containing AI_V4MAPPED,
it might not do a proper DNS lookup on the provided DNS address
Convert some `ai` boolean true/false checks to NULL/non-NULL while here.
PR: 211790
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Don't forget to set __SERR on __slbexpand() error.
2) Remove "Fast path" from fgetwc()/fputwc() since it can't detect
encoding errors and ignores them all.
One of affected encoding example: US-ASCII
3) Original fgetln() from 44lite return success for line tail errors,
i.e. partial line, but set __SERR and errno in the same time, which
is inconsistent.
Now both OpenBSD and NetBSD return failure, i.e. no line and set error
indicators for such case, so make our fgetln() and fgetwln()
(as its wide version) compatible with the rest of *BSD.
PR: 212033
|
|
|
|
|
|
|
|
| |
Don't check for __SERR which may stick from one of any previous stdio
functions.
__SERR is for user and the rest of stdio code do not check it
for error sensing internally, only set it.
In vf(w)printf.c here it is more easy to save __SERR, clear and restore it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) _locale.h
LC_*_MASK bit shifting order was partially broken from the initial commit
time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the
right order.
The order here should match XLC_* from "xlocale_private.h" which, in turn,
match LC_* publicly visible order from <locale.h> which determines how
locale components are stored in the structure.
LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale()
and equivalent shift loop in the newlocale(), so mapped to some wrong
components (excluding two mentioned above).
Formally the fix is ABI breakage, but old code using those masks
never works properly in any case.
Only newlocale() and querylocale() are affected.
2) msgcat.c
Use current locale (f.e. set by thread). It was global locale always
previously.
PR: 211743
|
|
|
|
|
|
|
|
|
|
| |
getln: We cannot expand the buffer beyond INT_MAX (_size overflows).
In such cases return ENOMEM. This is a limitation of our
implementation, alternatively you may consider getline(3).
Differential Revision: https://reviews.freebsd.org/D442 (Partial)
Obtained from: Apple Inc. (Libc 997.90.3)
|
|
|
|
|
| |
MFC at whole.
Set __SERR on __slbexpand() errors.
|