ASoC: 88pm860x-codec: Fix possibly missing string termination
authorDaniel Mack <daniel@zonque.org>
Tue, 7 Oct 2014 11:41:25 +0000 (13:41 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 7 Oct 2014 12:13:22 +0000 (13:13 +0100)
Coverity spotted an issue with strncpy() in pm860x_codec_probe()
which does not take the \0 termination byte into account. Fix this
by making the buffers one byte larger so the can really accommodate
MAX_NAME_LEN bytes long strings.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/88pm860x-codec.c

index 4c3b0af..e88a6b6 100644 (file)
@@ -146,7 +146,7 @@ struct pm860x_priv {
        struct pm860x_det       det;
 
        int                     irq[4];
-       unsigned char           name[4][MAX_NAME_LEN];
+       unsigned char           name[4][MAX_NAME_LEN+1];
 };
 
 /* -9450dB to 0dB in 150dB steps ( mute instead of -9450dB) */