diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-04-11 19:08:59 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-04-11 19:08:59 +0530 |
commit | e7fa0e76fdd9af6ee0ca3e7c9cc29193944cedb4 (patch) | |
tree | 6cff1d81dfaaa4660ef5e6daa7cd219f0d6098ad /src | |
parent | bfdad0baf319da3d3f6fb88736ba0f6454cc93d8 (diff) |
libnpass/util: fix off by one error
Diffstat (limited to 'src')
-rw-r--r-- | src/libnpass/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libnpass/util.c b/src/libnpass/util.c index 04f2a37..182f117 100644 --- a/src/libnpass/util.c +++ b/src/libnpass/util.c @@ -15,9 +15,9 @@ int r_mkdir(const char *path, mode_t mode) int r; size_t len; char *p; - char tmp[NAME_MAX + 1]; + char tmp[NAME_MAX]; - strncpy(tmp, path, sizeof(tmp)); + strncpy(tmp, path, sizeof(tmp) - 1); len = strlen(tmp); if (tmp[len - 1] == '/') tmp[len - 1] = '\0'; |