diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-10-20 14:47:11 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-10-20 14:47:11 +0200 |
commit | 98221f4e3640b2522851e49c7f81f5e500ed4a25 (patch) | |
tree | f1dc9608ec61cfb2d73a64580589b6746a04c198 /src/string.c | |
parent | 8e2699e16139c8efdc54a06471de29966ccc233a (diff) | |
download | libssh-98221f4e3640b2522851e49c7f81f5e500ed4a25.tar.gz libssh-98221f4e3640b2522851e49c7f81f5e500ed4a25.tar.xz libssh-98221f4e3640b2522851e49c7f81f5e500ed4a25.zip |
Fixed a bunch of smallish bugs
http://linuxtesting.org/upstream-tracker/test_results/libssh/current/test_results.html
for a whole list
Diffstat (limited to 'src/string.c')
-rw-r--r-- | src/string.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/string.c b/src/string.c index 06042aea..33920e68 100644 --- a/src/string.c +++ b/src/string.c @@ -131,8 +131,12 @@ size_t ssh_string_len(struct ssh_string_struct *s) { * string may not be readable with regular libc functions. */ char *ssh_string_to_char(struct ssh_string_struct *s) { - size_t len = ntohl(s->size) + 1; - char *new = malloc(len); + size_t len; + char *new; + if(s==NULL) + return NULL; + len = ntohl(s->size) + 1; + new = malloc(len); if (new == NULL) { return NULL; |