The vulnerability lies in how pcre2test handles repeat values in subject lines. The process_data function in src/pcre2test.c is responsible for parsing these subject lines. The patch modifies a check within this function: if (i-- == 0) becomes if (i-- <= 0). This change explicitly addresses the case where i (derived from the input li) could be negative. Before the patch, a negative i would bypass the i-- == 0 check. The subsequent i-- operation in a loop could lead to an integer underflow, wrapping i to a very large positive number. This large number would then control the loop's iterations, potentially causing an infinite loop or excessive resource consumption, leading to a denial of service. Therefore, process_data is the vulnerable function as it processes the malicious input and contains the flawed logic. The surrounding code within the while ((c = *p++) != 0) loop in process_data parses the input that includes the repeat count. The specific vulnerable part is where li (a long int read from input) is cast to i (an int32_t) and then used in the repeat check. If li is a large negative number, i becomes negative. The original check i-- == 0 would not catch this, and i would continue to be decremented, eventually underflowing and becoming a large positive number, leading to the DoS.