-
Type:
Improvement
-
Resolution: Won't Do
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Security
-
None
-
None
-
None
-
None
-
None
-
None
-
None
auth::addImplicitPrivilegesForRestrictedNamespaces() takes its output parameter as a pointer:
void addImplicitPrivilegesForRestrictedNamespaces(PrivilegeVector* privileges);
nullptr is not a valid input and the callee does not retain the reference after
returning, so this should be a mutable reference:
void addImplicitPrivilegesForRestrictedNamespaces(PrivilegeVector& privileges);
From https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs:
Parameters are either inputs to the function, outputs from the function, or both. Non-optional input parameters should usually be values or const references, while non-optional output and input/output parameters should usually be references (which cannot be null).