]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] ALSA: Fix re-use of va_list
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Oct 2006 12:55:46 +0000 (14:55 +0200)
committerChris Wright <chrisw@sous-sol.org>
Sat, 4 Nov 2006 01:33:46 +0000 (17:33 -0800)
The va_list is designed to be used only once.  The current code
may pass va_list arguments multiple times and may cause Oops.
Copy/release the arguments temporarily to avoid this problem.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
sound/core/info.c

index 340332c6d97337889e73927730747feecd6e37a6..57821ceb17b4b1919146b9aa2da102035e7b4731 100644 (file)
@@ -119,7 +119,10 @@ int snd_iprintf(struct snd_info_buffer *buffer, char *fmt,...)
        len = buffer->len - buffer->size;
        va_start(args, fmt);
        for (;;) {
-               res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, args);
+               va_list ap;
+               va_copy(ap, args);
+               res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, ap);
+               va_end(ap);
                if (res < len)
                        break;
                err = resize_info_buffer(buffer, buffer->len + PAGE_SIZE);