| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
In _gettemp(), check that the length of the path doesn't exceed
MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
carrybuf causing a buffer overflow.
PR: bin/140228
Notes:
svn path=/stable/7/; revision=205330
|
|
|
|
|
|
|
| |
K&R -> ANSI prototype.
Notes:
svn path=/stable/7/; revision=202667
|
|
|
|
|
|
|
| |
Remove unnecessary quoting and markup, add missing punctuation.
Notes:
svn path=/stable/7/; revision=202414
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Eliminate dead stores.
In __mbsconv(), if prec was zero, nconv could have been used
uninitialized. Initialize it to a safe value so that there's no
chance of returning an error if stack garbage happens to be equal to
(size_t)-1 or (size_t)-2.
In clnt_raw_create(), avoid minor race condition initializing the
file-scope variable clntraw_private.
Mark head rev 199785 as merged; 7-STABLE's version of svc_raw_reply()
doesn't have the same bug (or even look all that similar).
Found by: Clang static analyzer
Notes:
svn path=/stable/7/; revision=200017
|
|
|
|
|
|
|
|
|
| |
Make sure %zd treats negative arguments properly on 32-bit platforms.
PR: 131880
Notes:
svn path=/stable/7/; revision=189802
|
|
|
|
|
|
|
|
|
| |
Set the error indicator on an attempt to write to a read-only stream.
PR: 127335
Notes:
svn path=/stable/7/; revision=187810
|
|
|
|
|
|
|
|
|
| |
sizeof(size_t), i.e. on all 64-bit platforms.
Approved by: re (kib)
Notes:
svn path=/stable/7/; revision=186042
|
|
|
|
|
|
|
| |
uninitialized variables.
Notes:
svn path=/stable/7/; revision=182495
|
|
|
|
|
|
|
| |
mkstemps(), and mkdtemp().
Notes:
svn path=/stable/7/; revision=181306
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove useless call to getdtablesize(2) in fdopen(3) and its useless
variable nofile.
PR: 123109
Submitted by: Christoph Mallon
Approved by: rwatson (mentor)
MFC after: 1 month
Notes:
svn path=/stable/7/; revision=180933
|
|
|
|
|
|
|
| |
SHRT_MAX.
Notes:
svn path=/stable/7/; revision=178665
|
|
|
|
| |
Notes:
svn path=/stable/7/; revision=177307
|
|
|
|
| |
Notes:
svn path=/head/; revision=170908
|
|
|
|
|
|
|
| |
Move overflow check for fseek as early as needed.
Notes:
svn path=/head/; revision=170907
|
|
|
|
|
|
|
| |
even if the programmer asks for zero padding.
Notes:
svn path=/head/; revision=169355
|
|
|
|
| |
Notes:
svn path=/head/; revision=169092
|
|
|
|
| |
Notes:
svn path=/head/; revision=168862
|
|
|
|
|
|
|
| |
don't program against our more restrictive behaviour.
Notes:
svn path=/head/; revision=168858
|
|
|
|
|
|
|
|
|
|
|
| |
when issetugid(3) is true.
PR: docs/108346
Obtained from: OpenBSD
MFC after: 1 week
Notes:
svn path=/head/; revision=167652
|
|
|
|
| |
Notes:
svn path=/head/; revision=165968
|
|
|
|
|
|
|
|
|
| |
clause.
# If I've done so improperly on a file, please let me know.
Notes:
svn path=/head/; revision=165903
|
|
|
|
|
|
|
| |
PR: 90333
Notes:
svn path=/head/; revision=165742
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the const qualifier from ap argument for __v2printf, that induced
that breakage, and seems to be the real reason for bad code. ap is modified
inside the __v2printf body by va_arg macro.
Pointy hat to: kib
Approved by: pjd (mentor)
Notes:
svn path=/head/; revision=163624
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
i386 with default optimization level (-O2), va_list pointer ap in the
__v2printf function is advanced before the use. That cause argument
shift and garbage instead last argument in printf-family when xprintf is
activated.
The nsswitch is easy victim of the bug.
Reviewed by: kan
Approved by: kan (mentor)
MFC after: 1 week
Notes:
svn path=/head/; revision=163566
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue __sflush() before possible setting O_APPEND mode or ftruncate(),
write to wrong place may occurse oserwise.
Use simplified _sseek() to the start, if no O_APPEND is set, instead
of _fseeko() (_sseek() to the end, if O_APPEND, occurse later, as for
file != NULL).
Don't check seek error return, as original fopen() and freopen() never
does.
file != NULL:
Add missing _sseek() to the end.
Notes:
svn path=/head/; revision=163430
|
|
|
|
|
|
|
| |
Move errno restoring after FUNLOCKFILE in one case
Notes:
svn path=/head/; revision=163406
|
|
|
|
|
|
|
| |
f.e. sockets when ftruncate normally fail.
Notes:
svn path=/head/; revision=163405
|
|
|
|
|
|
|
|
|
|
| |
Catch ftruncate errors
PR: 104295
Submitted by: ru (seek)
Notes:
svn path=/head/; revision=163385
|
|
|
|
| |
Notes:
svn path=/head/; revision=162523
|
|
|
|
| |
Notes:
svn path=/head/; revision=162385
|
|
|
|
| |
Notes:
svn path=/head/; revision=161526
|
|
|
|
|
|
|
| |
Spotted by: Antoine Brodin (antoine _dot_ brodin _at_ laposte _dot_ net)
Notes:
svn path=/head/; revision=157963
|
|
|
|
|
|
|
| |
of FreeBSD private symbols.
Notes:
svn path=/head/; revision=157961
|
|
|
|
|
|
|
|
|
| |
Linux also provides an fcloseall() implementation.
Discussed on: arch
Notes:
svn path=/head/; revision=157959
|
|
|
|
| |
Notes:
svn path=/head/; revision=157381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FBSDprivate locale symbols. These functions are needed by
libcompat.
Add _cleanup to the list of stdio FBSDprivate symbols. Some
third party applications use this. This will be removed and
replaced by fcloseall() once libc version is bumped.
Add _res to the list of resolv symbols.
Found by: portbuilder runs (thanks Kris!)
Notes:
svn path=/head/; revision=157282
|
|
|
|
| |
Notes:
svn path=/head/; revision=156613
|
|
|
|
|
|
|
| |
Reviewed by: davidxu
Notes:
svn path=/head/; revision=156608
|
|
|
|
| |
Notes:
svn path=/head/; revision=156207
|
|
|
|
|
|
|
| |
Make sure to always print something in the alternate time format.
Notes:
svn path=/head/; revision=155300
|
|
|
|
| |
Notes:
svn path=/head/; revision=155085
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add %M{essage} extension which prints an errno value as the
corresponding string if possible or numerically otherwise.
It is not currently possible to do the syslog(3) like %m extension
because errno would need to get capatured on entry to the first
function in the printf family, so %M requires you to supply errno
as an argument.
Add %Q{uote} extension which will print a string in double quotes with
appropriate back-slash escapes (only) if necessary.
Notes:
svn path=/head/; revision=154815
|
|
|
|
|
|
|
| |
char defaults to unsigned.
Notes:
svn path=/head/; revision=153641
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on probationary terms: it may go away again if it transpires it is
a bad idea.
This extensible printf version will only be used if either
environment variable USE_XPRINTF is defined
or
one of the extension functions are called.
or
the global variable __use_xprintf is set greater than zero.
In all other cases our traditional printf implementation will
be used.
The extensible version is slower than the default printf, mostly
because less opportunity for combining I/O operation exists when
faced with extensions. The default printf on the other hand
is a bad case of spaghetti code.
The extension API has a GLIBC compatible part and a FreeBSD version
of same. The FreeBSD version exists because the GLIBC version may
run afoul of our FILE * locking in multithreaded programs and it
even further eliminate the opportunities for combining I/O operations.
Include three demo extensions which can be enabled if desired: time
(%T), hexdump (%H) and strvis (%V).
%T can format time_t (%T), struct timeval (%lT) and struct timespec (%llT)
in one of two human readable duration formats:
"%.3llT" -> "20349.245"
"%#.3llT" -> "5h39m9.245"
%H will hexdump a sequence of bytes and takes a pointer and a length
argument. The width specifies number of bytes per line.
"%4H" -> "65 72 20 65"
"%+4H" -> "0000 65 72 20 65"
"%#4H" -> "65 72 20 65 |er e|"
"%+#4H" -> "0000 65 72 20 65 |er e|"
%V will dump a string in strvis format.
"%V" -> "Hello\tWor\377ld" (C-style)
"%0V" -> "Hello\011Wor\377ld" (octal)
"%+V" -> "Hello%09Wor%FFld" (http-style)
Tests, comments, bugreports etc are most welcome.
Notes:
svn path=/head/; revision=153486
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
allocate a memory block. sscanf calls __svfscanf which in turn calls
fread, fread triggers mutex initialization but the mutex is not
destroyed in sscanf, this leads to memory leak. To avoid the memory
leak and performance issue, we create a none MT-safe version of fread:
__fread, and instead let __svfscanf call __fread.
PR: threads/90392
Patch submitted by: dhartmei
MFC after: 7 days
Notes:
svn path=/head/; revision=153467
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some denormalized long double values, a bug in __hldtoa() (called
from *printf()'s %A format) results in a base 16 digit being rounded
up from 0xf to 0x10.
When this digit is subsequently converted to string format, an index
of 10 reaches past the end of the uppper-case hex/char array, picking
up whatever the code segment happen to contain at that address.
This mostly seem to be some character from the upper half of the
byte range.
When using the %a format instead of %A, the first character past
the end of the lowercase hex/char table happens to be index 0 in
the uppercase hex/char table hextable and therefore the string
representation features a '0', which is supposedly correct.
This leads me to belive that the proper fix _may_ be as simple as
masking all but the lower four bits off after incrementing a hex-digit
in libc/gdtoa/_hdtoa.c:roundup(). I worry however that the upper
bit in 0x10 indicates a carry not carried.
Until das@ or bde@ finds time to visit this issue, extend the
hexdigit arrays with a 17th index containing '?' so that we get a
invalid but consistent and printable output in both %a and %A formats
whenever this bug strikes.
This unmasks the bug in the %a format therefore solving the real
issue may both become easier and more urgent.
Possibly related to: PR 85080
With help by: bde@
Notes:
svn path=/head/; revision=153375
|
|
|
|
| |
Notes:
svn path=/head/; revision=152733
|
|
|
|
|
|
|
|
|
| |
PR: 86169
Submitted by: Toby Peterson <toby@apple.com>
MFC after: 3 days
Notes:
svn path=/head/; revision=150291
|
|
|
|
|
|
|
| |
stdio/ and stdlib/. Don't define __cleanup twice.
Notes:
svn path=/head/; revision=150040
|
|
|
|
| |
Notes:
svn path=/head/; revision=149792
|