projects
/
platform
/
upstream
/
cryptsetup.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some problems found by Coverity static analysis.
[platform/upstream/cryptsetup.git]
/
lib
/
utils_devpath.c
diff --git
a/lib/utils_devpath.c
b/lib/utils_devpath.c
index
f22f422
..
472569e
100644
(file)
--- a/
lib/utils_devpath.c
+++ b/
lib/utils_devpath.c
@@
-139,7
+139,7
@@
char *crypt_lookup_dev(const char *dev_id)
if (snprintf(path, sizeof(path), "/sys/dev/block/%s", dev_id) < 0)
return NULL;
if (snprintf(path, sizeof(path), "/sys/dev/block/%s", dev_id) < 0)
return NULL;
- len = readlink(path, link, sizeof(link));
+ len = readlink(path, link, sizeof(link)
- 1
);
if (len < 0) {
/* Without /sys use old scan */
if (stat("/sys/dev/block", &st) < 0)
if (len < 0) {
/* Without /sys use old scan */
if (stat("/sys/dev/block", &st) < 0)