mirror of
https://repo.or.cz/socat.git
synced 2025-07-11 06:22:58 +00:00
Fixed possible crash or fail of option ip-add-membership with two parameters
This commit is contained in:
parent
bcca5a3b9a
commit
920ed1f0a3
7 changed files with 30 additions and 4 deletions
15
sycls.c
15
sycls.c
|
@ -1513,6 +1513,9 @@ void *Malloc(size_t size) {
|
|||
Error1("malloc("F_Zd"): out of memory", size);
|
||||
return NULL;
|
||||
}
|
||||
#if WITH_DEVTESTS
|
||||
memset(result, 0x55, size);
|
||||
#endif /* WITH_DEVTESTS */
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1540,6 +1543,18 @@ void *Realloc(void *ptr, size_t size) {
|
|||
return result;
|
||||
}
|
||||
|
||||
/* Like Realloc(), but gets info about old size for overwrite test */
|
||||
void *Realloc3(void *ptr, size_t size, size_t oldsize) {
|
||||
void *result = Realloc(ptr, size);
|
||||
if (result == NULL)
|
||||
return result;
|
||||
#if WITH_DEVTESTS
|
||||
if (size > oldsize)
|
||||
memset(result+oldsize, 0x55, size-oldsize);
|
||||
#endif /* WITH_DEVTESTS */
|
||||
return result;
|
||||
}
|
||||
|
||||
#if _WITH_TERMIOS
|
||||
int Tcgetattr(int fd, struct termios *termios_p) {
|
||||
int i, result, _errno;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue