]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
HasPrivilege(): check to make sure localClient and localClient.privset are non-NULL.
authorWilliam Pitcock <redacted>
Sun, 17 Aug 2008 13:52:04 +0000 (08:52 -0500)
committerWilliam Pitcock <redacted>
Sun, 17 Aug 2008 13:52:04 +0000 (08:52 -0500)
include/s_newconf.h

index 0e135f2efe17dbaec5f22b28426b15820170f923..d3f9b1f51ee62dcc9678d0dc819c7a972d979d62 100644 (file)
@@ -167,7 +167,7 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
 
 #define IsOperConfEncrypted(x) ((x)->flags & OPER_ENCRYPTED)
 
-#define HasPrivilege(x, y)     (privilegeset_in_set((x)->localClient->privset, (y)))
+#define HasPrivilege(x, y)     ((x)->localClient != NULL && (x)->localClient->privset != NULL && privilegeset_in_set((x)->localClient->privset, (y)))
 
 #define IsOperGlobalKill(x)     (HasPrivilege((x), "oper:global_kill"))
 #define IsOperLocalKill(x)      (HasPrivilege((x), "oper:local_kill"))