Skip to content

Commit

Permalink
Merge commit '2999a940eaed666381ebd2b31fec9840b117ea78' into refix_GH…
Browse files Browse the repository at this point in the history
…-4432
  • Loading branch information
bmribler committed Oct 26, 2024
2 parents abbe91d + 2999a94 commit 55a3c2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/H5B.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,8 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8
*-------------------------------------------------------------------------
*/
static herr_t
H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, int exp_level, H5B_operator_t op, void *udata)
H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, int exp_level, H5B_operator_t op,
void *udata)
{
H5B_t *bt = NULL; /* Pointer to current B-tree node */
H5UC_t *rc_shared; /* Ref-counted shared info */
Expand Down Expand Up @@ -1086,7 +1087,7 @@ H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, int exp_lev
/* Iterate over node's children */
for (u = 0; u < bt->nchildren && ret_value == H5_ITER_CONT; u++) {
if (bt->level > 0)
ret_value = H5B__iterate_helper(f, type, bt->child[u], (int)bt->level-1, op, udata);
ret_value = H5B__iterate_helper(f, type, bt->child[u], (int)(bt->level - 1), op, udata);
else
ret_value = (*op)(f, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata);
if (ret_value < 0)
Expand Down
3 changes: 1 addition & 2 deletions src/H5Bcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ H5B__cache_deserialize(const void *_image, size_t len, void *_udata, bool H5_ATT
/* Check in case of level is corrupted, if expected level is known */
if (udata->exp_level != H5B_UNKNOWN_NODELEVEL)
if (bt->level != (unsigned)udata->exp_level)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL,
"level is not as expected, possibly corrupted");
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "level is not as expected, possibly corrupted");

/* Entries used */
if (H5_IS_BUFFER_OVERFLOW(image, 2, p_end))
Expand Down
2 changes: 1 addition & 1 deletion src/H5Bpkg.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
/* Indicates that the level of the current node is unknown. When the level
* is known, it can be used to detect corrupted level during decoding
*/
#define H5B_UNKNOWN_NODELEVEL (int)-1
#define H5B_UNKNOWN_NODELEVEL -1

/****************************/
/* Package Private Typedefs */
Expand Down

0 comments on commit 55a3c2c

Please sign in to comment.