diff options
author | Toomas Soome <tsoome@me.com> | 2018-10-14 12:01:51 +0300 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-10-15 10:42:24 -0400 |
commit | e239895e13556da6878ec1eda7d795ea494fa359 (patch) | |
tree | bcb4b7cc5679a6ec8f0af0c55dda4f95bdc6569a | |
parent | a6d101109bfb442cf0db6d8ebb5fb7c32cb16d7e (diff) | |
download | illumos-joyent-e239895e13556da6878ec1eda7d795ea494fa359.tar.gz |
9896 libdemangle: error: variable 'result' might be clobbered by 'longjmp' or 'vfork'
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/lib/libdemangle/common/cxx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr/src/lib/libdemangle/common/cxx.c b/usr/src/lib/libdemangle/common/cxx.c index 66d7170544..e3b4c06a8a 100644 --- a/usr/src/lib/libdemangle/common/cxx.c +++ b/usr/src/lib/libdemangle/common/cxx.c @@ -210,11 +210,12 @@ cpp_demangle(const char *src, sysdem_ops_t *ops) if (nlen(&db) > 0) { str_t *s = TOP_L(&db); - result = zalloc(ops, s->str_len + 1); - if (result == NULL) + char *res = zalloc(ops, s->str_len + 1); + if (res == NULL) goto done; - (void) memcpy(result, s->str_s, s->str_len); + (void) memcpy(res, s->str_s, s->str_len); + result = res; } done: |