Skip to content

Commit

Permalink
ASoC: 88pm860x-codec: Fix possibly missing string termination
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Mack authored and Mark Brown committed Oct 7, 2014
1 parent a5448c8 commit 77eca3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/codecs/88pm860x-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down

0 comments on commit 77eca3c

Please sign in to comment.