mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
fix(string): handle empty string case in ssh_string_copy
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Jakub Jelen
parent
ccb8cf88c8
commit
7a2a743a39
@@ -233,9 +233,6 @@ struct ssh_string_struct *ssh_string_copy(struct ssh_string_struct *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
len = ssh_string_len(s);
|
len = ssh_string_len(s);
|
||||||
if (len == 0) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
new = ssh_string_new(len);
|
new = ssh_string_new(len);
|
||||||
if (new == NULL) {
|
if (new == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user