Issue found by coverity in icu-74.2: wrtxml.cpp

Description

Error: OVERRUN (CWE-119): icu/source/tools/genrb/wrtxml.cpp:190: buffer_alloc: Calling allocating function "uprv_malloc_74" which allocates "idLen" bytes. icu/source/tools/genrb/wrtxml.cpp:190: var_assign: Assigning: "localeID" = "uprv_malloc_74(idLen)". icu/source/tools/genrb/wrtxml.cpp:202: symbolic_assign: Tracking "pos" since "idLen" is tracked with "localeID". icu/source/tools/genrb/wrtxml.cpp:205: overrun-local: Overrunning dynamic array "localeID" at offset corresponding to index variable "pos". # 203| } # 204| uprv_memcpy(localeID, id, pos); # 205|-> localeID[pos]=0; /* NUL terminate the string */ # 206| # 207| canonCapacity =pos*3;

Activity

Show:

Mike FABIAN September 22, 2024 at 9:45 AM

I think the buffer is indeed one byte too short, the final 0 byte needs to fit.

Fixed

Details

Assignee

Reporter

Components

Priority

Fix versions

Created September 22, 2024 at 9:44 AM
Updated September 24, 2024 at 2:58 AM
Resolved September 24, 2024 at 2:58 AM