Changeset 002affc in rtems


Ignore:
Timestamp:
Feb 13, 2012, 3:40:54 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
8c85ca3
Parents:
e1ebfebf
git-author:
Sebastian Huber <sebastian.huber@…> (02/13/12 15:40:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/13/12 15:42:08)
Message:

Avoid NULL pointer access

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/shell/shell_getprompt.c

    re1ebfebf r002affc  
    3838)
    3939{
    40   char curdir[256];
     40  char buf[256];
     41  char *cwd;
    4142
    4243  /* XXX: show_prompt user adjustable */
    43   getcwd(curdir,sizeof(curdir));
     44  cwd = getcwd(buf,sizeof(buf));
     45  cwd = cwd != NULL ? cwd : "?";
    4446  snprintf(prompt, size - 1, "%s%s[%s] %c ",
    4547          ((shell_env->taskname) ? shell_env->taskname : ""),
    4648          ((shell_env->taskname) ? " " : ""),
    47           curdir,
     49          cwd,
    4850          geteuid()?'$':'#');
    4951}
Note: See TracChangeset for help on using the changeset viewer.