mirror of
https://github.com/strophe/libstrophe.git
synced 2026-07-19 04:16:20 +00:00
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.
32 lines
726 B
C
32 lines
726 B
C
/* util.h
|
|
** strophe XMPP client library -- various utility functions
|
|
**
|
|
** Copyright (C) 2005-2009 Collecta, Inc.
|
|
**
|
|
** This software is provided AS-IS with no warranty, either express
|
|
** or implied.
|
|
**
|
|
** This program is dual licensed under the MIT and GPLv3 licenses.
|
|
*/
|
|
|
|
/** @file
|
|
* Internally used utility functions.
|
|
*/
|
|
|
|
#ifndef __LIBSTROPHE_UTIL_H__
|
|
#define __LIBSTROPHE_UTIL_H__
|
|
|
|
#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);
|
|
|
|
/* timing functions */
|
|
uint64_t time_stamp(void);
|
|
uint64_t time_elapsed(uint64_t t1, uint64_t t2);
|
|
|
|
#endif /* __LIBSTROPHE_UTIL_H__ */
|