1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00

Use ibuf_data() instead of accessing ibuf->buf directly.

OK tb@
This commit is contained in:
claudio 2023-07-03 09:38:08 +00:00
parent a01b15c12b
commit bce5c5dd58
3 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: check_tcp.c,v 1.60 2023/06/21 07:54:54 claudio Exp $ */
/* $OpenBSD: check_tcp.c,v 1.61 2023/07/03 09:38:08 claudio Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@ -214,7 +214,7 @@ tcp_send_req(int s, short event, void *arg)
req = ibuf_data(cte->table->sendbinbuf);
log_debug("%s: table %s sending binary", __func__,
cte->table->conf.name);
print_hex(cte->table->sendbinbuf->buf, 0, len);
print_hex(req, 0, len);
} else {
len = strlen(cte->table->sendbuf);
req = cte->table->sendbuf;
@ -323,7 +323,7 @@ check_send_expect(struct ctl_tcp_event *cte)
/*
* ensure string is nul-terminated.
*/
b = strndup(cte->buf->buf, ibuf_size(cte->buf));
b = strndup(ibuf_data(cte->buf), ibuf_size(cte->buf));
if (b == NULL)
fatal("out of memory");
if (fnmatch(cte->table->conf.exbuf, b, 0) == 0) {

View File

@ -1,4 +1,4 @@
/* $OpenBSD: check_tls.c,v 1.2 2019/09/15 19:23:29 rob Exp $ */
/* $OpenBSD: check_tls.c,v 1.3 2023/07/03 09:38:08 claudio Exp $ */
/*
* Copyright (c) 2017 Claudio Jeker <claudio@openbsd.org>
@ -104,10 +104,10 @@ check_tls_write(int s, short event, void *arg)
if (cte->table->sendbinbuf != NULL) {
len = ibuf_size(cte->table->sendbinbuf);
buf = cte->table->sendbinbuf->buf;
buf = ibuf_data(cte->table->sendbinbuf);
log_debug("%s: table %s sending binary", __func__,
cte->table->conf.name);
print_hex(cte->table->sendbinbuf->buf, 0, len);
print_hex(buf, 0, len);
} else {
len = strlen(cte->table->sendbuf);
buf = cte->table->sendbuf;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: parse.y,v 1.253 2021/10/15 15:01:28 naddy Exp $ */
/* $OpenBSD: parse.y,v 1.254 2023/07/03 09:38:08 claudio Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
@ -996,7 +996,7 @@ tablecheck : ICMP { table->conf.check = CHECK_ICMP; }
free($5);
YYERROR;
}
memcpy(table->conf.exbinbuf, ibuf->buf,
memcpy(table->conf.exbinbuf, ibuf_data(ibuf),
ibuf_size(ibuf));
ibuf_free(ibuf);
free($5);