gamemode icon indicating copy to clipboard operation
gamemode copied to clipboard

Does the script execution support work?

Open setharnold opened this issue 5 years ago • 2 comments

Hello, I'm giving gamemode a quick review as part of Ubuntu's Main Inclusion Process.

I'm concerned that this function may not work as intended:

https://github.com/FeralInteractive/gamemode/blob/master/daemon/gamemode-context.c#L1006

The callers are allocating a 8192 byte array, filling it with some number of scripts, and this function appears to step through the array one character a time for the first 32 characters, and execute ... something, until it either hits i > CONFIG_LIST_MAX or an ascii NUL.

If the script array has true in it, I think it'll execute true, then rue, then ue, then e, and then stop.

If I've read this correctly, this could be very surprising, and not at all desired.

Thanks

setharnold avatar Mar 06 '20 04:03 setharnold

The scripts list there is a 2d array, so it's iterating over each 1st dimension. Did you try it out and find an issue?

mdiluz avatar Mar 06 '20 07:03 mdiluz

I'm sorry for the slow response, thanks for the reply. I've forgotten that multidimensional arrays work across function boundaries if both functions use the same declaration.

Please close this issue, and thanks for the reply.

setharnold avatar Mar 13 '20 01:03 setharnold