RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   11-Apr-2016 11:12:34
  Branch: rpm-5_4                          Handle: 2016041109123300

  Modified files:           (Branch: rpm-5_4)
    rpm/rpmdb               header_internal.c package.c

  Log:
    - fix: avoid argv underruns;

  Summary:
    Revision    Changes     Path
    1.20.2.4    +1  -5      rpm/rpmdb/header_internal.c
    1.2.2.13    +1  -1      rpm/rpmdb/package.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header_internal.c
  ============================================================================
  $ cvs diff -u -r1.20.2.3 -r1.20.2.4 header_internal.c
  --- rpm/rpmdb/header_internal.c       10 Apr 2016 22:03:54 -0000      1.20.2.3
  +++ rpm/rpmdb/header_internal.c       11 Apr 2016 09:12:33 -0000      1.20.2.4
  @@ -1,4 +1,3 @@
  -/*@-sizeoftype@*/
   /** \ingroup header
    * \file rpmdb/header_internal.c
    */
  @@ -13,7 +12,6 @@
   /**
    * Alignment needs (and sizeof scalars types) for internal rpm data types.
    */
  -/*@observer@*/ /*@unchecked@*/
   int rpm_typeAlign[16] =  {
       1,       /*!< RPM_NULL_TYPE */
       1,       /*!< RPM_CHAR_TYPE */
  @@ -35,9 +33,7 @@
   
   int headerVerifyInfo(rpmuint32_t il, rpmuint32_t dl, const void * pev, void 
* iv, int negate)
   {
  -/*@-castexpose@*/
       entryInfo pe = (entryInfo) pev;
  -/*@=castexpose@*/
       entryInfo info = (entryInfo) iv;
       rpmuint32_t i;
       rpmTag ptag = 0;
  @@ -68,6 +64,7 @@
            info->offset = -info->offset;
   
        if (i > 0 && ptag > info->tag) {
  +         /* Heuristic to determine whether this or previous tag was fubar. */
            if (ptag > RPMTAG_FIRSTFREE_TAG) {
                i--;
                info->tag = (rpmTag) ntohl(pe[i].tag);
  @@ -108,4 +105,3 @@
       }
       return -1;
   }
  -/*@=sizeoftype@*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/package.c
  ============================================================================
  $ cvs diff -u -r1.2.2.12 -r1.2.2.13 package.c
  --- rpm/rpmdb/package.c       10 Apr 2016 22:03:54 -0000      1.2.2.12
  +++ rpm/rpmdb/package.c       11 Apr 2016 09:12:33 -0000      1.2.2.13
  @@ -243,7 +243,7 @@
       default:
        break;
       case RPM_STRING_ARRAY_TYPE:
  -     ix = he->c - 1; /* XXX FIXME: assumes last pubkey */
  +     ix = (he->c > 1 ? he->c - 1 : 0); /* XXX FIXME: assumes last pubkey */
        dig->pub = _free(dig->pub);
        dig->publen = 0;
        {   rpmiob iob = rpmiobNew(0);
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to