Commit da2a148c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix off-by-one

parent 6d8f4537
...@@ -87,7 +87,7 @@ int vlc_module_set (module_t *module, int propid, void *value) ...@@ -87,7 +87,7 @@ int vlc_module_set (module_t *module, int propid, void *value)
{ {
unsigned i; unsigned i;
for (i = 0; module->pp_shortcuts[i] != NULL; i++); for (i = 0; module->pp_shortcuts[i] != NULL; i++);
if (i >= MODULE_SHORTCUT_MAX) if (i >= (MODULE_SHORTCUT_MAX - 1))
return VLC_ENOMEM; return VLC_ENOMEM;
module->pp_shortcuts[i] = (char *)value; module->pp_shortcuts[i] = (char *)value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment