Bug 178

Summary: srd_decoder_load_all() segfaults without prior srd_init(). Use SRD_ERR_LIB_UNINITIALIZED?
Product: libsigrokdecode Reporter: Uwe Hermann <uwe>
Component: OtherAssignee: Nobody <nobody>
Status: RESOLVED FIXED    
Severity: normal CC: bert
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Uwe Hermann 2013-10-18 00:01:01 CEST
Running srd_decoder_load_all() will segfault if srd_init() hasn't run beforehand.

This is documented in the API docs, though it would still be nice if the function returned SRD_ERR_LIB_UNINITIALIZED or such instead of segfaulting.

The same probably applies to various other API calls (they should SRD_ERR_LIB_UNINITIALIZED as needed).

This was exposed by the libsigrokdecode testsuite.
Comment 1 Bert Vermeulen 2013-11-18 01:40:43 CET
Fixed the bug AND the test!