From 05d8a7f7a785eff3292f0f0537bb3902930f1b5c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 29 Oct 2011 11:08:17 -0700 Subject: Convert a bunch of sprintf to snprintf calls This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston --- hw/vfb/InitOutput.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/vfb/InitOutput.c') diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 121854781..3e5d05100 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -560,7 +560,8 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb) char dummyBuffer[DUMMY_BUFFER_SIZE]; int currentFileSize, writeThisTime; - sprintf(pvfb->mmap_file, "%s/Xvfb_screen%d", pfbdir, (int) (pvfb - vfbScreens)); + snprintf(pvfb->mmap_file, sizeof(pvfb->mmap_file), "%s/Xvfb_screen%d", + pfbdir, (int) (pvfb - vfbScreens)); if (-1 == (pvfb->mmap_fd = open(pvfb->mmap_file, O_CREAT|O_RDWR, 0666))) { perror("open"); -- cgit v1.2.3