diff options
author | Max Kellermann <max@musicpd.org> | 2017-01-03 13:16:29 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-01-03 13:17:02 +0100 |
commit | 31d77ec58032cc67c81118f6f6fd136c90947dff (patch) | |
tree | 896297c198a7179b6e4b2d8915cc5b8b727ee209 /src/storage | |
parent | 06116382eefbddebc55404183e67ad7f68551ed6 (diff) |
input/curl, ...: use strncmp() instead of memcmp() to avoid crash
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/plugins/NfsStorage.cxx | 2 | ||||
-rw-r--r-- | src/storage/plugins/SmbclientStorage.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx index edf9b1b92..6e00f7e34 100644 --- a/src/storage/plugins/NfsStorage.cxx +++ b/src/storage/plugins/NfsStorage.cxx @@ -389,7 +389,7 @@ NfsStorage::OpenDirectory(const char *uri_utf8) static Storage * CreateNfsStorageURI(EventLoop &event_loop, const char *base) { - if (memcmp(base, "nfs://", 6) != 0) + if (strncmp(base, "nfs://", 6) != 0) return nullptr; const char *p = base + 6; diff --git a/src/storage/plugins/SmbclientStorage.cxx b/src/storage/plugins/SmbclientStorage.cxx index 0b4de5683..92702259a 100644 --- a/src/storage/plugins/SmbclientStorage.cxx +++ b/src/storage/plugins/SmbclientStorage.cxx @@ -182,7 +182,7 @@ SmbclientDirectoryReader::GetInfo(gcc_unused bool follow) static Storage * CreateSmbclientStorageURI(gcc_unused EventLoop &event_loop, const char *base) { - if (memcmp(base, "smb://", 6) != 0) + if (strncmp(base, "smb://", 6) != 0) return nullptr; SmbclientInit(); |