Skip to content

Commit b8acc83

Browse files
committed
Remove loop that kept reading the same offset (Jan Kaluza)
1 parent 47f714d commit b8acc83

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Diff for: src/cdf.c

+6-14
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "file.h"
3636

3737
#ifndef lint
38-
FILE_RCSID("@(#)$File: cdf.c,v 1.55 2014/02/27 23:26:17 christos Exp $")
38+
FILE_RCSID("@(#)$File: cdf.c,v 1.56 2014/05/05 16:11:21 christos Exp $")
3939
#endif
4040

4141
#include <assert.h>
@@ -932,7 +932,7 @@ int
932932
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
933933
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
934934
{
935-
size_t i, maxcount;
935+
size_t maxcount;
936936
const cdf_summary_info_header_t *si =
937937
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
938938
const cdf_section_declaration_t *sd =
@@ -947,21 +947,13 @@ cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
947947
ssi->si_os = CDF_TOLE2(si->si_os);
948948
ssi->si_class = si->si_class;
949949
cdf_swap_class(&ssi->si_class);
950-
ssi->si_count = CDF_TOLE2(si->si_count);
950+
ssi->si_count = CDF_TOLE4(si->si_count);
951951
*count = 0;
952952
maxcount = 0;
953953
*info = NULL;
954-
for (i = 0; i < CDF_TOLE4(si->si_count); i++) {
955-
if (i >= CDF_LOOP_LIMIT) {
956-
DPRINTF(("Unpack summary info loop limit"));
957-
errno = EFTYPE;
958-
return -1;
959-
}
960-
if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset),
961-
info, count, &maxcount) == -1) {
962-
return -1;
963-
}
964-
}
954+
if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
955+
count, &maxcount) == -1)
956+
return -1;
965957
return 0;
966958
}
967959

0 commit comments

Comments
 (0)