Mercurial > dropbear
comparison fuzz-common.c @ 1559:92c93b4a3646 fuzz
Fix to be able to compile normal(ish) binaries with --enable-fuzz
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 28 Feb 2018 22:02:12 +0800 |
parents | 2f64cb3d3007 |
children | 35af85194268 |
comparison
equal
deleted
inserted
replaced
1558:2f64cb3d3007 | 1559:92c93b4a3646 |
---|---|
152 | 152 |
153 if (fuzz_set_input(Data, Size) == DROPBEAR_FAILURE) { | 153 if (fuzz_set_input(Data, Size) == DROPBEAR_FAILURE) { |
154 return 0; | 154 return 0; |
155 } | 155 } |
156 | 156 |
157 // get prefix. input format is | 157 /* |
158 // string prefix | 158 get prefix. input format is |
159 // uint32 wrapfd seed | 159 string prefix |
160 // ... to be extended later | 160 uint32 wrapfd seed |
161 // [bytes] ssh input stream | 161 ... to be extended later |
162 [bytes] ssh input stream | |
163 */ | |
162 | 164 |
163 // be careful to avoid triggering buffer.c assertions | 165 /* be careful to avoid triggering buffer.c assertions */ |
164 if (fuzz.input->len < 8) { | 166 if (fuzz.input->len < 8) { |
165 return 0; | 167 return 0; |
166 } | 168 } |
167 size_t prefix_size = buf_getint(fuzz.input); | 169 size_t prefix_size = buf_getint(fuzz.input); |
168 if (prefix_size != 4) { | 170 if (prefix_size != 4) { |
179 svr_session(fakesock, fakesock); | 181 svr_session(fakesock, fakesock); |
180 m_malloc_free_epoch(1, 0); | 182 m_malloc_free_epoch(1, 0); |
181 } else { | 183 } else { |
182 m_malloc_free_epoch(1, 1); | 184 m_malloc_free_epoch(1, 1); |
183 TRACE(("dropbear_exit longjmped")) | 185 TRACE(("dropbear_exit longjmped")) |
184 // dropbear_exit jumped here | 186 /* dropbear_exit jumped here */ |
185 } | 187 } |
186 | 188 |
187 return 0; | 189 return 0; |
188 } | 190 } |