From: fatbob313 Date: Sat, 30 Jan 2010 21:09:07 +0000 (+0000) Subject: Fix null string compare causing crash X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=5cc17bcad8b587e1f45458b0a5c6053a24b54e32;hp=db60a2942eed420d693edea15e1db982184ff03d;p=umurmur.git Fix null string compare causing crash --- diff --git a/src/client.c b/src/client.c index a1f957d..1ef55f0 100644 --- a/src/client.c +++ b/src/client.c @@ -608,7 +608,9 @@ out: static inline void Client_send_voice(client_t *src, client_t *dst, uint8_t *data, int len, int poslen) { if (IS_AUTH(dst) && dst != src && !dst->deaf) { - if (poslen > 0 && strcmp(src->context, dst->context) == 0) + if (poslen > 0 && /* Has positional data */ + src->context != NULL && dst->context != NULL && /* ...both source and destination has context */ + strcmp(src->context, dst->context) == 0) /* ...and the contexts match */ Client_send_udp(dst, data, len); else Client_send_udp(dst, data, len - poslen);