Print this page
10151 mv_xattrs() checks for a NULL array name

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libcmdutils/common/process_xattrs.c
          +++ new/usr/src/lib/libcmdutils/common/process_xattrs.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   * Copyright 2012 Milan Jurik. All rights reserved.
       26 + * Copyright (c) 2018, Joyent, Inc.
  26   27   */
  27   28  
  28   29  #include "libcmdutils.h"
  29   30  
  30   31  
  31   32  /*
  32   33   * Gets file descriptors of attribute directories for source and target
  33   34   * attribute files
  34   35   */
  35   36  int
↓ open down ↓ 119 lines elided ↑ open up ↑
 155  156                              "from source to target");
 156  157                          goto error;
 157  158                  }
 158  159  
 159  160                  errno = 0;
 160  161                  if (sattr) {
 161  162                          /*
 162  163                           * Gets non default extended system attributes from
 163  164                           * source to copy to target.
 164  165                           */
 165      -                        if (dp->d_name != NULL)
 166      -                                res = sysattr_list(cmd, sattrfd, dp->d_name);
      166 +                        res = sysattr_list(cmd, sattrfd, dp->d_name);
 167  167  
 168  168                          if (res != NULL &&
 169  169                              get_attrdirs(indfd, outdfd, dp->d_name, &asfd,
 170  170                              &atfd) != 0) {
 171  171                                  etext = dgettext(TEXT_DOMAIN,
 172  172                                      "Failed to open attribute files");
 173  173                                  goto error;
 174  174                          }
 175  175                          /*
 176  176                           * Copy extended system attribute from source
↓ open down ↓ 146 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX