lib/glob: initialize back_str to silence uninitialized variable warning
back_str is only used when back_pat is non-NULL, and both are always set together, so it is safe in practice. Initialize back_str to NULL to make this safety invariant explicit and silence compiler/static analysis warnings. Link: https://lkml.kernel.org/r/20260312215249.50165-1-objecting@objecting.org Signed-off-by: Josh Law <objecting@objecting.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>master
parent
d1db411848
commit
c9ba82624b
|
|
@ -47,7 +47,7 @@ bool __pure glob_match(char const *pat, char const *str)
|
||||||
* (no exception for /), it can be easily proved that there's
|
* (no exception for /), it can be easily proved that there's
|
||||||
* never a need to backtrack multiple levels.
|
* never a need to backtrack multiple levels.
|
||||||
*/
|
*/
|
||||||
char const *back_pat = NULL, *back_str;
|
char const *back_pat = NULL, *back_str = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop over each token (character or class) in pat, matching
|
* Loop over each token (character or class) in pat, matching
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue