#include "citserver.h"
#include "support.h"
#include "config.h"
-#include "serv_extensions.h"
#include "database.h"
#include "msgbase.h"
#include "control.h"
/* extract the word */
word_len = word_end - word_start + 1;
safestrncpy(word, word_start, sizeof word);
- word[word_len] = 0;
+ if (word_len >= sizeof word) {
+ lprintf(CTDL_DEBUG, "Invalid word length: %d\n", word_len);
+ word[(sizeof word_len) - 1] = 0;
+ }
+ else {
+ word[word_len] = 0;
+ }
word_start = NULL;
/* disqualify noise words */