Merge pull request #29 from attilamolnar/master+fixes

Fixes for bugs discovered by Coverity Scan and myself
This commit is contained in:
William Pitcock 2014-09-17 21:15:45 -05:00
commit 1416aa428d
5 changed files with 11 additions and 8 deletions

View File

@ -444,6 +444,7 @@ static int dnsbl_config_handler(mowgli_config_file_entry_t *ce)
{ {
char *line = sstrdup(cce->varname); char *line = sstrdup(cce->varname);
new_blacklist(line); new_blacklist(line);
free(line);
} }
return 0; return 0;

View File

@ -58,9 +58,9 @@ static void my_rhandler(connection_t * cptr)
{ {
char buf[BUFSIZE * 2]; char buf[BUFSIZE * 2];
if (!my_read(cptr, buf)) if (my_read(cptr, buf) <= 0)
connection_close(cptr); connection_close(cptr);
else
do_packet(cptr, buf); do_packet(cptr, buf);
} }

View File

@ -62,9 +62,9 @@ static void my_rhandler(connection_t * cptr)
{ {
char buf[BUFSIZE * 2]; char buf[BUFSIZE * 2];
if (!my_read(cptr, buf)) if (my_read(cptr, buf) <= 0)
connection_close(cptr); connection_close(cptr);
else
do_packet(buf); do_packet(buf);
} }

View File

@ -579,7 +579,7 @@ static void trace_kill_exec(user_t *u, trace_action_t *act)
return; return;
if (u->myuser && is_soper(u->myuser)) if (u->myuser && is_soper(u->myuser))
return; return;
if ((svs = service_find("operserv")) != NULL) if ((svs = service_find("operserv")) == NULL)
return; return;
act->matched = true; act->matched = true;

View File

@ -630,9 +630,11 @@ move_wumpus(void *unused)
/* player_t *p has been eaten and is no longer in the game */ /* player_t *p has been eaten and is no longer in the game */
resign_player(p); resign_player(p);
} }
else
/* prepare for the next turn */ {
p->has_moved = false; /* prepare for the next turn */
p->has_moved = false;
}
} }
/* report any wumpus kills */ /* report any wumpus kills */