Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-22604

Potential use of unitialized variable in scriptlet execution

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • rhel-9.5
    • rhel-9.5
    • rpm
    • rpm-4.16.1.3-31.el9
    • None
    • Moderate
    • rhel-sst-cs-software-management
    • ssg_core_services
    • 20
    • 22
    • None
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • Release Note Not Required
    • All
    • None

      Findings from https://issues.redhat.com/browse/RHEL-22390:

      Error: UNINIT (CWE-457):
      rpm-4.16.1.3/lib/rpmscript.c:274: var_decl: Declaring variable "inpipe" without initializer.
      rpm-4.16.1.3/lib/rpmscript.c:398: uninit_use: Using uninitialized value "inpipe[0]".

      1. 396| fclose(in);
      2. 397|
      3. 398|-> if (inpipe[0])
      4. 399| close(inpipe[0]);
      5. 400|

       

      inpipe can be uninitialized in the case writing the to-be-executed scriptlet to the disk failed. Closing a random file descriptor could have weird effects of course.

              mdomonko@redhat.com Michal Domonkos
              rhn-support-pmatilai Panu Matilainen
              packaging-team-maint packaging-team-maint
              Tomas Bajer Tomas Bajer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: