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

Potential use of unitialized variable in scriptlet execution

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • rhel-10.0.beta
    • rhel-10.0.beta
    • rpm
    • rpm-4.19.1.1-3.el10
    • None
    • Moderate
    • rhel-sst-cs-software-management
    • ssg_core_services
    • 24
    • 26
    • 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:
              4 Start watching this issue

                Created:
                Updated: