From 02bf42b006ce5e3d835afad5d2622ebc5c37ce36 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sun, 16 Nov 2014 15:00:08 +0200 Subject: [PATCH] Fixed buffer handling in cSatipTuner::ParseReceptionParameters(). --- tuner.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tuner.c b/tuner.c index e413ce7..67719d8 100644 --- a/tuner.c +++ b/tuner.c @@ -234,13 +234,14 @@ bool cSatipTuner::Disconnect(void) void cSatipTuner::ParseReceptionParameters(u_char *bufferP, int lengthP) { - //debug("cSatipTuner::%s(%s, %d) [device %d]", __FUNCTION__, bufferP, lengthP, deviceIdM); + //debug("cSatipTuner::%s(%d) [device %d]", __FUNCTION__, lengthP, deviceIdM); // DVB-S2: // ver=.;src=;tuner=,,,,,,,,,,,;pids=,..., // DVB-T2: // ver=1.1;tuner=,,,,,,,,,,,,,;pids=,..., if (lengthP > 0) { - char *s = strdup((char *)bufferP); + char *s = strndup((char *)bufferP, lengthP); + //debug("cSatipTuner::%s(%s) [device %d]", __FUNCTION__, s, deviceIdM); char *c = strstr(s, ";tuner="); if (c) { int value;