resolver: fixed few bugs

Fixed a bug which caused resolver to return a wrong target name with a
missed ".". The bug was in the part of message_name_get() where a pointer
is handled.
Added checks for buffer overflow.
Added 2 test cases to check a corner case and error handling.
This commit is contained in:
Dmitry Podgorny
2016-09-15 19:26:10 +03:00
parent f0706f56c4
commit c6aaa96dcb
4 changed files with 125 additions and 17 deletions

View File

@@ -18,6 +18,9 @@
#include "ostypes.h"
/* TODO evaluate x and y only once */
#define xmpp_min(x, y) ((x) < (y) ? (x) : (y))
/* string functions */
char *xmpp_strtok_r(char *s, const char *delim, char **saveptr);