One function

WindowsRegistryValueSourceType in ForensicArtifacts/artifacts

The author described this change as Fix WinRAR artifacts, add better validation.. It counts as a record because the check below fails on the code as it stood at af7d33968 and passes on 2d25f97f9, with nothing else changed between the two runs.

Fix saved2017-05-13
Sharing licenceApache-2.0 · LICENSE
Change size+12 0

What the code was meant to do, written into the code itself as a docstring

Class that implements the Windows Registry value source type.

The change

1717 if not key_value_pairs:
1818 raise errors.FormatError(u'Missing key value pairs value.')
1919
20+ if not isinstance(key_value_pairs, list):
21+ raise errors.FormatError(u'key_value_pairs must be a list, got: %s' %
22+ key_value_pairs)
23+
24+ for pair in key_value_pairs:
25+ if not isinstance(pair, dict):
26+ raise errors.FormatError(u'key_value_pair must be a dict, got: %s' %
27+ key_value_pairs)
28+ if set(pair.keys()) != set(['key', 'value']):
29+ raise errors.FormatError(u'key_value_pair missing "key" and "value"'
30+ u' keys, got: %s' % key_value_pairs)
31+
2032 super(WindowsRegistryValueSourceType, self).__init__()
2133 self.key_value_pairs = key_value_pairs

The check that tells the two apart

failpass·artifacts/source_type_test.py::WindowsRegistryValueSourceTypeTest::testInitialize

Check file artifacts/source_type_test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itaf7d3396817fe18970d53bfe4ada6d81bb1b0402
Broken version dated2017-05-13
Moduleartifacts.source_type
Units changedWindowsRegistryValueSourceType
Fingerprintacaa7928e0cb7982
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.