{"record":{"id":"0630b21e7aceea12","repo":"Pumpkin-MC/Pumpkin","slug":"invalid-url","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"exception","errorClass":"TextureError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/net/authentication.rs","lineNumber":413,"sourceCode":"    #[error(\"Authentication servers are down\")]\n    FailedResponse,\n    #[error(\"Failed to verify username\")]\n    UnverifiedUsername,\n    #[error(\"You are banned from Authentication servers\")]\n    Banned,\n    #[error(\"Texture Error {0}\")]\n    TextureError(TextureError),\n    #[error(\"You have disallowed actions from Authentication servers\")]\n    DisallowedAction,\n    #[error(\"Failed to parse JSON into Game Profile\")]\n    FailedParse,\n    #[error(\"Unknown Status Code {0}\")]\n    UnknownStatusCode(StatusCode),\n}\n\n#[derive(Error, Debug)]\npub enum TextureError {\n    #[error(\"Invalid URL\")]\n    InvalidURL,\n    #[error(\"Invalid URL scheme for player texture: {0}\")]\n    DisallowedUrlScheme(String),\n    #[error(\"Invalid URL domain for player texture: {0}\")]\n    DisallowedUrlDomain(String),\n    #[error(\"Failed to decode base64 player texture: {0}\")]\n    DecodeError(String),\n    #[error(\"Failed to parse JSON from player texture: {0}\")]\n    JSONError(String),\n}\n\n#[cfg(test)]\nmod tests {\n    use super::ProfileTextures;\n\n    // Third-party auth servers (drasl, Blessing Skin, littleskin.cn) don't send\n    // `signatureRequired`. The profile must still parse. See issue #301.\n    #[test]","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/authentication.rs#L395-L431","documentation":"PacketError::MissingNullTerminator is raised when an RCON packet's string body is not terminated by the required NUL byte. The RCON protocol requires payload strings to be null-terminated; a missing terminator means the packet is malformed. The codec rejects the packet rather than reading past its bounds.","triggerScenarios":"Parsing a received RCON packet whose body lacks the trailing \\0; a peer implementation that forgets to null-terminate strings; a framing offset that makes the terminator land outside the parsed body.","commonSituations":"Interoperating with third-party/broken RCON clients or servers; off-by-one errors in custom packet builders; corrupted stream data shifting the body boundary.","solutions":["Fix the peer's packet builder to append a NUL byte after each string field.","Validate the last byte of the parsed body is 0 before converting to a string; reject otherwise.","Verify packet length calculations include the null terminator byte.","If parsing external captures, confirm the framing offset is correct so the terminator is within the body slice."],"exampleFix":"// before\nlet body = std::str::from_utf8(&payload)?; // no terminator check\n// after\nlet body_bytes = &payload[..payload.len().saturating_sub(1)];\nif payload.last() != Some(&0) {\n    return Err(PacketError::MissingNullTerminator);\n}\nlet body = std::str::from_utf8(body_bytes)?;","handlingStrategy":"validation","validationCode":"fn body_is_terminated(payload: &[u8]) -> bool {\n    payload.last() == Some(&0)\n}","typeGuard":"fn has_null_terminator(payload: &[u8]) -> bool {\n    !payload.is_empty() && *payload.last().unwrap() == 0\n}","tryCatchPattern":"match rcon_conn.read_packet().await {\n    Err(PacketError::MissingNullTerminator) => {\n        warn!(\"malformed RCON packet from peer (missing NUL)\");\n        // flag peer as non-conformant\n    }\n    Ok(p) => handle(p),\n    Err(e) => warn!(\"rcon error: {e}\"),\n}","preventionTips":["Always append a NUL byte after each string field when building RCON packets.","Include the terminator byte in the packet length calculation.","Validate the trailing byte before UTF-8 conversion of the body.","Test interop with third-party RCON implementations."],"tags":["rcon","protocol","packet-format","string-encoding"],"backgroundTag":"invalid-argument-format","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}