From 6c30d099dcb509d6c8fd883e8f3456eddb92fc8e Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Wed, 8 Jul 2020 16:09:33 +0000 Subject: [PATCH 1/3] Bug 1649314: Null-check before calling memcpy to avoid UBSan warnings. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D82728 --- src/util/libekr/r_data.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/libekr/r_data.c b/src/util/libekr/r_data.c index 7aed2f0..d94ff1c 100644 --- a/src/util/libekr/r_data.c +++ b/src/util/libekr/r_data.c @@ -97,7 +97,9 @@ int r_data_create(dp,d,l) if(!(d_->data=(UCHAR *)RMALLOC(l))) ABORT(R_NO_MEMORY); - memcpy(d_->data,d,l); + if (d) { + memcpy(d_->data,d,l); + } d_->len=l; *dp=d_; From 7498e80b7555cfa94825bf30664a2059ac9426da Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Thu, 30 Jul 2020 17:22:40 +0000 Subject: [PATCH 2/3] Bug 1656065: Init r_log_env_verbose only once. r=mjf Depends on D85295 Differential Revision: https://phabricator.services.mozilla.com/D85427 --- src/log/r_log.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/log/r_log.c b/src/log/r_log.c index febbb98..b50c42b 100644 --- a/src/log/r_log.c +++ b/src/log/r_log.c @@ -611,6 +611,17 @@ int _r_log_init(int use_reg) char *log; #endif + if(r_log_initted==0) { +#ifdef WIN32 + r_log_env_verbose=1; +#else + log=getenv("R_LOG_VERBOSE"); + if(log) + r_log_env_verbose=atoi(log); +#endif + + } + if(!use_reg){ if(r_log_initted Date: Tue, 30 Mar 2021 14:30:45 +0300 Subject: [PATCH 3/3] Bug 1683840 - Fix some array-parameter errors found by gcc 11 r=necko-reviewers,dragana I am aware they are third party code. pushing to keep a trace Differential Revision: https://phabricator.services.mozilla.com/D100323 --- src/registry/registry.c | 4 ++-- src/registry/registry_local.c | 4 ++-- src/registry/registrycb.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/registry/registry.c b/src/registry/registry.c index 430e804..ab013b6 100644 --- a/src/registry/registry.c +++ b/src/registry/registry.c @@ -209,14 +209,14 @@ NR_reg_fin(NR_registry name) } int -NR_reg_get_child_count(char *parent, unsigned int *count) +NR_reg_get_child_count(NR_registry parent, unsigned int *count) { assert(sizeof(count) == sizeof(size_t)); return reg_vtbl->vtbl->get_child_count(parent, (size_t*)count); } int -NR_reg_get_child_registry(char *parent, unsigned int i, NR_registry child) +NR_reg_get_child_registry(NR_registry parent, unsigned int i, NR_registry child) { int r, _status; size_t count; diff --git a/src/registry/registry_local.c b/src/registry/registry_local.c index a8ebc5b..d192077 100644 --- a/src/registry/registry_local.c +++ b/src/registry/registry_local.c @@ -165,7 +165,7 @@ typedef struct nr_reg_find_children_arg_ { size_t length; } nr_reg_find_children_arg; -static int nr_reg_local_iter(char *prefix, int (*action)(void *ptr, r_assoc_iterator *iter, char *prefix, char *name, nr_registry_node *node), void *ptr); +static int nr_reg_local_iter(NR_registry prefix, int (*action)(void *ptr, r_assoc_iterator *iter, char *prefix, char *name, nr_registry_node *node), void *ptr); static int nr_reg_local_iter_delete(void *ptr, r_assoc_iterator *iter, char *prefix, char *name, nr_registry_node *node); static int nr_reg_local_find_children(void *ptr, r_assoc_iterator *iter, char *prefix, char *name, nr_registry_node *node); static int nr_reg_local_count_children(void *ptr, r_assoc_iterator *iter, char *prefix, char *name, nr_registry_node *node); @@ -1041,7 +1041,7 @@ nr_reg_local_del(NR_registry name) } int -nr_reg_local_get_child_count(char *parent, size_t *count) +nr_reg_local_get_child_count(NR_registry parent, size_t *count) { int r, _status; nr_registry_node *ignore1; diff --git a/src/registry/registrycb.c b/src/registry/registrycb.c index 2fb785d..b6775fd 100644 --- a/src/registry/registrycb.c +++ b/src/registry/registrycb.c @@ -359,7 +359,7 @@ nr_reg_raise_event_recurse(char *name, char *tmp, int action) /* NON-STATIC METHODS */ int -nr_reg_raise_event(char *name, int action) +nr_reg_raise_event(NR_registry name, int action) { int r, _status; int count; @@ -417,7 +417,7 @@ NR_reg_register_callback(NR_registry name, char action, void (*cb)(void *cb_arg, } int -NR_reg_unregister_callback(char *name, char action, void (*cb)(void *cb_arg, char action, NR_registry name)) +NR_reg_unregister_callback(NR_registry name, char action, void (*cb)(void *cb_arg, char action, NR_registry name)) { int r, _status; size_t i;