aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-21 12:55:49 +0200
committerTakashi Iwai <tiwai@suse.de>2015-04-21 12:55:49 +0200
commit85fa1c308b4ad1ccee298e2f883087bd5357035d (patch)
tree185c3db9115d146ae0d7ffc13b25eb74d1e197ca
parentc7e9869fa6efac046f30fb20f6985fd0a4e51702 (diff)
downloadsalsa-lib-85fa1c308b4ad1ccee298e2f883087bd5357035d.tar.gz
Fix a possible buffer overflow in snd_pcm_chmap_print()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--src/pcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 7f562ab..713ff90 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -1344,7 +1344,7 @@ int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf)
return -ENOMEM;
}
if (map->pos[i] & SND_CHMAP_DRIVER_SPEC)
- len += snprintf(buf + len, maxlen, "%d", p);
+ len += snprintf(buf + len, maxlen - len, "%d", p);
else {
const char *name = _snd_chmap_names[p];
if (name)