diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-04-12 17:52:52 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-04-12 17:52:52 +0000 |
commit | f9fa7e8def78cb2bf7d6329fb9d24df25c2292c5 (patch) | |
tree | 022aa2011498d82dd23bc92f8f3769557fa2fba0 /capinfos.c | |
parent | bbea8c7cf782f020e3f4115dc567a2f4a1fe4498 (diff) | |
download | wireshark-f9fa7e8def78cb2bf7d6329fb9d24df25c2292c5.tar.gz wireshark-f9fa7e8def78cb2bf7d6329fb9d24df25c2292c5.tar.bz2 wireshark-f9fa7e8def78cb2bf7d6329fb9d24df25c2292c5.zip |
Use g_snprintf instead of sprintf: Coverity 622.
Use g_strlcpy instead of strcpy: Coverity 632.
svn path=/trunk/; revision=36595
Diffstat (limited to 'capinfos.c')
-rw-r--r-- | capinfos.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/capinfos.c b/capinfos.c index a613ccaafc..6d6e90f4d0 100644 --- a/capinfos.c +++ b/capinfos.c @@ -803,7 +803,7 @@ hash_to_str(const unsigned char *hash, size_t length, char *str) { int i; for (i = 0; i < (int) length; i++) { - sprintf(str+(i*2), "%02x", hash[i]); + g_snprintf(str+(i*2), 3, "%02x", hash[i]); } } #endif /* HAVE_LIBGCRYPT */ @@ -1033,9 +1033,9 @@ main(int argc, char *argv[]) for (opt = optind; opt < argc; opt++) { #ifdef HAVE_LIBGCRYPT - strcpy(file_sha1, "<unknown>"); - strcpy(file_rmd160, "<unknown>"); - strcpy(file_md5, "<unknown>"); + g_strlcpy(file_sha1, "<unknown>", HASH_STR_SIZE); + g_strlcpy(file_rmd160, "<unknown>", HASH_STR_SIZE); + g_strlcpy(file_md5, "<unknown>", HASH_STR_SIZE); if (cap_file_hashes) { fh = ws_fopen(argv[opt], "rb"); |