Title: #222: ipa_s2n_get_acct_info_send: provide correct req_input name
pbrezina commented:
"""
On 04/03/2017 12:41 PM, lslebodn wrote:
*@lslebodn* commented on this pull request.
------------------------------------------------------------------------
In src/providers/ipa/ipa_s2n_exop.c
<
https://github.com/SSSD/sssd/pull/222#discussion_r109386276>:
> + switch (req_input->type) {
+ case REQ_INP_NAME:
+ str = talloc_strdup(mem_ctx, req_input->inp.name);
+ break;
+ case REQ_INP_SECID:
+ str = talloc_strdup(mem_ctx, req_input->inp.secid);
+ break;
+ case REQ_INP_CERT:
+ str = talloc_strdup(mem_ctx, req_input->inp.cert);
+ break;
+ case REQ_INP_ID:
+ str = talloc_asprintf(mem_ctx, "%u", req_input->inp.id);
+ break;
+ }
+
+ if (str == NULL) {
This variable might be undefined if we add new value to |enum
req_input_type|.
Do you have an idea how to prevent such situation?
Compiler will complain if we add new enum value but not handle it in
this switch. But I initialized str to NULL so it doesn't complain about
uninitialized variable.
"""
See the full comment at