summaryrefslogtreecommitdiff
path: root/src/vpopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpopen.c')
-rw-r--r--src/vpopen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vpopen.c b/src/vpopen.c
index 777f168..8812dba 100644
--- a/src/vpopen.c
+++ b/src/vpopen.c
@@ -39,7 +39,7 @@
#define OPENFLAG_READ 0
-static char const rcsid[] = "$Id: vpopen.c,v 1.4 2002/07/28 15:40:07 broeker Exp $";
+static char const rcsid[] = "$Id: vpopen.c,v 1.5 2009/04/10 13:39:23 broeker Exp $";
int
vpopen(char *path, int oflag)
@@ -52,7 +52,7 @@ vpopen(char *path, int oflag)
oflag == OPENFLAG_READ) {
vpinit(NULL);
for (i = 1; i < vpndirs; i++) {
- (void) sprintf(buf, "%s/%s", vpdirs[i], path);
+ (void) snprintf(buf, sizeof(buf), "%s/%s", vpdirs[i], path);
if ((returncode = myopen(buf, oflag, 0666)) != -1) {
break;
}
l.org/r/20161018171513.734367391@infradead.org This patch uses the same trick with cmpxchg(). The only difference is that we want to handle only recursion from the same context and therefore we disable interrupts. In addition, KDB_STATE_PRINTF_LOCK is removed. In fact, we are not able to set it a non-racy way. Link: http://lkml.kernel.org/r/1480412276-16690-3-git-send-email-pmladek@suse.com Signed-off-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')