From: Todd C. Miller Date: Wed, 4 May 2016 22:48:02 +0000 (-0600) Subject: In parse_expr(), move the "bad" label after the "default" case in X-Git-Tag: SUDO_1_8_17^2~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf734419bfb37f88a463528706f0475a2e43a1e7;p=sudo 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. --- diff --git a/plugins/sudoers/sudoreplay.c b/plugins/sudoers/sudoreplay.c index d11f81606..ec5ca65a5 100644 --- a/plugins/sudoers/sudoreplay.c +++ b/plugins/sudoers/sudoreplay.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 Todd C. Miller + * Copyright (c) 2009-2016 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * 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; not = true; continue; - case 'c': /* command */ + case 'c': /* cwd or command */ if (av[0][1] == '\0') sudo_fatalx(U_("ambiguous expression \"%s\""), *av); 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) sudo_fatalx(U_("unmatched ')' in expression")); debug_return_int(av - argv + 1); - bad: default: + bad: sudo_fatalx(U_("unknown search term \"%s\""), *av); /* NOTREACHED */ }