{"record":{"id":"06d266d3fba3553d","repo":"nodejs/node","slug":"0","errorCode":"0","errorMessage":"%s:%d: Internal error, line too long (greater than 1023 chars)\\n","messagePattern":"(.+?):(.+?): Internal error, line too long \\(greater than 1023 chars\\)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgtypes.c","lineNumber":87,"sourceCode":"        }\n        l = l->next;\n    }\n    return NULL;\n}\n\n\nconst char *pkg_writeCharList(FileStream *s, CharList *l, const char *delim, int32_t quote)\n{\n    char buffer[1024];\n    while(l != NULL)\n    {\n        if(l->str)\n        {\n            uprv_strncpy(buffer, l->str, 1023);\n            buffer[1023]=0;\n            if(uprv_strlen(l->str) >= 1023)\n            {\n                fprintf(stderr, \"%s:%d: Internal error, line too long (greater than 1023 chars)\\n\",\n                        __FILE__, __LINE__);\n                exit(0);\n            }\n            if(quote < 0) { /* remove quotes */\n                if(buffer[uprv_strlen(buffer)-1] == '\"') {\n                    buffer[uprv_strlen(buffer)-1] = '\\0';\n                }\n                if(buffer[0] == '\"') {\n                    uprv_strcpy(buffer, buffer+1);\n                }\n            } else if(quote > 0) { /* add quotes */\n                if(l->str[0] != '\"') {\n                    uprv_strcpy(buffer, \"\\\"\");\n                    uprv_strcat(buffer, l->str);\n                }\n                if(l->str[uprv_strlen(l->str)-1] != '\"') {\n                    uprv_strcat(buffer, \"\\\"\");\n                }","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgtypes.c#L69-L105","documentation":"In pkg_writeCharList (pkgtypes.c), a CharList string is being copied into a fixed 1024-byte buffer with uprv_strncpy(buffer,l->str,1023). If the string length is >= 1023 the function prints this internal error (with __FILE__ and __LINE__) and calls exit(0). Because exit code is 0, downstream tools may miss the failure — treat a 1024-char-plus list entry as a hard data defect.","triggerScenarios":"Any CharList entry written via pkg_writeCharList that is 1023 characters or longer: a very long filename, a path, or a data item name. The buffer is fixed at compile time so there is no dynamic fallback.","commonSituations":"A locale/resource path with an extreme number of translit or subtags; a generated file list with a single concatenated token; malformed data producing an oversized name.","solutions":["Identify which CharList entry exceeds 1023 chars and shorten it (rename/split the resource).","Regenerate the data file list so no single token is overlong.","Audit upstream genrb/gencnval output for abnormally long names.","Re-run with verbose output to find the offending entry before the abort."],"exampleFix":"// before: a single CharList token > 1023 chars\nwriteCharList emits a 2000-char path -> exit(0)\n\n// after: shorten/segment the resource name\n// keep each entry < 1023 chars, regenerate the list","handlingStrategy":"validation","validationCode":"// Reject any CharList entry that would overflow the 1023-byte write buffer.\n#include <string.h>\nbool allEntriesFit(const char *entries[], size_t n) {\n    for (size_t i = 0; i < n; ++i)\n        if (entries[i] && strlen(entries[i]) >= 1023) return false;\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep every CharList token under 1023 characters.","Rename/split overlong resource paths.","Regenerate file lists so no single token is huge.","Note the exit code is 0 — add your own length checks since tooling may not flag it."],"tags":["icu","pkgdata","pkgtypes","build-tool","input-validation","buffer-overflow"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}