Skip to content

Commit 53dae83

Browse files
committed
src: fix --abort_on_uncaught_exception arg parsing
Fix c0bde73, which inadvertently introduced a use of strcmp() without correctly comparing its return to zero. Caught by coverity: >>> CID 169223: Integer handling issues (CONSTANT_EXPRESSION_RESULT) >>> The "or" condition "strcmp(arg, "--abort-on-uncaught-exception") || strcmp(arg, "--abort_on_uncaught_exception")" will always be true because "arg" cannot be equal to two different values at the same time, so it must be not equal to at least one of them. 3909 } else if (strcmp(arg, "--abort-on-uncaught-exception") || 3910 strcmp(arg, "--abort_on_uncaught_exception")) { 3911 abort_on_uncaught_exception = true; 3912 // Also a V8 option. Pass through as-is. 3913 new_v8_argv[new_v8_argc] = arg; 3914 new_v8_argc += 1; PR-URL: #13004 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 8035527 commit 53dae83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -3906,8 +3906,8 @@ static void ParseArgs(int* argc,
39063906
} else if (strcmp(arg, "--") == 0) {
39073907
index += 1;
39083908
break;
3909-
} else if (strcmp(arg, "--abort-on-uncaught-exception") ||
3910-
strcmp(arg, "--abort_on_uncaught_exception")) {
3909+
} else if (strcmp(arg, "--abort-on-uncaught-exception") == 0 ||
3910+
strcmp(arg, "--abort_on_uncaught_exception") == 0) {
39113911
abort_on_uncaught_exception = true;
39123912
// Also a V8 option. Pass through as-is.
39133913
new_v8_argv[new_v8_argc] = arg;

0 commit comments

Comments
 (0)