View Issue Details

IDProjectCategoryView StatusLast Update
0000527AlmaLinux-8libxsltpublic2025-06-26 10:32
Reportercloph Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Summary0000527: libxslt-devel-1.1.32-6.2.el8_10 breaks include guards / causes miscompilation due to misplaced #endif in header.
Descriptionhttps://git.almalinux.org/rpms/libxslt/src/branch/c8/SOURCES/libxslt-1.1.32-CVE-2023-40403.patch#L255 contains a bogus change to libxslt/xsltutils.h

It moves a #endif of the #ifdef __cplusplus up, having it act as the ending endif of the include-guard, and turning the to-be-meant endif of the include guard to the endif of the cplusplus block. While that prevents a compiler error, this obviously breaks the include guard and the build breaks if the header is included twice.
Steps To Reproduce$ cat foo.c
#include "libxslt/xsltutils.h"
#include "libxslt/xsltutils.h"

int main() {
    return 0;
}
$ gcc -I/usr/include/libxml2 foo.c
In file included from foo.c:2:
/usr/include/libxslt/xsltutils.h:292:5: error: redeclaration of enumerator ‘XSLT_DEBUG_NONE’
  292 | XSLT_DEBUG_NONE = 0, /* no debugging allowed */
      | ^~~~~~~~~~~~~~~
In file included from foo.c:1:
/usr/include/libxslt/xsltutils.h:292:5: note: previous definition of ‘XSLT_DEBUG_NONE’ with type ‘enum <anonymous>’
  292 | XSLT_DEBUG_NONE = 0, /* no debugging allowed */
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:293:5: error: redeclaration of enumerator ‘XSLT_DEBUG_INIT’
  293 | XSLT_DEBUG_INIT,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:293:5: note: previous definition of ‘XSLT_DEBUG_INIT’ with type ‘enum <anonymous>’
  293 | XSLT_DEBUG_INIT,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:294:5: error: redeclaration of enumerator ‘XSLT_DEBUG_STEP’
  294 | XSLT_DEBUG_STEP,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:294:5: note: previous definition of ‘XSLT_DEBUG_STEP’ with type ‘enum <anonymous>’
  294 | XSLT_DEBUG_STEP,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:295:5: error: redeclaration of enumerator ‘XSLT_DEBUG_STEPOUT’
  295 | XSLT_DEBUG_STEPOUT,
      | ^~~~~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:295:5: note: previous definition of ‘XSLT_DEBUG_STEPOUT’ with type ‘enum <anonymous>’
  295 | XSLT_DEBUG_STEPOUT,
      | ^~~~~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:296:5: error: redeclaration of enumerator ‘XSLT_DEBUG_NEXT’ [1/5500]
  296 | XSLT_DEBUG_NEXT,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:296:5: note: previous definition of ‘XSLT_DEBUG_NEXT’ with type ‘enum <anonymous>’
  296 | XSLT_DEBUG_NEXT,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:297:5: error: redeclaration of enumerator ‘XSLT_DEBUG_STOP’
  297 | XSLT_DEBUG_STOP,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:297:5: note: previous definition of ‘XSLT_DEBUG_STOP’ with type ‘enum <anonymous>’
  297 | XSLT_DEBUG_STOP,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:298:5: error: redeclaration of enumerator ‘XSLT_DEBUG_CONT’
  298 | XSLT_DEBUG_CONT,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:298:5: note: previous definition of ‘XSLT_DEBUG_CONT’ with type ‘enum <anonymous>’
  298 | XSLT_DEBUG_CONT,
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:299:5: error: redeclaration of enumerator ‘XSLT_DEBUG_RUN’
  299 | XSLT_DEBUG_RUN,
      | ^~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:299:5: note: previous definition of ‘XSLT_DEBUG_RUN’ with type ‘enum <anonymous>’
  299 | XSLT_DEBUG_RUN,
      | ^~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:300:5: error: redeclaration of enumerator ‘XSLT_DEBUG_RUN_RESTART’
  300 | XSLT_DEBUG_RUN_RESTART,
      | ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:300:5: note: previous definition of ‘XSLT_DEBUG_RUN_RESTART’ with type ‘enum <anonymous>’
  300 | XSLT_DEBUG_RUN_RESTART,
      | ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:301:5: error: redeclaration of enumerator ‘XSLT_DEBUG_QUIT’
  301 | XSLT_DEBUG_QUIT
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:301:5: note: previous definition of ‘XSLT_DEBUG_QUIT’ with type ‘enum <anonymous>’
  301 | XSLT_DEBUG_QUIT
      | ^~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:302:3: error: conflicting types for ‘xsltDebugStatusCodes’; have ‘enum <anonymous>’
  302 | } xsltDebugStatusCodes;
      | ^~~~~~~~~~~~~~~~~~~~
/usr/include/libxslt/xsltutils.h:302:3: note: previous declaration of ‘xsltDebugStatusCodes’ with type ‘xsltDebugStatusCodes’
  302 | } xsltDebugStatusCodes;
      | ^~~~~~~~~~~~~~~~~~~~
$
Additional Informationrestoring the original placement of the #endif fixes the problem.
TagsNo tags attached.
abrt_hash
URL

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2025-06-26 10:32 cloph New Issue