This is an automated email from the ASF dual-hosted git repository. ardovm pushed a commit to branch AOO41X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 375644c8ee075fd50fc9ac38bee3c1e20eb89174 Author: Jim Jagielski <[email protected]> AuthorDate: Thu Dec 3 12:07:23 2020 -0500 Just copy over the smallest number of bytes. (cherry picked from commit 8ebeb3bfa02ed01d2f078b9da9cf4df3e7befbd8) --- main/soltools/mkdepend/parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/soltools/mkdepend/parse.c b/main/soltools/mkdepend/parse.c index 5f60f730bc..a5f8537ece 100644 --- a/main/soltools/mkdepend/parse.c +++ b/main/soltools/mkdepend/parse.c @@ -347,9 +347,10 @@ int deftype (line, filep, file_red, file, parse_it, symbols) * copy the definition back to the beginning of the line. */ { - int len = strlen(line); - memmove (line, p, len); - line[len] = '\0'; + int lenl = strlen(line); + int lenp = strlen(p); + memmove ( line, p, (lenl < lenp) ? lenl : lenp ); + line[ (lenl < lenp) ? lenl : lenp ] = '\0'; /* belts and braces */ } break; case ELSE:
