summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-06 00:54:10 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-10 02:15:45 +0300
commit1be3eeb8e8d84369989b33df34ea439f79497455 (patch)
tree88a073a286e8f905a7da3d765c55bd40347c2b4a
parent3d4e646d56afbde1e5ca58b7b791df876360092c (diff)
downloadhercules-1be3eeb8e8d84369989b33df34ea439f79497455.tar.gz
hercules-1be3eeb8e8d84369989b33df34ea439f79497455.tar.bz2
hercules-1be3eeb8e8d84369989b33df34ea439f79497455.tar.xz
hercules-1be3eeb8e8d84369989b33df34ea439f79497455.zip
Add missing checks into pc_groups.c
-rw-r--r--src/map/pc_groups.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index ccda34b1c..f0e3880b8 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -310,6 +310,7 @@ static void read_config(void) {
*/
bool pc_group_has_permission(GroupSettings *group, unsigned int permission)
{
+ nullpo_retr(false, group);
return ((group->e_permissions&permission) != 0);
}
@@ -319,6 +320,7 @@ bool pc_group_has_permission(GroupSettings *group, unsigned int permission)
*/
bool pc_group_should_log_commands(GroupSettings *group)
{
+ nullpo_retr(true, group);
return group->log_commands;
}
@@ -348,6 +350,7 @@ GroupSettings* pc_group_id2group(int group_id)
*/
const char* pc_group_get_name(GroupSettings *group)
{
+ nullpo_retr(NULL, group);
return group->name;
}
@@ -359,6 +362,7 @@ const char* pc_group_get_name(GroupSettings *group)
*/
int pc_group_get_level(GroupSettings *group)
{
+ nullpo_ret(group);
return group->level;
}
@@ -370,6 +374,7 @@ int pc_group_get_level(GroupSettings *group)
*/
int pc_group_get_idx(GroupSettings *group)
{
+ nullpo_ret(group);
return group->index;
}
@@ -380,6 +385,7 @@ int pc_group_get_idx(GroupSettings *group)
unsigned int pc_groups_add_permission(const char *name) {
uint64 key = 0x1;
unsigned char i;
+ nullpo_ret(name);
for(i = 0; i < pcg->permission_count; i++) {
if( strcmpi(name,pcg->permissions[i].name) == 0 ) {
@@ -468,6 +474,7 @@ void do_init_pc_groups(void) {
static int group_db_clear_sub(union DBKey key, struct DBData *data, va_list args)
{
GroupSettings *group = DB->data2ptr(data);
+ nullpo_ret(group);
if (group->name)
aFree(group->name);
return 0;