diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-04-24 21:52:34 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-04-24 21:52:34 +0000 |
commit | ee2820a23c6968bbeadbdf510389301dca6bc765 (patch) | |
tree | e1de2eb716f1600e885820060d6b1bf984d5b122 /avahi-common/domain.c | |
parent | 9541ceb22b5ecd525e16a318b95329a38240a7a4 (diff) |
add an utf8 check when unescaping domains - essentially this means that all domain related functions will now consider strings with invalid utf8 as invalid (see #21)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1202 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common/domain.c')
-rw-r--r-- | avahi-common/domain.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/avahi-common/domain.c b/avahi-common/domain.c index 1ac8577..8d339c7 100644 --- a/avahi-common/domain.c +++ b/avahi-common/domain.c @@ -37,6 +37,7 @@ #include "malloc.h" #include "error.h" #include "address.h" +#include "utf8.h" /* Read the first label from string *name, unescape "\" and write it to dest */ char *avahi_unescape_label(const char **name, char *dest, size_t size) { @@ -107,6 +108,9 @@ char *avahi_unescape_label(const char **name, char *dest, size_t size) { *d = 0; + if (!avahi_utf8_valid(dest)) + return NULL; + return dest; } |