projects
/
umurmur.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
db60a29
)
Fix null string compare causing crash
author
fatbob313
<martin@fatbob.nu>
Sat, 30 Jan 2010 21:09:07 +0000
(21:09 +0000)
committer
fatbob313
<martin@fatbob.nu>
Sat, 30 Jan 2010 21:09:07 +0000
(21:09 +0000)
src/client.c
patch
|
blob
|
history
diff --git
a/src/client.c
b/src/client.c
index a1f957d9e4234922b008b639550e6cf4f79717ad..1ef55f0b7bab590be65b92fde71c43d31609bc11 100644
(file)
--- 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) {
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);
Client_send_udp(dst, data, len);
else
Client_send_udp(dst, data, len - poslen);