From 9da12bdbb07a3b7804a5b4f5cf321449d6c5c458 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 5 Feb 2003 21:25:55 +0000 Subject: 2003-02-05 Thomas Doerfler PR 341/networking * lib/ftpfs.c: Account for NULL at end of strings when malloc()'ing memory. --- cpukit/libnetworking/ChangeLog | 6 ++++++ cpukit/libnetworking/lib/ftpfs.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'cpukit') 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 + + PR 341/networking + * lib/ftpfs.c: Account for NULL at end of strings when malloc()'ing + memory. + 2003-01-28 Joel Sherrill * 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; } -- cgit v1.2.3