[LU-6542] cYAML_build_error ignores NULL itm pointer on cYAML_create_object call Created: 29/Apr/15 Updated: 14/Mar/17 Resolved: 03/Aug/15 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.8.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Colin Ian King | Assignee: | Amir Shehata (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 15.04 |
||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
Static analysis picked up a potential issue in cYAML_build_error() in lnet/utils/cyaml/cyaml.c : /* look for the command */ else if (cmd_obj != NULL && cmd_obj->cy_type != CYAML_TYPE_ARRAY) err = cYAML_create_object(itm, entity); From what I can see, cYAML_create_seq_item() has the potential of returning NULL on the tm = cYAML_create_seq_item(cmd_obj) assignments. Later, the err = cYAML_create_object(itm, entity) statement could pass a NULL itm and this calls insert_item() and then cYAML_insert_child() with a NULL parent which silently ignores the NULL parent insert and the original caller gets to cYAML_create_object() has no error return informing it that the insert failed to be actioned. I think some kind of error handling on itm being NULL should be performed rather than silently ignore it. |
| Comments |
| Comment by Gerrit Updater [ 28/Jul/15 ] |
|
Amir Shehata (amir.shehata@intel.com) uploaded a new patch: http://review.whamcloud.com/15778 |
| Comment by Gerrit Updater [ 03/Aug/15 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15778/ |
| Comment by Peter Jones [ 03/Aug/15 ] |
|
Landed for 2.8 |