Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix daemon exception if config key isn't present #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sqozz
Copy link

@sqozz sqozz commented Sep 3, 2020

Currently linphone-daemon crashes if you try to read a config key/value which isn't present because NULL is passed to the ConfigResponse constructor:

selenium usr/bin » ./linphone-daemon --pipe lpdaemon --config test-config & sleep 1 && (echo "config-get baz bar" | nc -U /tmp/lpdaemon)
[1] 10721
Server unix socket created, name=lpdaemon fd=3
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
[1]  + 10721 abort      ./linphone-daemon --pipe lpdaemon --config test-config

With my change applied, the command behaves like documented:

selenium usr/bin » ./linphone-daemon --pipe lpdaemon --config test-config & sleep 1 && (echo "config-get baz bar" | nc -U /tmp/lpdaemon)
[1] 4366
Server unix socket created, name=lpdaemon fd=3
Status: Ok

Value: <unset>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant