FDOS / freecom

FreeDOS Command Shell (command.com)
http://www.freedos.org/
GNU General Public License v2.0
158 stars 38 forks source link

Possible NULL pointer dereference in command.c:execute() #9

Closed ecm-pushbx closed 5 years ago

ecm-pushbx commented 6 years ago

https://github.com/FDOS/freecom/blob/291d040ff5c529e4d949a96b759f52b67f98e3f6/shell/command.c#L147

  /* search through %PATH% for the binary */
  errno = 0;
  fullname = find_which(first);
  dprintf(("[find_which(%s) returned %s]\n", first, fullname));

  if(!fullname) {
    error_bad_command(first);
    return;
  }

fullname is dereferenced here, but then expected to possibly be NULL.