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 e3d9501b31
commit 64fca8a7ed

View File

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