Print this page
10138 smatch fixes for usr/src/cmd/sgs

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libelf/common/update.c
          +++ new/usr/src/cmd/sgs/libelf/common/update.c
↓ open down ↓ 21 lines elided ↑ open up ↑
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28   28   *      Copyright (c) 1988 AT&T
  29   29   *        All Rights Reserved
  30   30   */
  31   31  
       32 +/*
       33 + * Copyright (c) 2018, Joyent, Inc.
       34 + */
       35 +
  32   36  #include <memory.h>
  33   37  #include <malloc.h>
  34   38  #include <limits.h>
  35   39  
  36   40  #include <sgs.h>
  37   41  #include "decl.h"
  38   42  #include "msg.h"
  39   43  
  40   44  /*
  41   45   * This module is compiled twice, the second time having
↓ open down ↓ 694 lines elided ↑ open up ↑
 736  740   *      free the memory allocated.
 737  741   */
 738  742  
 739  743  off_t
 740  744  _elfxx_update(Elf * elf, Elf_Cmd cmd)
 741  745  {
 742  746          size_t          sz;
 743  747          unsigned        u;
 744  748          Ehdr            *eh = elf->ed_ehdr;
 745  749  
 746      -        if (elf == 0)
 747      -                return (-1);
 748      -
 749  750          ELFWLOCK(elf)
 750  751          switch (cmd) {
 751  752          default:
 752  753                  _elf_seterr(EREQ_UPDATE, 0);
 753  754                  ELFUNLOCK(elf)
 754  755                  return (-1);
 755  756  
 756  757          case ELF_C_WRIMAGE:
 757  758                  if ((elf->ed_myflags & EDF_WRITE) == 0) {
 758  759                          _elf_seterr(EREQ_UPDWRT, 0);
↓ open down ↓ 247 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX