From 1cead826cb0ffe5a84c419260834b703b1af24b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Tue, 9 Oct 2018 14:55:30 -0700 Subject: [PATCH] zos: avoid UB with NULL pointer arithmetic PR-URL: https://github.com/libuv/libuv/pull/2017 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Santiago Gimeno Reviewed-By: Richard Lau Reviewed-By: John Barboza --- src/unix/os390.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/unix/os390.c b/src/unix/os390.c index 65e9b708..a64d098d 100644 --- a/src/unix/os390.c +++ b/src/unix/os390.c @@ -357,13 +357,11 @@ uint64_t uv_get_total_memory(void) { int uv_resident_set_memory(size_t* rss) { - char* psa; char* ascb; char* rax; size_t nframes; - psa = PSA_PTR; - ascb = *(char* __ptr32 *)(psa + PSAAOLD); + ascb = *(char* __ptr32 *)(PSA_PTR + PSAAOLD); rax = *(char* __ptr32 *)(ascb + ASCBRSME); nframes = *(unsigned int*)(rax + RAXFMCT);