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

glibc: Address findings from machine code review of patch-git [rhel-10]

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • None
    • Low
    • rhel-pt-c-libs
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      The gemini-code-assist bug found a couple of real issues when the Lua script was imported here: https://github.com/konflux-ci/rpmbuild-pipeline-environment-container/pull/105

      Specifically, these findings are valid.

      Duplicate break

               if not l then break
                  -- No longer the commit message.
                  break
               end
      

      Duplicate patchgit_version check

            if patchgit_version
               and patchgit_version and release_known and changelog_known
            then
               start_commit = i
               break
            end
      

      Incorrect character class

         function git_date_to_rpm_date(s)
         local wd, mon, d, y = string.match(
            s, '^([A-z][a-z][a-z]) ([A-Z][a-z][a-z]) (%d+) %d%d:%d%d:%d%d (%d+)')
         assert(y, s)
         local m = assert(months[mon], s)
         local rpmdate = string.format('%s %s %02d %04d', wd, mon, d, y)
         local ymd = string.format('%04d-%02d-%02d', y, m, d)
         return rpmdate, ymd
         end
      

      [A-z] really should be [A-Z]. Indentation should be fixed as well.

      Incorrect variable reference

            local failure
            for _, cmd in ipairs(test_commands) do
               cmd = 'lua patch-git.lua ' .. cmd
               print('* ' .. cmd)
               local ok, term, status = os.execute(cmd)
               if not ok or term ~= 'exit' or status ~= 0 then
                  failure = true
                  print('FAIL: term=' .. term .. ', status=' .. status)
               end
            end
            if fail then
               os.exit(1)
            end
      

      Should be failure in the last if.

              glibc-bugzilla Platform Tools - Libraries Bot
              fweimer@redhat.com Florian Weimer
              Platform Tools - Libraries Bot Platform Tools - Libraries Bot
              Martin Coufal Martin Coufal
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: