diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2014-06-20 17:04:59 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-07-08 09:53:02 +0200 |
commit | 852722ecb5dc09fc80cd3c837edb1cf6db529210 (patch) | |
tree | 2501d5f8442f9db69e6f572225b27e8133750547 /src/providers/ipa/ipa_opts.h | |
parent | be8e3c2eb7619ae1b94fd8941e0f18c8969b2804 (diff) | |
download | sssd-852722ecb5dc09fc80cd3c837edb1cf6db529210.tar.gz sssd-852722ecb5dc09fc80cd3c837edb1cf6db529210.tar.xz sssd-852722ecb5dc09fc80cd3c837edb1cf6db529210.zip |
UTIL: Fix access out of bound in parse_args
While parsing string with multiple whitespaces, it may happen variable i is
zero and we want to test end of argument "tmp[i-1] != '\0'". Side effect of
this bug is duplicite string output array.
Input string: "foo b"
Expected output: { "foo", "a", NULL }
Output: { "foo", "foo", "a", NULL }
This patch uses inverted logic. Instead of testing whether to read next char or
skip multiple whitespaces, we will test whether we have new argument which
should be stored in output array.
Reviewed-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/providers/ipa/ipa_opts.h')
0 files changed, 0 insertions, 0 deletions