diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/libnetworking/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/libnetworking/lib/ftpfs.c | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/cpukit/libnetworking/ChangeLog b/cpukit/libnetworking/ChangeLog index 925582ce58..038e1019a3 100644 --- a/cpukit/libnetworking/ChangeLog +++ b/cpukit/libnetworking/ChangeLog @@ -1,3 +1,9 @@ +2003-02-05 Thomas Doerfler <Thomas.Doerfler@imd-systems.de> + + PR 341/networking + * lib/ftpfs.c: Account for NULL at end of strings when malloc()'ing + memory. + 2003-01-28 Joel Sherrill <joel@OARcorp.com> * Makefile.am: Add kern/kern_sysctl.c to Makefile.am so networking diff --git a/cpukit/libnetworking/lib/ftpfs.c b/cpukit/libnetworking/lib/ftpfs.c index 19f8ef8bb9..28ec9422ae 100644 --- a/cpukit/libnetworking/lib/ftpfs.c +++ b/cpukit/libnetworking/lib/ftpfs.c @@ -348,7 +348,7 @@ int rtems_ftp_split_names } else { chunk_len = chunk_end-chunk_start; - *usernamep = malloc(chunk_len); + *usernamep = malloc(chunk_len+1); if (*usernamep == NULL) { rc = ENOMEM; } @@ -374,7 +374,7 @@ int rtems_ftp_split_names * this is the end of the password */ chunk_len = chunk_end-chunk_start; - *passwordp = malloc(chunk_len); + *passwordp = malloc(chunk_len+1); if (*passwordp == NULL) { rc = ENOMEM; } @@ -406,7 +406,7 @@ int rtems_ftp_split_names * we have found a proper '/' */ chunk_len = chunk_end-chunk_start; - *hostnamep = malloc(chunk_len); + *hostnamep = malloc(chunk_len+1); if (*hostnamep == NULL) { rc = ENOMEM; } @@ -439,7 +439,7 @@ int rtems_ftp_split_names } else { chunk_len = strlen(chunk_start); - *filenamep = malloc(chunk_len); + *filenamep = malloc(chunk_len+1); if (*filenamep == NULL) { rc = ENOMEM; } |