getsentry / getsentry/sentry-python

match_regex_list raises IndexError when a pattern list contains an empty string

Đang mở
#6,504 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bug Python
Ngôn ngữ chính
Python
Star
2.2k
Fork
669
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
213

Mô tả

`sentry_sdk.utils.match_regex_list` iterates a user-supplied list of patterns and, with the default `substring_matching=False`, checks `item_matcher[-1] != "$"`. If any element is the empty string, `""[-1]` raises `IndexError: string index out of range`.

```python
from sentry_sdk.utils import match_regex_list
match_regex_list("anything", [""])
```

This is reachable from the Celery integration (`CeleryIntegration.exclude_beat_tasks` is passed to `match_regex_list` with the default mode), so an empty string in that user-configured list crashes instead of being handled.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.