{"record":{"id":"d2a32d385212fa2b","repo":"XTLS/Xray-core","slug":"total-padding-length-must-not-be-larger-than-65553","errorCode":null,"errorMessage":"total padding length must not be larger than 65553","messagePattern":"total padding length must not be larger than 65553","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/vless/encryption/common.go","lineNumber":254,"sourceCode":"\t\t}\n\t\tif y[1], err = strconv.Atoi(x[1]); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif y[2], err = strconv.Atoi(x[2]); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif i == 0 && (y[0] < 100 || y[1] < 18+17 || y[2] < 18+17) {\n\t\t\treturn errors.New(\"first padding length must not be smaller than 35\")\n\t\t}\n\t\tif i%2 == 0 {\n\t\t\t*paddingLens = append(*paddingLens, y)\n\t\t\tmaxLen += max(y[1], y[2])\n\t\t} else {\n\t\t\t*paddingGaps = append(*paddingGaps, y)\n\t\t}\n\t}\n\tif maxLen > 18+65535 {\n\t\treturn errors.New(\"total padding length must not be larger than 65553\")\n\t}\n\treturn\n}\n\nfunc CreatPadding(paddingLens, paddingGaps [][3]int) (length int, lens []int, gaps []time.Duration) {\n\tif len(paddingLens) == 0 {\n\t\tpaddingLens = [][3]int{{100, 111, 1111}, {50, 0, 3333}}\n\t\tpaddingGaps = [][3]int{{75, 0, 111}}\n\t}\n\tfor _, y := range paddingLens {\n\t\tl := 0\n\t\tif y[0] >= int(crypto.RandBetween(0, 100)) {\n\t\t\tl = int(crypto.RandBetween(int64(y[1]), int64(y[2])))\n\t\t}\n\t\tlens = append(lens, l)\n\t\tlength += l\n\t}\n\tfor _, y := range paddingGaps {","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/vless/encryption/common.go#L236-L272","documentation":"Error \"total padding length must not be larger than 65553\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/vless/encryption/common.go:254 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}