Bug 821397
| Summary: | when fault_occurred is set, fault_string is NULL in xmlrpc_env | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Nikola Pajkovsky <npajkovs> |
| Component: | xmlrpc-c | Assignee: | Enrico Scholz <rh-bugzilla> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 17 | CC: | dhoward, rh-bugzilla, vvitek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-05-21 08:47:56 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
I am not sure whether I understand you correctly, but I can not detect the mentioned "bug_id" literal in the posted piece of code.
Assuming, it's the new version where "bug_id" has been replaced by "id", then the
---
/* ---> at this point env.fault_occurred is false and env.fault_string
is unspecified */
bug = rhbz_get_member("id", item);
xmlrpc_DECREF(item);
if (!bug)
abrt_xmlrpc_die(&env);
---
part is probably wrong because when rhbz_get_member() fails (--> returns NULL) the &env variable stays unmodified.
Ah, you are right. |
I have a following code. It parses bug_id element from bugzilla response. What happened in recent time, redhat bugzilla 4.2 has dropped 'bug_id' element and now it's only 'id' element. void abrt_xmlrpc_die(xmlrpc_env *env) { error_msg_and_die("fatal: %s", env->fault_string); } /* die or return bug id; each bug must have bug id otherwise xml is corrupted */ int rhbz_bug_id(xmlrpc_value* xml) { func_entry(); xmlrpc_env env; xmlrpc_env_init(&env); xmlrpc_value *item = NULL; xmlrpc_value *bug = NULL; int bug_id = -1;; xmlrpc_array_read_item(&env, xml, 0, &item); if (env.fault_occurred) abrt_xmlrpc_die(&env); bug = rhbz_get_member("id", item); xmlrpc_DECREF(item); if (!bug) abrt_xmlrpc_die(&env); xmlrpc_read_int(&env, bug, &bug_id); xmlrpc_DECREF(bug); if (env.fault_occurred) abrt_xmlrpc_die(&env); VERB3 log("found bug_id %i", bug_id); return bug_id; } Version-Release number of selected component (if applicable): [npajkovs@f17-virt libreport]$ rpm -q xmlrpc-c xmlrpc-c-1.29.0-1701.svn2233.fc17.x86_64 Actual results: env->fault_string is set to NULL Expected results: env->fault_string is set to appropriate error msg