summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-02-05 21:25:55 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-02-05 21:25:55 +0000
commit9da12bdbb07a3b7804a5b4f5cf321449d6c5c458 (patch)
treeda5e0dfe9d237bac52fa27a053344e3567219f12 /cpukit
parent2003-02-05 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-9da12bdbb07a3b7804a5b4f5cf321449d6c5c458.tar.bz2
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.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libnetworking/ChangeLog6
-rw-r--r--cpukit/libnetworking/lib/ftpfs.c8
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;
}