Changeset 16be3a7 in rtems-libbsd


Ignore:
Timestamp:
03/17/23 04:10:04 (6 months ago)
Author:
Aaron Nyholm <aaron.nyholm@…>
Branches:
master
Children:
dfb2144
Parents:
1aa4cb8
git-author:
Aaron Nyholm <aaron.nyholm@…> (03/17/23 04:10:04)
git-committer:
Chris Johns <chrisj@…> (04/12/23 23:39:22)
Message:

rtemsbsd/rc_conf: Fixed non-nullterminated string causing crashes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsbsd/rtems/rtems-bsd-rc-conf.c

    r1aa4cb8 r16be3a7  
    870870    return r;
    871871
    872   rc_conf = malloc(sb.st_size);
     872  rc_conf = malloc(sb.st_size + 1);
    873873  if (rc_conf == NULL) {
    874874    errno = ENOMEM;
     
    892892
    893893  fclose(file);
     894
     895  rc_conf[sb.st_size] = '\0';
    894896
    895897  r = rtems_bsd_run_rc_conf_script(name, rc_conf, timeout, verbose);
Note: See TracChangeset for help on using the changeset viewer.