From 1ea16746b1330656e152278a7192e5b7adef0539 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 17 Jan 2015 22:36:52 +0300 Subject: Add some fixes to char server. Found by coverity scan. --- src/char/char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/char/char.c') diff --git a/src/char/char.c b/src/char/char.c index 1d9d1d65c..f1bacbeb3 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1461,7 +1461,7 @@ bool char_char_slotchange(struct char_session_data *sd, int fd, unsigned short f struct mmo_charstatus char_dat; int from_id = 0; - if( from > MAX_CHARS || to > MAX_CHARS || ( sd->char_slots && to > sd->char_slots ) || sd->found_char[from] <= 0 ) + if( from >= MAX_CHARS || to >= MAX_CHARS || ( sd->char_slots && to > sd->char_slots ) || sd->found_char[from] <= 0 ) return false; if( !chr->mmo_char_fromsql(sd->found_char[from], &char_dat, false) ) // Only the short data is needed. -- cgit v1.2.3-70-g09d2