File tree Expand file tree Collapse file tree 1 file changed +20
-17
lines changed
Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -220,23 +220,26 @@ title_index=($($scriptdir/inspectzim --title_index small.zim|tail -n +2))
220220title1_dirent_index=$( encode_uint32 $(( title_index[0 ])) )
221221title2_dirent_index=$( encode_uint32 $(( title_index[1 ])) )
222222
223- create_broken_zim_file invalid.outofbounds_first_title_entry.zim \
224- " $bad_article_index " \
225- $(( title_ptr_pos))
226-
227- create_broken_zim_file invalid.outofbounds_last_title_entry.zim \
228- " $bad_article_index " \
229- $(( title_ptr_pos+ 4 * (article_count- 1 )) )
230-
231- create_broken_zim_file invalid.outofbounds_titleptrpos.zim \
232- " $outofzimfile " \
233- 40
234-
235- create_broken_zim_file invalid.nonsorted_title_index.zim \
236- " $title2_dirent_index " \
237- $(( title_ptr_pos)) \
238- " $title1_dirent_index " \
239- $(( title_ptr_pos+ 4 ))
223+ if [[ $title_ptr_pos != 0 ]]
224+ then
225+ create_broken_zim_file invalid.outofbounds_first_title_entry.zim \
226+ " $bad_article_index " \
227+ $(( title_ptr_pos))
228+
229+ create_broken_zim_file invalid.outofbounds_last_title_entry.zim \
230+ " $bad_article_index " \
231+ $(( title_ptr_pos+ 4 * (article_count- 1 )) )
232+
233+ create_broken_zim_file invalid.outofbounds_titleptrpos.zim \
234+ " $outofzimfile " \
235+ 40
236+
237+ create_broken_zim_file invalid.nonsorted_title_index.zim \
238+ " $title2_dirent_index " \
239+ $(( title_ptr_pos)) \
240+ " $title1_dirent_index " \
241+ $(( title_ptr_pos+ 4 ))
242+ fi
240243
241244bad_mimetype_list=$( printf ' %-1968s' ' This is a bad mimetype value filling all the space between the header and the first cluster without any null character' )
242245create_broken_zim_file invalid.bad_mimetype_list.zim \
You can’t perform that action at this time.
0 commit comments