From 9b5bb84f693a19ff119af01fc0d4953e59ac583e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 31 Mar 2015 12:13:01 +0300 Subject: Add checks to int_quest.c --- src/char/int_quest.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/char/int_quest.c b/src/char/int_quest.c index dd3d4e1bf..1d64f48a3 100644 --- a/src/char/int_quest.c +++ b/src/char/int_quest.c @@ -16,6 +16,7 @@ #include "../common/db.h" #include "../common/malloc.h" #include "../common/mmo.h" +#include "../common/nullpo.h" #include "../common/showmsg.h" #include "../common/socket.h" #include "../common/sql.h" @@ -66,8 +67,9 @@ struct quest *mapif_quests_fromsql(int char_id, int *count) || SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &tmp_quest.quest_id, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &tmp_quest.state, 0, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_UINT, &tmp_quest.time, 0, NULL, NULL) - ) + ) { sqlerror = SQL_ERROR; + } StrBuf->Destroy(&buf); @@ -244,6 +246,7 @@ int mapif_parse_quest_save(int fd) void mapif_send_quests(int fd, int char_id, struct quest *tmp_questlog, int num_quests) { + nullpo_retv(tmp_questlog); WFIFOHEAD(fd,num_quests*sizeof(struct quest)+8); WFIFOW(fd,0) = 0x3860; WFIFOW(fd,2) = num_quests*sizeof(struct quest)+8; -- cgit v1.2.3-70-g09d2