Skip to content

Commit

Permalink
Fix NULL pointer dereference in webadmin.
Browse files Browse the repository at this point in the history
Triggerable by any non-admin, if webadmin is loaded.

The only affected version is 1.0

Thanks to ChauffeR (Simone Esposito) for reporting this.
  • Loading branch information
DarthGandalf committed May 27, 2013
1 parent def14c2 commit 2bd410e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/webadmin.cpp
Expand Up @@ -426,7 +426,7 @@ class CWebAdminMod : public CModule {
CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock);

// Admin||Self Check
if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) {
if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) {
return false;
}

Expand Down Expand Up @@ -455,7 +455,7 @@ class CWebAdminMod : public CModule {
CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock);

// Admin||Self Check
if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) {
if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) {
return false;
}

Expand All @@ -479,7 +479,7 @@ class CWebAdminMod : public CModule {
CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock);

// Admin||Self Check
if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) {
if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) {
return false;
}

Expand All @@ -493,7 +493,7 @@ class CWebAdminMod : public CModule {
CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock);

// Admin||Self Check
if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) {
if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) {
return false;
}

Expand Down

0 comments on commit 2bd410e

Please sign in to comment.