@@ -138,4 +138,28 @@ TEST(PayloadInfotest, payload_info_non_SHA256_hash_type) {
138138 EXPECT_FALSE (libhoth_payload_info (image, statbuf.st_size , &info));
139139
140140 (void )munmap (image, statbuf.st_size );
141- }
141+ }
142+
143+ TEST (PayloadInfoTest, PayloadInfoFuzzRegression) {
144+ std::string data = std::string (
145+ " _IMGDSC_\035 _\t o\245\245 IM\007\001\000\000 GDS\360\360\360\360\360 C_"
146+ " \t o\245\245\267\267\342\342\342\342\342\342\342\267\267\267\267\267\267 "
147+ " \267\267\245\245\245\245\245\245\245\251\345\034 %"
148+ " \035\252\000\241\254\332\314\374\r\242\205\342\246\247\327 Z\241\364\000 "
149+ " \250\002\246\205\260 I\002\023\255\201\277\247\247\006 C\235\234\245\245 "
150+ " \245\245\245\245\245\245\245\245\245\245\200\200\200\000\300 ^"
151+ " \000\246\270\356\027\265\035\000\245\245\245\245\245\003\003\003\245\035 "
152+ " \035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035 "
153+ " \035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035 "
154+ " \035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035 "
155+ " \035\035\035\035\035\035\035\035\035\035\035\035\035\035\000\035\035\034 "
156+ " \035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035 "
157+ " \035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035 "
158+ " \035\035\035\035\035\035\035\035 ~~~~"
159+ " \035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035\035 "
160+ " \035\035\035\035\035\035\035 " ,
161+ 279 );
162+ struct payload_info info;
163+ EXPECT_FALSE (libhoth_payload_info (
164+ reinterpret_cast <const uint8_t *>(data.data ()), data.size (), &info));
165+ }
0 commit comments