Program: 172335
Project: 172335
Buggy source:
/** 
 * Build a list of file name or file information objects for the specified server path
 * @param path FTPPath
 * @param nameOnly boolean
 * @param hidden boolean
 * @return Vector<FileInfo>
 */
protected final Vector<FileInfo> listFilesForPath(FTPPath path,boolean nameOnly,boolean hidden){
  if (path == null)   return null;
  Vector<FileInfo> files=new Vector<FileInfo>();
  if (path.hasSharedDevice() == false) {
    SharedDeviceList shares=null;
    if (getClientInformation().isGuest())     shares=getDynamicShareList();
 else     getShareList();
    if (shares != null) {
      Enumeration<SharedDevice> enm=shares.enumerateShares();
      while (enm.hasMoreElements()) {
        SharedDevice shr=enm.nextElement();
        if (nameOnly == false) {
          FileInfo finfo=new FileInfo(shr.getName(),0L,FileAttribute.Directory);
          files.add(finfo);
        }
 else         files.add(new FileInfo(shr.getName(),0L,FileAttribute.Directory));
      }
    }
  }
 else {
    String searchPath=path.getSharePath();
    if (path.isDirectory())     searchPath=path.makeSharePathToFile("String_Node_Str");
    TreeConnection tree=new TreeConnection(path.getSharedDevice());
    DiskInterface disk=null;
    SearchContext ctx=null;
    int searchAttr=FileAttribute.Directory + FileAttribute.Normal;
    if (hidden)     searchAttr+=FileAttribute.Hidden;
    try {
      disk=(DiskInterface)path.getSharedDevice().getInterface();
      ctx=disk.startSearch(this,tree,searchPath,searchAttr);
    }
 catch (    Exception ex) {
    }
    if (ctx != null) {
      while (ctx.hasMoreFiles()) {
        if (nameOnly) {
          files.add(new FileInfo(ctx.nextFileName(),0L,0));
        }
 else {
          FileInfo finfo=new FileInfo();
          if (ctx.nextFileInfo(finfo) == false)           break;
          if (finfo.getFileName() != null)           files.add(finfo);
        }
      }
    }
  }
  return files;
}

Fixed version (ground truth):
/** 
 * Build a list of file name or file information objects for the specified server path
 * @param path FTPPath
 * @param nameOnly boolean
 * @param hidden boolean
 * @return Vector<FileInfo>
 */
protected final Vector<FileInfo> listFilesForPath(FTPPath path,boolean nameOnly,boolean hidden){
  if (path == null)   return null;
  Vector<FileInfo> files=new Vector<FileInfo>();
  if (path.hasSharedDevice() == false) {
    SharedDeviceList shares=null;
    if (getClientInformation().isGuest())     shares=getDynamicShareList();
 else     shares=getShareList();
    if (shares != null) {
      Enumeration<SharedDevice> enm=shares.enumerateShares();
      while (enm.hasMoreElements()) {
        SharedDevice shr=enm.nextElement();
        if (nameOnly == false) {
          FileInfo finfo=new FileInfo(shr.getName(),0L,FileAttribute.Directory);
          files.add(finfo);
        }
 else         files.add(new FileInfo(shr.getName(),0L,FileAttribute.Directory));
      }
    }
  }
 else {
    String searchPath=path.getSharePath();
    if (path.isDirectory())     searchPath=path.makeSharePathToFile("String_Node_Str");
    TreeConnection tree=new TreeConnection(path.getSharedDevice());
    DiskInterface disk=null;
    SearchContext ctx=null;
    int searchAttr=FileAttribute.Directory + FileAttribute.Normal;
    if (hidden)     searchAttr+=FileAttribute.Hidden;
    try {
      disk=(DiskInterface)path.getSharedDevice().getInterface();
      ctx=disk.startSearch(this,tree,searchPath,searchAttr);
    }
 catch (    Exception ex) {
    }
    if (ctx != null) {
      while (ctx.hasMoreFiles()) {
        if (nameOnly) {
          files.add(new FileInfo(ctx.nextFileName(),0L,0));
        }
 else {
          FileInfo finfo=new FileInfo();
          if (ctx.nextFileInfo(finfo) == false)           break;
          if (finfo.getFileName() != null)           files.add(finfo);
        }
      }
    }
  }
  return files;
}