This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Coverity: CID 1428443: Null pointer dereferences (NULL_RETURNS) /Python/hamt.c: 1058 in hamt_node_bitmap_without()
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: vstinner, yselivanov
Priority: normal Keywords:

Created on 2018-01-23 20:58 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg310522 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-01-23 20:58
Coverity found a bug in hamt.c:

** CID 1428443:  Null pointer dereferences  (NULL_RETURNS)
/Python/hamt.c: 1058 in hamt_node_bitmap_without()


________________________________________________________________________________________________________
*** CID 1428443:  Null pointer dereferences  (NULL_RETURNS)
/Python/hamt.c: 1058 in hamt_node_bitmap_without()
1052                         assert(hamt_node_collision_count(
1053                                 (PyHamtNode_Collision*)sub_node) > 1);
1054                     }
1055     #endif
1056
1057                     PyHamtNode_Bitmap *clone = hamt_node_bitmap_clone(self);
>>>     CID 1428443:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a null pointer "clone".
1058                     Py_SETREF(clone->b_array[val_idx],
1059                               (PyObject *)sub_node);  /* borrow */
1060
1061                     *new_node = (PyHamtNode *)clone;
1062                     return W_NEWNODE;
1063                 }
msg310524 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-23 21:26
Victor, it's been already fixed/tracked here: https://github.com/python/cpython/pull/5286

(I also receive coverity reports :)
msg310526 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-01-23 21:33
> (I also receive coverity reports :)

Oh, I didn't know. The current workflow is not ideal to avoid duplicated issues.
msg310527 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-23 21:47
> Oh, I didn't know. The current workflow is not ideal to avoid duplicated issues.

If I fix something that's been reported there I usually update the coverity issue directly.  But yeah...
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76820
2018-01-23 21:47:25yselivanovsetmessages: + msg310527
2018-01-23 21:33:35vstinnersetmessages: + msg310526
title: Coverity: CID 1428443: Null pointer dereferences (NULL_RETURNS) /Python/hamt.c: 1058 in hamt_node_bitmap_without() -> Coverity: CID 1428443: Null pointer dereferences (NULL_RETURNS) /Python/hamt.c: 1058 in hamt_node_bitmap_without()
2018-01-23 21:26:57yselivanovsetstatus: open -> closed
type: behavior
messages: + msg310524

resolution: out of date
stage: resolved
2018-01-23 20:58:35vstinnercreate