mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 09:30:31 +01:00
utils: fix out-of-bound access for negative indexes in _NM_UTILS_STRING_LOOKUP_TABLE_DEFINE()
This commit is contained in:
parent
9c3187027c
commit
0ce83890bf
1 changed files with 1 additions and 1 deletions
|
|
@ -267,7 +267,7 @@ fcn_name (lookup_type idx) \
|
|||
static const char *const descs[] = { \
|
||||
__VA_ARGS__ \
|
||||
}; \
|
||||
if ((gssize) idx >= 0 && idx < G_N_ELEMENTS (descs)) \
|
||||
if ((gsize) idx < G_N_ELEMENTS (descs)) \
|
||||
return descs[idx]; \
|
||||
return unknown_val; \
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue