aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiers Daniell <pdaniell@nvidia.com>2015-04-03 17:44:52 -0600
committerPiers Daniell <pdaniell@nvidia.com>2015-04-03 17:44:52 -0600
commit2583bc02e0806d63eb3b764c8c40142978fe688a (patch)
tree709e21fcb11780f5a32bb376b88122e90128ed33
parentafc64faa59996b906a6672ab578814cce101e0ff (diff)
downloadusermoji-2583bc02e0806d63eb3b764c8c40142978fe688a.tar.xz
loader: Work correctly when there is no reg entry
Without this fix the loader will crash if there is no registry entry.
-rw-r--r--loader/loader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 47cfb364..6f7ce249 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -179,7 +179,9 @@ static char *loader_get_registry_and_env(const char *env_var,
registry_str = loader_get_registry_string(HKEY_LOCAL_MACHINE,
"Software\\XGL",
registry_value);
- registry_len = strlen(registry_str);
+ if (registry_str) {
+ registry_len = strlen(registry_str);
+ }
rtn_len = env_len + registry_len + 1;
if (rtn_len <= 2) {