getsentry / getsentry/sentry-python

match_regex_list raises IndexError when a pattern list contains an empty string

オープン
#6,504 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Bug Python
主要言語
Python
スター
2.2k
フォーク
669
平均マージ
1日 40分
マージ済み PR(30日)
212

説明

`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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。