mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-06 14:05:32 +00:00
ICU-20171 Fix buffer overrun in genccode
This commit is contained in:
parent
db94f46377
commit
de6607c9cd
1 changed files with 1 additions and 6 deletions
|
@ -309,16 +309,11 @@ writeAssemblyCode(const char *filename, const char *destdir, const char *optEntr
|
|||
T_FileStream_writeLine(out, assemblyHeader[assemblyHeaderIndex].beginLine);
|
||||
|
||||
for(;;) {
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
length=T_FileStream_read(in, buffer, sizeof(buffer));
|
||||
if(length==0) {
|
||||
break;
|
||||
}
|
||||
if (length != sizeof(buffer)) {
|
||||
/* pad with extra 0's when at the end of the file */
|
||||
for(i=0; i < (length % sizeof(uint32_t)); ++i) {
|
||||
buffer[length+i] = 0;
|
||||
}
|
||||
}
|
||||
for(i=0; i<(length/sizeof(buffer[0])); i++) {
|
||||
column = write32(out, buffer[i], column);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue