Print this page
5763 missing va_end() on return from __fini_daemon_priv()

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/gen/privlib.c
          +++ new/usr/src/lib/libc/port/gen/privlib.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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 + * Copyright 2015 Gary Mills
  23   24   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24   25   */
  25   26  
  26   27  #pragma weak _getprivimplinfo   = getprivimplinfo
  27   28  #pragma weak _priv_addset       = priv_addset
  28   29  #pragma weak _priv_allocset     = priv_allocset
  29   30  #pragma weak _priv_copyset      = priv_copyset
  30   31  #pragma weak _priv_delset       = priv_delset
  31   32  #pragma weak _priv_emptyset     = priv_emptyset
  32   33  #pragma weak _priv_basicset     = priv_basicset
↓ open down ↓ 531 lines elided ↑ open up ↑
 564  565   * The routine __fini_daemon_priv() is private to Solaris and is
 565  566   * used by daemons to clear remaining unwanted privileges and
 566  567   * reenable core dumps.
 567  568   */
 568  569  void
 569  570  __fini_daemon_priv(const char *priv, ...)
 570  571  {
 571  572          priv_set_t *nset;
 572  573          va_list pa;
 573  574  
 574      -        va_start(pa, priv);
 575      -
 576  575          if (priv != NULL) {
      576 +
      577 +                va_start(pa, priv);
 577  578                  nset = priv_vlist(pa);
      579 +                va_end(pa);
      580 +
 578  581                  if (nset == NULL)
 579  582                          return;
 580  583  
 581  584                  (void) priv_addset(nset, priv);
 582  585                  (void) setppriv(PRIV_OFF, permitted, nset);
 583  586                  priv_freeset(nset);
 584  587          }
 585  588  
 586      -        va_end(pa);
 587      -
 588  589          (void) setpflags(__PROC_PROTECT, 0);
 589  590  }
 590  591  
 591  592  /*
 592  593   * The routine __init_suid_priv() is private to Solaris and is
 593  594   * used by set-uid root programs to limit the privileges acquired
 594  595   * to those actually needed.
 595  596   */
 596  597  
 597  598  static priv_set_t *bracketpriv;
↓ open down ↓ 430 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX