Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 347054 Details for
Bug 468160
Buffer overflow in alsactl from media-sound/alsa-utils-1.0.27
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix for buffer overflow crash by using snprintf()
0001-alsactl-sprintf-to-snprintf-prevent-buffer-overflow.patch (text/plain), 1.02 KB, created by
Doug Goldstein (RETIRED)
on 2013-05-01 16:06:18 UTC
(
hide
)
Description:
Fix for buffer overflow crash by using snprintf()
Filename:
MIME Type:
Creator:
Doug Goldstein (RETIRED)
Created:
2013-05-01 16:06:18 UTC
Size:
1.02 KB
patch
obsolete
>From 3c818465e34d2240ed108d4d0f9267548fab248c Mon Sep 17 00:00:00 2001 >From: Doug Goldstein <cardoe@cardoe.com> >Date: Wed, 1 May 2013 11:03:12 -0500 >Subject: [PATCH] alsactl: sprintf to snprintf prevent buffer overflow > >sprintf() is a bit dangerous unless you explicitly know your type size >and want to keep it in sync always. Its safer to just use snprintf() and >ensure your string doesn't overflow and is NULL terminated. >--- > alsactl/lock.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/alsactl/lock.c b/alsactl/lock.c >index fce208b..587a109 100644 >--- a/alsactl/lock.c >+++ b/alsactl/lock.c >@@ -53,9 +53,9 @@ static int state_lock_(const char *file, int lock, int timeout) > lck.l_len = 11; > lck.l_pid = 0; > if (lock) { >- sprintf(lcktxt, "%10li\n", (long)getpid()); >+ snprintf(lcktxt, sizeof(lcktxt), "%10li\n", (long)getpid()); > } else { >- sprintf(lcktxt, "%10s\n", ""); >+ snprintf(lcktxt, sizeof(lcktxt), "%10s\n", ""); > } > while (fd < 0 && timeout-- > 0) { > fd = open(nfile, O_RDWR); >-- >1.8.2.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 468160
:
347050
| 347054