summaryrefslogtreecommitdiff
path: root/src/lib/upnp
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-08-18 13:03:39 +0200
committerMax Kellermann <max@musicpd.org>2017-08-18 18:48:22 +0200
commit95637fd1533108b90979d92f4b6c851864602d07 (patch)
tree127036bb93d24ca46eb42e09510e92871464420c /src/lib/upnp
parent5ac72211cde050d230b750e2e3e5e4e37860cd40 (diff)
lib/upnp/Discovery: use strncmp() instead of memcmp()
memcmp() can overflow the buffer.
Diffstat (limited to 'src/lib/upnp')
-rw-r--r--src/lib/upnp/Discovery.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/upnp/Discovery.cxx b/src/lib/upnp/Discovery.cxx
index 121c01c57..267c90ff5 100644
--- a/src/lib/upnp/Discovery.cxx
+++ b/src/lib/upnp/Discovery.cxx
@@ -39,7 +39,7 @@ static bool
isCDService(const char *st) noexcept
{
constexpr size_t sz = sizeof(ContentDirectorySType) - 3;
- return memcmp(ContentDirectorySType, st, sz) == 0;
+ return strncmp(ContentDirectorySType, st, sz) == 0;
}
// The type of device we're asking for in search
@@ -50,7 +50,7 @@ static bool
isMSDevice(const char *st) noexcept
{
constexpr size_t sz = sizeof(MediaServerDType) - 3;
- return memcmp(MediaServerDType, st, sz) == 0;
+ return strncmp(MediaServerDType, st, sz) == 0;
}
static void