diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-10-08 21:42:17 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-12 14:45:36 +0200 |
commit | a660177a6e24527b97172d242a6e40f9c41fb6c1 (patch) | |
tree | c2535d7cd19499d4f2a14088a11c2d180f48179d | |
parent | 0a4ea19982900db1a7942c956c8c2f3ba80aedae (diff) | |
download | libssh-a660177a6e24527b97172d242a6e40f9c41fb6c1.tar.gz libssh-a660177a6e24527b97172d242a6e40f9c41fb6c1.tar.xz libssh-a660177a6e24527b97172d242a6e40f9c41fb6c1.zip |
misc: Use strncpy instead of strcat.
This is just hardening the code.
Found by Coverity.
-rw-r--r-- | src/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -777,7 +777,7 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) { return NULL; } l = strlen(buf); - strcat(buf + l, x); + strncpy(buf + l, x, sizeof(buf) - l - 1); buf[i] = '\0'; SAFE_FREE(x); } |