{"record":{"id":"7cb1d1edab2338f6","repo":"NationalSecurityAgency/ghidra","slug":"invalid-int-s-prefixes-0x-0b-and-0-octal-are","errorCode":null,"errorMessage":"Invalid int %s. Prefixes 0x, 0b, and 0 (octal) are allowed.","messagePattern":"Invalid int (.+?)\\. Prefixes 0x, 0b, and 0 \\(octal\\) are allowed\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/ScriptAttributesParser.java","lineNumber":189,"sourceCode":"\t\t\t@Override\n\t\t\tpublic String decode(String str) {\n\t\t\t\treturn str;\n\t\t\t}\n\t\t};\n\n\t\tpublic static final BaseType<BigInteger> INT = new BaseType<>() {\n\t\t\t@Override\n\t\t\tpublic Class<BigInteger> cls() {\n\t\t\t\treturn BigInteger.class;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic BigInteger decode(String str) {\n\t\t\t\ttry {\n\t\t\t\t\treturn NumericUtilities.decodeBigInteger(str);\n\t\t\t\t}\n\t\t\t\tcatch (NumberFormatException e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Invalid int %s. Prefixes 0x, 0b, and 0 (octal) are allowed.\"\n\t\t\t\t\t\t\t\t.formatted(str));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tpublic static final BaseType<Boolean> BOOL = new BaseType<>() {\n\t\t\t@Override\n\t\t\tpublic Class<Boolean> cls() {\n\t\t\t\treturn Boolean.class;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Boolean decode(String str) {\n\t\t\t\tBoolean result = switch (str.trim().toLowerCase()) {\n\t\t\t\t\tcase \"true\" -> true;\n\t\t\t\t\tcase \"false\" -> false;\n\t\t\t\t\tdefault -> null;","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/ScriptAttributesParser.java#L171-L207","documentation":"Thrown as IllegalArgumentException by the INT BaseType decoder when NumericUtilities.decodeBigInteger(str) raises NumberFormatException. The decoder accepts decimal, 0x-hex, 0b-binary, and 0-octal prefixes; anything else (floats, text, unrecognized prefixes) is rejected. This usually surfaces wrapped by error 353's ParseException at the call site.","triggerScenarios":"Declaring or supplying an int parameter value like '1.5', 'abc', '0xGHI', or an empty string. NumericUtilities.decodeBigInteger only accepts the documented prefix forms.","commonSituations":"A default value with a decimal point for an int parameter; a stray non-numeric character; using 'h' or other suffixes; an empty value where the script author assumed zero.","solutions":["Use a valid integer literal: decimal (123), hex (0x1F90), binary (0b1010), or octal (017).","Remove decimal points, suffixes, and non-numeric characters from the value.","If a default of zero is intended, write '0' explicitly rather than leaving it blank."],"exampleFix":"# before\n#@env COUNT:int=1.5   # throws 'Invalid int 1.5 ...'\n\n# after\n#@env COUNT:int=2","handlingStrategy":"validation","validationCode":"try { NumericUtilities.decodeBigInteger(str); }\ncatch (NumberFormatException e) { /* reject before declaring the parameter */ }","typeGuard":"boolean isValidInt(String s) {\n    try { NumericUtilities.decodeBigInteger(s); return true; }\n    catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":null,"preventionTips":["Use decimal, 0x, 0b, or 0-prefixed integer literals only.","Avoid decimals, suffixes, and whitespace in int parameter values.","Validate int defaults when authoring launcher scripts."],"tags":["config-parsing","int-validation","launcher-script","ghidra-debug"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}