Skip to content

Commit 508814e

Browse files
authored
Merge pull request #822 from bmribler/fix-GH-808
Fix invalid read error
2 parents c11b52c + b3b3965 commit 508814e

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

.github/workflows/hdfeos2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Install Autotools Dependencies (Linux)
1313
run: |
1414
sudo apt update
15-
sudo apt install automake autoconf libtool libtool-bin
15+
sudo apt install automake autoconf libtool libtool-bin libjpeg-dev
1616
sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen openssl libtool libtool-bin
1717
- name: Install HDF4
1818
run: |

hdf/src/hfiledd.c

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,31 +1825,19 @@ HTIcount_dd(filerec_t *file_rec, uint16 cnt_tag, uint16 cnt_ref, uintn *all_cnt,
18251825
for (idx = 0; idx < block->ndds; idx++, dd_ptr++)
18261826
if (dd_ptr->tag == cnt_tag && (dd_ptr->ref == cnt_ref || cnt_ref == DFREF_WILDCARD))
18271827
t_real_cnt++;
1828-
} /* end for */
1829-
} /* end if */
1828+
}
1829+
}
18301830
else {
18311831
if (cnt_ref == DFREF_WILDCARD) {
18321832
for (block = file_rec->ddhead; block != NULL; block = block->next) {
1833-
t_all_cnt += (uintn)block->ndds;
1833+
t_all_cnt += (unsigned)block->ndds;
18341834

1835-
idx = 0;
18361835
dd_ptr = block->ddlist;
1837-
if (block->ndds % 2 == 1)
1838-
if (dd_ptr->tag == cnt_tag || dd_ptr->tag == special_tag) {
1839-
t_real_cnt++;
1840-
idx++;
1841-
dd_ptr++;
1842-
} /* end if */
1843-
for (; idx < block->ndds; idx++, dd_ptr++) {
1844-
if (dd_ptr->tag == cnt_tag || dd_ptr->tag == special_tag)
1845-
t_real_cnt++;
1846-
idx++;
1847-
dd_ptr++;
1836+
for (idx = 0; idx < block->ndds; idx++, dd_ptr++)
18481837
if (dd_ptr->tag == cnt_tag || dd_ptr->tag == special_tag)
18491838
t_real_cnt++;
1850-
} /* end for */
1851-
} /* end for */
1852-
} /* end if */
1839+
}
1840+
}
18531841
else {
18541842
for (block = file_rec->ddhead; block != NULL; block = block->next) {
18551843
t_all_cnt += (uintn)block->ndds;
@@ -1859,9 +1847,9 @@ HTIcount_dd(filerec_t *file_rec, uint16 cnt_tag, uint16 cnt_ref, uintn *all_cnt,
18591847
if ((dd_ptr->tag == cnt_tag || dd_ptr->tag == special_tag) &&
18601848
dd_ptr->ref == cnt_ref)
18611849
t_real_cnt++;
1862-
} /* end for */
1863-
} /* end else */
1864-
} /* end else */
1850+
}
1851+
}
1852+
}
18651853
break;
18661854
} /* end switch */
18671855

0 commit comments

Comments
 (0)