In parse_expr(), move the "bad" label after the "default" case in
the switch(), not before it. This seemed to confuse Covertity, resulting in a false positive, CID 104095.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2015 Todd C. Miller <Todd.Miller@courtesan.com>
|
* Copyright (c) 2009-2016 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -606,7 +606,7 @@ parse_expr(struct search_node_list *head, char *argv[], bool sub_expr)
|
|||||||
goto bad;
|
goto bad;
|
||||||
not = true;
|
not = true;
|
||||||
continue;
|
continue;
|
||||||
case 'c': /* command */
|
case 'c': /* cwd or command */
|
||||||
if (av[0][1] == '\0')
|
if (av[0][1] == '\0')
|
||||||
sudo_fatalx(U_("ambiguous expression \"%s\""), *av);
|
sudo_fatalx(U_("ambiguous expression \"%s\""), *av);
|
||||||
if (strncmp(*av, "cwd", strlen(*av)) == 0)
|
if (strncmp(*av, "cwd", strlen(*av)) == 0)
|
||||||
@@ -657,8 +657,8 @@ parse_expr(struct search_node_list *head, char *argv[], bool sub_expr)
|
|||||||
if (!sub_expr)
|
if (!sub_expr)
|
||||||
sudo_fatalx(U_("unmatched ')' in expression"));
|
sudo_fatalx(U_("unmatched ')' in expression"));
|
||||||
debug_return_int(av - argv + 1);
|
debug_return_int(av - argv + 1);
|
||||||
bad:
|
|
||||||
default:
|
default:
|
||||||
|
bad:
|
||||||
sudo_fatalx(U_("unknown search term \"%s\""), *av);
|
sudo_fatalx(U_("unknown search term \"%s\""), *av);
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user