WayfireWM/wcm

Crash in `plugin_enabled()`

ammen99 opened this issue · 8 comments

At main.cpp:81, plugins[pos - 1] is accessed, but pos can be 0 so this triggers a crash.

@ammen99 Is there a way to reproduce this?

I am not sure why it happens here. It didn't happen before, and now it crashes every time, even before I pulled latest changes.

@ammen99 But what action is crashing it? Just starting it?

Yes, this is a crash on start up.

Looking at the code, I think it is quite expected that pos can be 0. I think the reason why this started to crash is that I removed viewport_impl from my plugin list.

@ammen99 Can you show the output of wcm and the plugins line from your config file?

Presumably the first plugin loaded matched the first plugin in the list and this caused the crash. It didn't here for whatever reason but obviously needed this check. Thanks.

thanks for fixing this!