# Buggy code
def _ParseKeyWithPlugin(self, parser_mediator, registry_key, plugin_object):
    """Parses the Registry key with a specific plugin.

    Args:
      parser_mediator: a parser mediator object (instance of ParserMediator).
      registry_key: a Registry key object (instance of
                    dfwinreg.WinRegistryKey).
      plugin_object: a Windows Registry plugin object (instance of
                     WindowsRegistryPlugin).
    """
    try:
        plugin_object.UpdateChainAndProcess(parser_mediator, registry_key)
    except (IOError, dfwinreg_errors.WinRegistryValueError) as exception:
        parser_mediator.ProduceParseError("{0:s}".format(exception))


# Traceback (WinRegistryValueError)
2015-11-27 16:57:21,504 [WARNING] (Worker_01 ) PID:10600 <worker> Unhandled exception while processing path spec: type: OS, location: /home/onager/code/plaso/test_data/SOFTWARE-RunTests
2015-11-27 16:57:21,504 [ERROR] (Worker_01 ) PID:10600 <worker> Unable to read data from value: lParam with error: pyregf_value_get_data_as_integer: unable to retrieve integer value. libregf_value_type_copy_to_32bit: invalid value data size value out of bounds. libregf_value_get_value_32bit: unable to set 32-bit value.
Traceback (most recent call last):
File "/home/onager/code/plaso/plaso/engine/worker.py", line 570, in _ProcessPathSpec
self._ProcessFileEntry(file_entry, data_stream_name=data_stream_name)
File "/home/onager/code/plaso/plaso/engine/worker.py", line 523, in _ProcessFileEntry
self._ProcessDataStream(file_entry, data_stream_name=data_stream_name)
File "/home/onager/code/plaso/plaso/engine/worker.py", line 464, in _ProcessDataStream
parser_object, file_entry, file_object=file_object)
File "/home/onager/code/plaso/plaso/engine/worker.py", line 261, in _ParseFileEntryWithParser
parser_object.Parse(self._parser_mediator, file_object)
File "/home/onager/code/plaso/plaso/parsers/interface.py", line 288, in Parse
self.ParseFileObject(parser_mediator, file_object, **kwargs)
File "/home/onager/code/plaso/plaso/parsers/winreg.py", line 119, in ParseFileObject
parser_mediator, registry_key)
File "/home/onager/code/plaso/plaso/parsers/winreg_plugins/interface.py", line 280, in UpdateChainAndProcess
self.Process(parser_mediator, registry_key, **kwargs)
File "/home/onager/code/plaso/plaso/parsers/winreg_plugins/interface.py", line 265, in Process
self.GetEntries(parser_mediator, registry_key, **kwargs)
File "/home/onager/code/plaso/plaso/parsers/winreg_plugins/default.py", line 50, in GetEntries
registry_value.data_type_string, registry_value.GetData())
File "/home/onager/code/plaso/plaso/dfwinreg/regf.py", line 175, in GetData
self._pyregf_value.name, exception))
WinRegistryValueError: Unable to read data from value: lParam with error: pyregf_value_get_data_as_integer: unable to retrieve integer value. libregf_value_type_copy_to_32bit: invalid value data size value out of bounds. libregf_value_get_value_32bit: unable to set 32-bit value.

# Fixed code
def _ParseKeyWithPlugin(self, parser_mediator, registry_key, plugin_object):
    """Parses the Registry key with a specific plugin.

    Args:
      parser_mediator: a parser mediator object (instance of ParserMediator).
      registry_key: a Registry key object (instance of
                    dfwinreg.WinRegistryKey).
      plugin_object: a Windows Registry plugin object (instance of
                     WindowsRegistryPlugin).
    """
    try:
        plugin_object.UpdateChainAndProcess(parser_mediator, registry_key)
    except (IOError, dfwinreg_errors.WinRegistryValueError) as exception:
        parser_mediator.ProduceParseError(
            "in key: {0:s} {1:s}".format(registry_key.path, exception)
        )