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

i3bar: null pointer dereference when encountering strings instead of objects in json protocol #3844

Open
Ferdi265 opened this issue Oct 22, 2019 · 2 comments

Comments

@Ferdi265
Copy link
Contributor

@Ferdi265 Ferdi265 commented Oct 22, 2019

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

i3bar crashes when encountering invalid input, such as when encountering a string instead of an object representing a block.

Core Dump: https://drive.google.com/open?id=1AbmEqk5rEXIsDYvd9U-yiA1dPibCnIpj

Expected Behavior

i3bar should not crash.

The invalid input should be reported as an error.

Alternatively, strings could be accepted and interpreted as plain text blocks. (swaybar does this)

Reproduction Instructions

use this i3 config and status command:
https://gist.github.com/Ferdi265/dc6c2ebbd5d21970df02caa7f5685827

Environment

Output of i3 --moreversion 2>&-:

Binary i3 version:  4.17.1 (2019-08-30) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.17.1 (2019-08-30) (pid 61803)
Loaded i3 config: /home/yrlf/.config/i3/config (Last modified: Tue 22 Oct 2019 22:00:39 CEST, 890 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
- Linux Distribution & Version: ArchLinux
- Are you using a compositor (e.g., xcompmgr or compton): No
@i3bot i3bot added the bug label Oct 22, 2019
@i3bot

This comment has been minimized.

Copy link

@i3bot i3bot commented Oct 22, 2019

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@Airblader

This comment has been minimized.

Copy link
Member

@Airblader Airblader commented Oct 22, 2019

Alternatively, strings could be accepted and interpreted as plain text blocks.

So does i3bar if you specify that you want that version of the protocol. It's essentially deprecated, though.

I agree that i3bar should not crash, though I think exiting with an error is acceptable. The status program should never generate invalid protocol messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.