comparison buffer.c @ 1765:b688c884dad7

Fix fuzz-sshpacketmutator to work
author Matt Johnston <matt@ucc.asn.au>
date Mon, 26 Oct 2020 22:52:07 +0800
parents 064f5be2fc45
children 290caf301a4f
comparison
equal deleted inserted replaced
1764:a339b1c4b9f2 1765:b688c884dad7
186 /* like buf_getptr, but checks against total size, not used length. 186 /* like buf_getptr, but checks against total size, not used length.
187 * This allows writing past the used length, but not past the size */ 187 * This allows writing past the used length, but not past the size */
188 unsigned char* buf_getwriteptr(const buffer* buf, unsigned int len) { 188 unsigned char* buf_getwriteptr(const buffer* buf, unsigned int len) {
189 189
190 if (len > BUF_MAX_INCR || buf->pos + len > buf->size) { 190 if (len > BUF_MAX_INCR || buf->pos + len > buf->size) {
191 abort();
191 dropbear_exit("Bad buf_getwriteptr"); 192 dropbear_exit("Bad buf_getwriteptr");
192 } 193 }
193 return &buf->data[buf->pos]; 194 return &buf->data[buf->pos];
194 } 195 }
195 196