diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2014-03-30 10:47:08 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-03-31 06:43:10 +0000 |
commit | 650ed5f249561ce65d10ea6141557b3adea3329e (patch) | |
tree | e6b6c38fdcce7b3e71f4a665312325b26ba6f7b7 /epan | |
parent | 550e3153bf0f37a9297057c3c5024aa8809fd428 (diff) |
packet-osc dissector bug fix of path validity func
- 'is_valid_path' function has been corrected
- an OSC path is valid if:
- it consists of printable characters only
- does not contain ' ' and '#'
- characters '*' ',' '?' '[' ']' '{' '}' are valid, but have special meaning at the receiving end (used for pattern matching)
Change-Id: I4ff4308d0955da2ef377d606b7778819b97754a0
Reviewed-on: https://code.wireshark.org/review/868
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-osc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/dissectors/packet-osc.c b/epan/dissectors/packet-osc.c index eacd998901..8104633fe9 100644 --- a/epan/dissectors/packet-osc.c +++ b/epan/dissectors/packet-osc.c @@ -30,6 +30,7 @@ #include "config.h" #include <string.h> +#include <ctype.h> #include <epan/packet.h> #include <epan/prefs.h> @@ -64,7 +65,7 @@ typedef enum _OSC_Type { /* characters not allowed in OSC path string */ static const char invalid_path_chars [] = { - ' ', '#', '*', ',', '?', '[', ']', '{', '}', + ' ', '#', '\0' }; @@ -256,7 +257,7 @@ is_valid_path(const char *path) if(path[0] != '/') return FALSE; for(ptr=path+1; *ptr!='\0'; ptr++) - if(strchr(invalid_path_chars, *ptr) != NULL) + if( (isprint(*ptr) == 0) || (strchr(invalid_path_chars, *ptr) != NULL) ) return FALSE; return TRUE; } |