Changeset 9da12bd in rtems for cpukit/libnetworking/lib/ftpfs.c


Ignore:
Timestamp:
Feb 5, 2003, 9:25:55 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
2a09fb6e
Parents:
f4f341b
Message:

2003-02-05 Thomas Doerfler <Thomas.Doerfler@…>

PR 341/networking

  • lib/ftpfs.c: Account for NULL at end of strings when malloc()'ing memory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/lib/ftpfs.c

    rf4f341b r9da12bd  
    349349    else {
    350350      chunk_len = chunk_end-chunk_start;
    351       *usernamep = malloc(chunk_len);
     351      *usernamep = malloc(chunk_len+1);
    352352      if (*usernamep == NULL) {
    353353        rc = ENOMEM;
     
    375375       */
    376376      chunk_len = chunk_end-chunk_start;
    377       *passwordp = malloc(chunk_len);
     377      *passwordp = malloc(chunk_len+1);
    378378      if (*passwordp == NULL) {
    379379        rc = ENOMEM;
     
    407407         */
    408408        chunk_len = chunk_end-chunk_start;
    409         *hostnamep = malloc(chunk_len);
     409        *hostnamep = malloc(chunk_len+1);
    410410        if (*hostnamep == NULL) {
    411411          rc = ENOMEM;
     
    440440    else {
    441441      chunk_len = strlen(chunk_start);
    442       *filenamep = malloc(chunk_len);
     442      *filenamep = malloc(chunk_len+1);
    443443      if (*filenamep == NULL) {
    444444        rc = ENOMEM;
Note: See TracChangeset for help on using the changeset viewer.