chiark / gitweb /
udev: collect - use snprintf()
authorRobert Milasan <rmilasan@suse.com>
Thu, 27 Sep 2012 13:51:58 +0000 (15:51 +0200)
committerKay Sievers <kay@vrfy.org>
Thu, 27 Sep 2012 13:51:58 +0000 (15:51 +0200)
src/udev/collect/collect.c

index feae4bb..3c46e40 100644 (file)
@@ -93,7 +93,7 @@ static int prepare(char *dir, char *filename)
         if (stat(dir, &statbuf) < 0)
                 mkdir(dir, 0700);
 
-        sprintf(buf, "%s/%s", dir, filename);
+        snprintf(buf, sizeof(buf), "%s/%s", dir, filename);
 
         fd = open(buf,O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
         if (fd < 0)