Bug 178 - srd_decoder_load_all() segfaults without prior srd_init(). Use SRD_ERR_LIB_UNINITIALIZED?
Summary: srd_decoder_load_all() segfaults without prior srd_init(). Use SRD_ERR_LIB_UN...
Status: RESOLVED FIXED
Alias: None
Product: libsigrokdecode
Classification: Unclassified
Component: Other (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-18 00:01 CEST by Uwe Hermann
Modified: 2013-11-18 01:40 CET (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!