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.
This commit is contained in:
Joel Sherrill
2003-02-05 21:25:55 +00:00
parent f4f341bb9c
commit 9da12bdbb0
2 changed files with 10 additions and 4 deletions

View File

@@ -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

View File

@@ -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;
}