From: Matteo Nastasi (mop) Date: Mon, 16 May 2011 06:31:00 +0000 (+0200) Subject: all shm_get_var() ret values are checked X-Git-Tag: 3.5.5~11 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=e47ddcae6cc33ed9d2471a54936db7d8efd5d46a;p=brisk.git all shm_get_var() ret values are checked --- diff --git a/web/Obj/auth.phh b/web/Obj/auth.phh index 8e74ffd..11c7425 100644 --- a/web/Obj/auth.phh +++ b/web/Obj/auth.phh @@ -179,7 +179,7 @@ class Challenges { $shm_sz = CHAL_SHM_DIMS_MIN; if ($shm = shm_attach($tok, $shm_sz)) { - $chals = @shm_get_var($shm, $tok); + $chals = @shm_get_var($shm, $tok); // CHECKED BELOW log_only("challenges == ".($chals == FALSE ? "FALSE" : "TRUE")." challenges === ".($chals === FALSE ? "FALSE" : "TRUE")." challenges isset ".(isset($chals) ? "TRUE" : "FALSE")); diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 2a2d9eb..2ba7c1a 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -928,8 +928,9 @@ class User { $shm_sz = SHM_DIMS_U_MIN; if ($shm = shm_attach($tok, $shm_sz)) { - $user = @shm_get_var($shm, $tok); - + if (($user = @shm_get_var($shm, $tok)) == FALSE) { + break; + } if ($sess != FALSE && $user->sess != $sess) { break; } @@ -2267,7 +2268,7 @@ class Room { $shm_sz = SHM_DIMS_MIN; if ($shm = shm_attach($tok, $shm_sz)) { - $room = @shm_get_var($shm, $tok); + $room = @shm_get_var($shm, $tok); // CHECKED BELOW log_only("bri == ".($room == FALSE ? "FALSE" : "TRUE")." bri === ".($room === FALSE ? "FALSE" : "TRUE")." bri isset ".(isset($room) ? "TRUE" : "FALSE")); if (isset($room)) diff --git a/web/Obj/hardban.phh b/web/Obj/hardban.phh index 1795a60..7423b6a 100644 --- a/web/Obj/hardban.phh +++ b/web/Obj/hardban.phh @@ -172,7 +172,7 @@ class Hardbans { $shm_sz = HBAN_SHM_DIMS_MIN; if ($shm = shm_attach($tok, $shm_sz)) { - $hban = @shm_get_var($shm, $tok); + $hban = @shm_get_var($shm, $tok); // CHECKED BELOW log_only("hardban == ".($hban == FALSE ? "FALSE" : "TRUE")." hardban === ".($hban === FALSE ? "FALSE" : "TRUE")." hardban isset ".(isset($hban) ? "TRUE" : "FALSE")); diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index 3da1545..164fb50 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -589,7 +589,9 @@ class Bin5_user extends User { $shm_sz = SHM_DIMS_U_MIN; if ($shm = shm_attach($tok, $shm_sz)) { - $user = @shm_get_var($shm, $tok); + if (($user = @shm_get_var($shm, $tok)) == FALSE) { + break; + } if ($sess != FALSE && $user->sess != $sess) { break;