feat(rate-limiting): Implement core rate limiting functionality with configuration, decision-making, metrics, middleware, and service registration
- Add RateLimitConfig for configuration management with YAML binding support. - Introduce RateLimitDecision to encapsulate the result of rate limit checks. - Implement RateLimitMetrics for OpenTelemetry metrics tracking. - Create RateLimitMiddleware for enforcing rate limits on incoming requests. - Develop RateLimitService to orchestrate instance and environment rate limit checks. - Add RateLimitServiceCollectionExtensions for dependency injection registration.
This commit is contained in:
18
datasets/reachability/ground-truth/basic/gt-0001/main.c
Normal file
18
datasets/reachability/ground-truth/basic/gt-0001/main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
// gt-0001: Direct call to vulnerable sink from main
|
||||
// Expected: REACHABLE (tier: executed)
|
||||
// Vulnerability: CWE-120 (Buffer Copy without Checking Size)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char buffer[32];
|
||||
|
||||
if (argc > 1) {
|
||||
// Vulnerable: strcpy without bounds checking
|
||||
strcpy(buffer, argv[1]); // SINK: CWE-120
|
||||
printf("Input: %s\n", buffer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user