diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-10-20 23:15:40 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-10-21 09:27:41 +0200 |
commit | a0f8df427e9363fc787f189d6a3145e01a8e698c (patch) | |
tree | 494668d2b235cd65f6be751fb4dcd63d7c66d926 | |
parent | 05e67eeb3ddb08b5480c160db21430fafae37e37 (diff) |
Avoid -fsanitize=nullptr-with-offset
(new with recent Clang 10 trunk) during e.g. InstallModule_scp2/ooo:
> [SPP] scp2/source/ooo/common_brand
> soltools/cpp/_tokens.c:336:13: runtime error: applying zero offset to null pointer
> #0 in copytokenrow at soltools/cpp/_tokens.c:336:13
> #1 in expand at soltools/cpp/_macro.c:325:5
> #2 in expandrow at soltools/cpp/_macro.c:292:13
> #3 in process at soltools/cpp/_cpp.c:106:17
> #4 in main at soltools/cpp/_cpp.c:60:5
Change-Id: Icbe1c105fbd0ff634f3e2966c27af1b89398be13
Reviewed-on: https://gerrit.libreoffice.org/81187
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | soltools/cpp/_tokens.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c index c095ca6c6b9d..ff01657204db 100644 --- a/soltools/cpp/_tokens.c +++ b/soltools/cpp/_tokens.c @@ -333,7 +333,8 @@ Tokenrow * maketokenrow(len, dtr); movetokenrow(dtr, str); - dtr->lp += len; + if (len != 0) + dtr->lp += len; return dtr; } |