1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

CVE-2012-4560: Fix a write one past the end of the 'u' buffer.

This commit is contained in:
Andreas Schneider
2012-10-05 11:37:09 +02:00
parent f61813eaea
commit 894bbf3137

View File

@@ -659,7 +659,7 @@ char *ssh_path_expand_tilde(const char *d) {
size_t s = p - d; size_t s = p - d;
char u[128]; char u[128];
if (s > sizeof(u)) { if (s >= sizeof(u)) {
return NULL; return NULL;
} }
memcpy(u, d, s); memcpy(u, d, s);