Compare commits

...

2 Commits

Author SHA1 Message Date
rcombs
e3cedfd973
Merge bab2e67113 into f2a4983df7 2024-11-13 18:08:39 +08:00
rcombs
bab2e67113
[cookies] Fix --cookies-from-browser=safari with unusual field order
These fields can be specified in any order. `DataParser` doesn't support skipping backwards, so I make a temporary copy for each.
2024-05-03 17:42:02 -07:00

View File

@ -678,14 +678,17 @@ def _parse_safari_cookies_record(data, jar, logger):
_creation_date = _mac_absolute_time_to_posix(p.read_double()) # noqa: F841 _creation_date = _mac_absolute_time_to_posix(p.read_double()) # noqa: F841
try: try:
p.skip_to(domain_offset) temp = DataParser(data, logger)
domain = p.read_cstring() temp.skip_to(domain_offset)
domain = temp.read_cstring()
p.skip_to(name_offset) temp = DataParser(data, logger)
name = p.read_cstring() temp.skip_to(name_offset)
name = temp.read_cstring()
p.skip_to(path_offset) temp = DataParser(data, logger)
path = p.read_cstring() temp.skip_to(path_offset)
path = temp.read_cstring()
p.skip_to(value_offset) p.skip_to(value_offset)
value = p.read_cstring() value = p.read_cstring()