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

pcre SAST finding: OVERRUN in pcre_printint.c file

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Undefined Undefined
    • rhel-9.5
    • rhel-9.5
    • pcre
    • pcre-8.44-4.el9
    • None
    • None
    • rhel-sst-cs-databases
    • 8
    • 12
    • 7
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None

      Here is the SAST report for this bug:

      Error: OVERRUN (CWE-119):
      pcre-8.44/pcre_printint.c:357: equality_cond: Jumping to case "OP_TABLE_LENGTH".
      pcre-8.44/pcre_printint.c:829: overrun-local: Overrunning array "priv_OP_lengths" of 162 bytes at byte offset 162 using index "*code" (which evaluates to 162).
      #  827|       }
      #  828|   
      #  829|->   code += priv_OP_lengths[*code] + extra;
      #  830|     fprintf(f, "\n");
      #  831|     }
      

      The patch for this bug contains the if condition which makes sure that if the case "OP_TABLE_LENGTH" is used, it won't access the "priv_OP_lengths" array at the 162 index and won't overrun it.

              ljavorsk Lukas Javorsky
              ljavorsk Lukas Javorsky
              Lukas Javorsky Lukas Javorsky
              Martin Kyral Martin Kyral
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: