aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2017-07-03 23:55:30 +0200
committercbdev <cb@cbcdn.com>2017-07-03 23:55:30 +0200
commit7cc78e0413504ba0c58289d964a65df2b872271e (patch)
tree645405c09b4a219111dfe824c638a7c59b9ee2c8
parent1ffe53ba1493741b209c3040a359799c5ada4cf4 (diff)
downloadmidimonster-7cc78e0413504ba0c58289d964a65df2b872271e.tar.gz
midimonster-7cc78e0413504ba0c58289d964a65df2b872271e.tar.bz2
midimonster-7cc78e0413504ba0c58289d964a65df2b872271e.zip
Validate instance names
-rw-r--r--config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.c b/config.c
index d3605e2..c41a614 100644
--- a/config.c
+++ b/config.c
@@ -132,6 +132,12 @@ int config_read(char* cfg_file){
goto bail;
}
+ //validate instance name
+ if(strchr(separator, ' ') || strchr(separator, '.')){
+ fprintf(stderr, "Invalid instance name %s\n", separator);
+ goto bail;
+ }
+
current_instance = current_backend->create();
if(!current_instance){
fprintf(stderr, "Failed to instantiate backend %s\n", line);