From 0dd6f4d61154d310dcbc227a16897b9a98c078f5 Mon Sep 17 00:00:00 2001 From: Brian Bockelman Date: Mon, 20 Apr 2020 10:51:52 -0500 Subject: [PATCH] Initialize the XrdAccEntityInfo structure. When one vorg is provided and no groups are provided, the `grup` data memeber may be uninitialized on use. This has resulted in periodic segfaults on the SciTokens ACC provider; I'm guessing that `grup` quite often has an initial value of `nullptr`, even when uninitialized. I suspect this hasn't been observed for the VOMS provider because all VOMS server implementations create at least one group; hence this case is never hit. --- src/XrdAcc/XrdAccEntity.hh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/XrdAcc/XrdAccEntity.hh b/src/XrdAcc/XrdAccEntity.hh index 251b72287ed..f1c8dc136c9 100644 --- a/src/XrdAcc/XrdAccEntity.hh +++ b/src/XrdAcc/XrdAccEntity.hh @@ -42,7 +42,12 @@ struct XrdAccEntityInfo const char *vorg; const char *role; const char *grup; - XrdAccEntityInfo() {} + XrdAccEntityInfo() : + name(NULL), + host(NULL), + vorg(NULL), + role(NULL), + grup(NULL) {} ~XrdAccEntityInfo() {} }; @@ -91,7 +96,7 @@ struct EntityAttr {const char *vorg; const char *role; const char *grup; - EntityAttr() {} + EntityAttr() : vorg(NULL), role(NULL), grup(NULL) {} ~EntityAttr() {} };