Fix possible NULL
pointer dereference in VERIFY_READ
Static analysis flagged this. Fixed by simply checking `oldlenp` before dereferencing it.
This commit is contained in:
parent
12311fe6c3
commit
dc0a184f8d
@ -1816,7 +1816,9 @@ ctl_mtx_assert_held(tsdn_t *tsdn) {
|
|||||||
/* Verify that the space provided is enough. */
|
/* Verify that the space provided is enough. */
|
||||||
#define VERIFY_READ(t) do { \
|
#define VERIFY_READ(t) do { \
|
||||||
if (oldp == NULL || oldlenp == NULL || *oldlenp != sizeof(t)) { \
|
if (oldp == NULL || oldlenp == NULL || *oldlenp != sizeof(t)) { \
|
||||||
|
if (oldlenp != NULL) { \
|
||||||
*oldlenp = 0; \
|
*oldlenp = 0; \
|
||||||
|
} \
|
||||||
ret = EINVAL; \
|
ret = EINVAL; \
|
||||||
goto label_return; \
|
goto label_return; \
|
||||||
} \
|
} \
|
||||||
|
Loading…
Reference in New Issue
Block a user