diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-10-07 23:23:33 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-07 23:23:33 +0200 |
commit | 362be13156c7185b6d479bf025f2be57f6c2d0ea (patch) | |
tree | 4e09a00ef89d19f55705f9cc01df265107910f98 /tests | |
parent | e17fcd70f9e6e5828386419d9a6346d34fa5a43f (diff) | |
download | libssh-362be13156c7185b6d479bf025f2be57f6c2d0ea.tar.gz libssh-362be13156c7185b6d479bf025f2be57f6c2d0ea.tar.xz libssh-362be13156c7185b6d479bf025f2be57f6c2d0ea.zip |
tests: Make sure the array is null terminated.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/client/torture_sftp_dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/client/torture_sftp_dir.c b/tests/client/torture_sftp_dir.c index b8dcb648..8d2bcda8 100644 --- a/tests/client/torture_sftp_dir.c +++ b/tests/client/torture_sftp_dir.c @@ -37,12 +37,12 @@ static void teardown(void **state) { static void torture_sftp_mkdir(void **state) { struct torture_sftp *t = *state; - char tmpdir[128]; + char tmpdir[128] = {0}; int rc; assert_false(t == NULL); - snprintf(tmpdir, sizeof(tmpdir), "%s/mkdir_test", t->testdir); + snprintf(tmpdir, sizeof(tmpdir) - 1, "%s/mkdir_test", t->testdir); rc = sftp_mkdir(t->sftp, tmpdir, 0755); if(rc != SSH_OK) |