Skip to content

ExtractionExceptions is a non-thread-safe List<string> accessed from concurrent threads #152

Description

@imnasnainaec

ExtractionExceptions is declared as static List<string>. When ExtractStringsFromCode is called from concurrent threads, multiple threads may call AddRange on the same list simultaneously, causing data corruption.

Fix: Change ExtractionExceptions from List<string> to ConcurrentBag<string> and replace AddRange calls with individual Add calls.

Files affected: src/L10NSharp/XLiffUtils/XliffLocalizationManager.cs

(Part of #135.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions