[xf86-video-intel,11/21] sna: Increase the size of the path name buffer a bit
diff mbox series

Message ID 20190919163113.17402-12-ville.syrjala@linux.intel.com
State New
Headers show
  • Compiler warn elimination
Related show

Commit Message

Ville Syrjälä Sept. 19, 2019, 4:31 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

../src/intel_device.c: In function ‘__intel_open_device__pci.isra.6’:
../src/intel_device.c:321:25: warning: ‘%s’ directive writing up to 255 bytes into a region of size 247 [-Wformat-overflow=]
   sprintf(path + base, "%s", de->d_name);

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
 src/intel_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/src/intel_device.c b/src/intel_device.c
index 219550731500..f28d3be11796 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -301,9 +301,9 @@  static int open_cloexec(const char *path)
 #ifdef __linux__
 static int __intel_open_device__major_minor(int _major, int _minor)
-	char path[256];
 	DIR *dir;
 	struct dirent *de;
+	char path[9+sizeof(de->d_name)];
 	int base, fd = -1;
 	base = sprintf(path, "/dev/dri/");