mirror of
https://repo.or.cz/socat.git
synced 2024-12-23 07:52:32 +00:00
The internal vsnprintf_r function looped or crashed on size parameter with hexadecimal output
This commit is contained in:
parent
0fdd9ceb58
commit
53f528335c
2 changed files with 5 additions and 2 deletions
3
CHANGES
3
CHANGES
|
@ -54,6 +54,9 @@ corrections:
|
||||||
indentation.
|
indentation.
|
||||||
Thanks to Paul Wouters for reporting.
|
Thanks to Paul Wouters for reporting.
|
||||||
|
|
||||||
|
The internal vsnprintf_r function looped or crashed on size parameter
|
||||||
|
with hexadecimal output.
|
||||||
|
|
||||||
porting:
|
porting:
|
||||||
Type conflict between int and sig_atomic_t between declaration and
|
Type conflict between int and sig_atomic_t between declaration and
|
||||||
definition of diag_immediate_type and diag_immediate_exit broke
|
definition of diag_immediate_type and diag_immediate_exit broke
|
||||||
|
|
|
@ -296,7 +296,7 @@ static char *diag_longlong_to_dec(char *field, size_t n, long long ll, int leadi
|
||||||
*/
|
*/
|
||||||
static char *diag_ulonglong_to_hex(char *field, size_t n, unsigned long long ull, int leading0, size_t size) {
|
static char *diag_ulonglong_to_hex(char *field, size_t n, unsigned long long ull, int leading0, size_t size) {
|
||||||
char *np = field+n; /* point to the end */
|
char *np = field+n; /* point to the end */
|
||||||
unsigned int i;
|
ptrdiff_t i;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
if (n == 0) return NULL;
|
if (n == 0) return NULL;
|
||||||
|
@ -313,7 +313,7 @@ static char *diag_ulonglong_to_hex(char *field, size_t n, unsigned long long ull
|
||||||
c = ' ';
|
c = ' ';
|
||||||
}
|
}
|
||||||
i = size - strlen(np);
|
i = size - strlen(np);
|
||||||
while (--i >= 0) {
|
while (i-- > 0) {
|
||||||
*--np = c;
|
*--np = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue