projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d803ad5
)
[eglib] Handle dli.dli_sname being NULL in g_module_address (). (mono/mono#17592)
author
Zoltan Varga
<vargaz@gmail.com>
Tue, 29 Oct 2019 13:21:23 +0000
(09:21 -0400)
committer
GitHub
<noreply@github.com>
Tue, 29 Oct 2019 13:21:23 +0000
(09:21 -0400)
Should fix the warnings/assertions in g_strlcpy ().
Commit migrated from https://github.com/mono/mono/commit/
b0d966bd7ab887f075f6ce3d1c9858af6b52f30f
src/mono/mono/eglib/gmodule-unix.c
patch
|
blob
|
history
diff --git
a/src/mono/mono/eglib/gmodule-unix.c
b/src/mono/mono/eglib/gmodule-unix.c
index
1e1d15f
..
3f60af2
100644
(file)
--- a/
src/mono/mono/eglib/gmodule-unix.c
+++ b/
src/mono/mono/eglib/gmodule-unix.c
@@
-98,8
+98,12
@@
g_module_address (void *addr, char *file_name, size_t file_name_len,
g_strlcpy(file_name, dli.dli_fname, file_name_len);
if (file_base != NULL)
*file_base = dli.dli_fbase;
- if (sym_name != NULL && sym_name_len >= 1)
- g_strlcpy(sym_name, dli.dli_sname, sym_name_len);
+ if (sym_name != NULL && sym_name_len >= 1) {
+ if (dli.dli_sname)
+ g_strlcpy (sym_name, dli.dli_sname, sym_name_len);
+ else
+ sym_name [0] = '\0';
+ }
if (sym_addr != NULL)
*sym_addr = dli.dli_saddr;
return TRUE;