summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sshbuf-misc.c7
-rw-r--r--sshbuf.h6
2 files changed, 6 insertions, 7 deletions
diff --git a/sshbuf-misc.c b/sshbuf-misc.c
index 417ab593e..65987e251 100644
--- a/sshbuf-misc.c
+++ b/sshbuf-misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshbuf-misc.c,v 1.10 2019/07/18 13:26:00 djm Exp $ */ 1/* $OpenBSD: sshbuf-misc.c,v 1.11 2019/07/30 05:04:49 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller 3 * Copyright (c) 2011 Damien Miller
4 * 4 *
@@ -195,7 +195,7 @@ sshbuf_dup_string(struct sshbuf *buf)
195 195
196int 196int
197sshbuf_cmp(const struct sshbuf *b, size_t offset, 197sshbuf_cmp(const struct sshbuf *b, size_t offset,
198 const u_char *s, size_t len) 198 const void *s, size_t len)
199{ 199{
200 if (sshbuf_ptr(b) == NULL) 200 if (sshbuf_ptr(b) == NULL)
201 return SSH_ERR_INTERNAL_ERROR; 201 return SSH_ERR_INTERNAL_ERROR;
@@ -210,13 +210,12 @@ sshbuf_cmp(const struct sshbuf *b, size_t offset,
210 210
211int 211int
212sshbuf_find(const struct sshbuf *b, size_t start_offset, 212sshbuf_find(const struct sshbuf *b, size_t start_offset,
213 const u_char *s, size_t len, size_t *offsetp) 213 const void *s, size_t len, size_t *offsetp)
214{ 214{
215 void *p; 215 void *p;
216 216
217 if (offsetp != NULL) 217 if (offsetp != NULL)
218 *offsetp = 0; 218 *offsetp = 0;
219
220 if (sshbuf_ptr(b) == NULL) 219 if (sshbuf_ptr(b) == NULL)
221 return SSH_ERR_INTERNAL_ERROR; 220 return SSH_ERR_INTERNAL_ERROR;
222 if (start_offset > SSHBUF_SIZE_MAX || len > SSHBUF_SIZE_MAX || len == 0) 221 if (start_offset > SSHBUF_SIZE_MAX || len > SSHBUF_SIZE_MAX || len == 0)
diff --git a/sshbuf.h b/sshbuf.h
index ea40e1677..033feb072 100644
--- a/sshbuf.h
+++ b/sshbuf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshbuf.h,v 1.16 2019/07/16 13:18:39 djm Exp $ */ 1/* $OpenBSD: sshbuf.h,v 1.17 2019/07/30 05:04:49 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller 3 * Copyright (c) 2011 Damien Miller
4 * 4 *
@@ -270,7 +270,7 @@ int sshbuf_b64tod(struct sshbuf *buf, const char *b64);
270 * all. 270 * all.
271 */ 271 */
272int sshbuf_cmp(const struct sshbuf *b, size_t offset, 272int sshbuf_cmp(const struct sshbuf *b, size_t offset,
273 const u_char *s, size_t len); 273 const void *s, size_t len);
274 274
275/* 275/*
276 * Searches the buffer for the specified string. Returns 0 on success 276 * Searches the buffer for the specified string. Returns 0 on success
@@ -282,7 +282,7 @@ int sshbuf_cmp(const struct sshbuf *b, size_t offset,
282 */ 282 */
283int 283int
284sshbuf_find(const struct sshbuf *b, size_t start_offset, 284sshbuf_find(const struct sshbuf *b, size_t start_offset,
285 const u_char *s, size_t len, size_t *offsetp); 285 const void *s, size_t len, size_t *offsetp);
286 286
287/* 287/*
288 * Duplicate the contents of a buffer to a string (caller to free). 288 * Duplicate the contents of a buffer to a string (caller to free).