Publish EventLens v1.1.0 (#1)
This commit was merged in pull request #1.
This commit is contained in:
1 parent
c0ade21029
commit
87432f3283
63 files changed
+7381
-1420
No files matched your search
@@ -52,7 +52,7 @@ def _fingerprint(stage: str, exc: BaseException) -> str:
|
||||
|
||||
|
||||
def parse_evtx_bytes(
|
||||
data: bytes,
|
||||
data: bytes | bytearray,
|
||||
max_events: int = MAX_EVENTS,
|
||||
max_seconds: float = MAX_PARSE_SECONDS,
|
||||
) -> ParseResult:
|
||||
@@ -113,9 +113,11 @@ def parse_evtx_bytes(
|
||||
raw_data = record["data"]
|
||||
if not isinstance(raw_data, str):
|
||||
raise TypeError("record data was not textual")
|
||||
if (
|
||||
len(raw_data) > MAX_RECORD_JSON_BYTES
|
||||
or len(raw_data.encode("utf-8")) > MAX_RECORD_JSON_BYTES
|
||||
# A str of n characters encodes to at most 4n UTF-8 bytes, so the
|
||||
# costly encode is only needed for records near the limit.
|
||||
if len(raw_data) > MAX_RECORD_JSON_BYTES or (
|
||||
len(raw_data) * 4 > MAX_RECORD_JSON_BYTES
|
||||
and len(raw_data.encode("utf-8")) > MAX_RECORD_JSON_BYTES
|
||||
):
|
||||
add_issue(
|
||||
"record_json_limit_exceeded",
|
||||
|
||||
Reference in new issue
Block a user