summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-26 12:44:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-26 12:46:50 +0100
commit016599783cf3e1a3e2362c82c8767a7398048db7 (patch)
tree27d06bc09427feac6ae28bc62bc688ac459ad7a0
parente827f80e5c07ac13802a24753b249e05e18a290e (diff)
intel: Limit read to always fit in the buffer
Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Suggested-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel_device.c b/src/intel_device.c
index 3924c8fb..9a2ebb0c 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -367,7 +367,7 @@ static int __intel_open_device__pci(const struct pci_device *pci)
if (fd == -1)
break;
- base = read(fd, path, 256);
+ base = read(fd, path, sizeof(path) - 1);
close(fd);
fd = -1;