mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
Fix use of strncpy, which is actually good to use memcpy.
* common/ssh-utils.c (get_fingerprint): Use memcpy. * g10/build-packet.c (string_to_notation): Use memcpy. -- Cherry-pick of master commit of: 625ced6e672daa892d334323cce6b3d42a6f929f Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
4b5cddeb58
commit
f0fdee2e24
@ -247,7 +247,7 @@ get_fingerprint (gcry_sexp_t key, int algo,
|
||||
goto leave;
|
||||
}
|
||||
|
||||
strncpy (*r_fpr, algo_name, strlen (algo_name));
|
||||
memcpy (*r_fpr, algo_name, strlen (algo_name));
|
||||
fpr = (char *) *r_fpr + strlen (algo_name);
|
||||
*fpr++ = ':';
|
||||
|
||||
|
@ -1266,7 +1266,7 @@ string_to_notation(const char *string,int is_utf8)
|
||||
}
|
||||
|
||||
notation->name=xmalloc((s-string)+1);
|
||||
strncpy(notation->name,string,s-string);
|
||||
memcpy(notation->name,string,s-string);
|
||||
notation->name[s-string]='\0';
|
||||
|
||||
if(!saw_at && !opt.expert)
|
||||
|
Loading…
x
Reference in New Issue
Block a user