[vlc-devel] [PATCH 1/2] actions: Fix MAXACTION value

Hugo Beauzée-Luyssen hugo at beauzee.fr
Fri Dec 11 10:24:21 CET 2020

On Thu, Dec 10, 2020, at 5:23 PM, Alexandre Janniaux wrote:
> Hi,
> Isn't it because "global-key-" is 11 characters but we add
> 12 in the next patch?

That guarantees that varname will have enough space to perform the copy, but sprintf might run past the last caracter since there's no room for the terminal null byte. There are other locations in this file where we use s_names2actions.psz directly

I suppose it doesn't blow off because there is padding between the psz and id fields, and since the variable is static, that padding will be initialized to 0

  Hugo Beauzée-Luyssen
  hugo at beauzee.fr

More information about the vlc-devel mailing list