[io] prevent possible crash on empty string in source_apple_audio
authorPaul Brossier <piem@piem.org>
Sun, 16 Dec 2018 18:39:28 +0000 (19:39 +0100)
committerPaul Brossier <piem@piem.org>
Sun, 16 Dec 2018 18:39:28 +0000 (19:39 +0100)
src/io/source_apple_audio.c

index 6b26b43..d8b33af 100644 (file)
@@ -59,7 +59,7 @@ aubio_source_apple_audio_t * new_aubio_source_apple_audio(const char_t * path, u
 {
   aubio_source_apple_audio_t * s = AUBIO_NEW(aubio_source_apple_audio_t);
 
-  if (path == NULL) {
+  if (path == NULL || strnlen(path, PATH_MAX) < 1) {
     AUBIO_ERROR("source_apple_audio: Aborted opening null path\n");
     goto beach;
   }