fix-group-name-comparison.patch 956 B

123456789101112131415161718192021222324
  1. From: Александр Сомов <somov@yandex-team.ru>
  2. Date: Fri, 28 Apr 2017 13:18:37 +0000
  3. Subject: [PATCH] Fix Clang 3.9 build #35 Clang 3.9 uses the strict memcmp mode
  4. in the address sanitizer by default. Do not use memcmp to compare strings.
  5. DEVTOOLS-2459
  6. REVIEW: 269899
  7. git-svn-id: svn+ssh://arcadia.yandex.ru/arc/trunk/arcadia/contrib/libs/pcre@2895347 41d65440-b5be-11dd-afe3-b2e846d9b4f8
  8. This is compatible only with the 8-bit pcre build.
  9. This was fixed in pcre2 in a different way:
  10. https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_compile.c?annotate=185&pathrev=185#l7344
  11. --- a/pcre_compile.c
  12. +++ b/pcre_compile.c
  13. @@ -8978,5 +8978,5 @@ pcre_uchar *slot = cd->name_table;
  14. for (i = 0; i < cd->names_found; i++)
  15. {
  16. - int crc = memcmp(name, slot+IMM2_SIZE, IN_UCHARS(length));
  17. + int crc = strncmp(name, slot+IMM2_SIZE, IN_UCHARS(length));
  18. if (crc == 0 && slot[IMM2_SIZE+length] != 0)
  19. crc = -1; /* Current name is a substring */