Coverage Report

Created: 2026-02-14 06:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gnutls/lib/mbuffers.h
Line
Count
Source
1
/*
2
 * Copyright (C) 2009-2012 Free Software Foundation, Inc.
3
 *
4
 * Author: Jonathan Bastien-Filiatrault
5
 *
6
 * This file is part of GNUTLS.
7
 *
8
 * The GNUTLS library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public License
10
 * as published by the Free Software Foundation; either version 2.1 of
11
 * the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful, but
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public License
19
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
20
 *
21
 */
22
23
#ifndef GNUTLS_LIB_MBUFFERS_H
24
#define GNUTLS_LIB_MBUFFERS_H
25
26
#include "gnutls_int.h"
27
#include "errors.h"
28
#include <assert.h>
29
30
void _mbuffer_head_init(mbuffer_head_st *buf);
31
void _mbuffer_head_clear(mbuffer_head_st *buf);
32
void _mbuffer_enqueue(mbuffer_head_st *buf, mbuffer_st *bufel);
33
mbuffer_st *_mbuffer_dequeue(mbuffer_head_st *buf, mbuffer_st *bufel);
34
int _mbuffer_head_remove_bytes(mbuffer_head_st *buf, size_t bytes);
35
mbuffer_st *_mbuffer_alloc(size_t maximum_size);
36
int _mbuffer_linearize(mbuffer_head_st *buf);
37
38
mbuffer_st *_mbuffer_head_get_first(mbuffer_head_st *buf, gnutls_datum_t *msg);
39
mbuffer_st *_mbuffer_head_get_next(mbuffer_st *cur, gnutls_datum_t *msg);
40
41
void _mbuffer_head_push_first(mbuffer_head_st *buf, mbuffer_st *bufel);
42
43
mbuffer_st *_mbuffer_head_pop_first(mbuffer_head_st *buf);
44
45
/* This is dangerous since it will replace bufel with a new
46
 * one.
47
 */
48
int _mbuffer_append_data(mbuffer_st *bufel, void *newdata, size_t newdata_size);
49
50
/* For "user" use. One can have buffer data and header.
51
 */
52
53
inline static void *_mbuffer_get_uhead_ptr(mbuffer_st *bufel)
54
183k
{
55
183k
  return bufel->msg.data + bufel->mark;
56
183k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: kx.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: state.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: dtls.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: system_override.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: prf.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: dtls-sw.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: ocsp-api.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: heartbeat.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: key_share.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: pre_shared_key.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: session_ticket.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: status_request.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: supported_versions.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: cert.c:_mbuffer_get_uhead_ptr
record.c:_mbuffer_get_uhead_ptr
Line
Count
Source
54
57.3k
{
55
57.3k
  return bufel->msg.data + bufel->mark;
56
57.3k
}
cipher.c:_mbuffer_get_uhead_ptr
Line
Count
Source
54
57.2k
{
55
57.2k
  return bufel->msg.data + bufel->mark;
56
57.2k
}
Unexecuted instantiation: handshake-tls13.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: mbuffers.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: buffers.c:_mbuffer_get_uhead_ptr
handshake.c:_mbuffer_get_uhead_ptr
Line
Count
Source
54
68.7k
{
55
68.7k
  return bufel->msg.data + bufel->mark;
56
68.7k
}
Unexecuted instantiation: sslv2_compat.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: constate.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: tls-sig.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: alert.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: handshake-checks.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: encrypted_extensions.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: certificate_request.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: certificate_verify.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: finished.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: key_update.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: hello_retry.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: certificate.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: early_data.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: post_handshake.c:_mbuffer_get_uhead_ptr
Unexecuted instantiation: session.c:_mbuffer_get_uhead_ptr
57
58
inline static void *_mbuffer_get_udata_ptr(mbuffer_st *bufel)
59
4.50M
{
60
4.50M
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
4.50M
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: kx.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: state.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: dtls.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: system_override.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: prf.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: dtls-sw.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: ocsp-api.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: heartbeat.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: key_share.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: pre_shared_key.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: session_ticket.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: status_request.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: supported_versions.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: cert.c:_mbuffer_get_udata_ptr
record.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
2.95M
{
60
2.95M
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
2.95M
}
cipher.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
57.3k
{
60
57.3k
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
57.3k
}
Unexecuted instantiation: handshake-tls13.c:_mbuffer_get_udata_ptr
mbuffers.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
1.16M
{
60
1.16M
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
1.16M
}
buffers.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
205k
{
60
205k
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
205k
}
handshake.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
120k
{
60
120k
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
120k
}
Unexecuted instantiation: sslv2_compat.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: constate.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: tls-sig.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: alert.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: handshake-checks.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: encrypted_extensions.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: certificate_request.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: certificate_verify.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: finished.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: key_update.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: hello_retry.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: certificate.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: early_data.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: post_handshake.c:_mbuffer_get_udata_ptr
Unexecuted instantiation: session.c:_mbuffer_get_udata_ptr
62
63
inline static void _mbuffer_set_udata_size(mbuffer_st *bufel, size_t size)
64
2.33M
{
65
2.33M
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
2.33M
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_set_udata_size
kx.c:_mbuffer_set_udata_size
Line
Count
Source
64
11.3k
{
65
11.3k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
11.3k
}
Unexecuted instantiation: state.c:_mbuffer_set_udata_size
Unexecuted instantiation: dtls.c:_mbuffer_set_udata_size
Unexecuted instantiation: system_override.c:_mbuffer_set_udata_size
Unexecuted instantiation: prf.c:_mbuffer_set_udata_size
Unexecuted instantiation: dtls-sw.c:_mbuffer_set_udata_size
Unexecuted instantiation: ocsp-api.c:_mbuffer_set_udata_size
Unexecuted instantiation: heartbeat.c:_mbuffer_set_udata_size
Unexecuted instantiation: key_share.c:_mbuffer_set_udata_size
Unexecuted instantiation: pre_shared_key.c:_mbuffer_set_udata_size
Unexecuted instantiation: session_ticket.c:_mbuffer_set_udata_size
Unexecuted instantiation: status_request.c:_mbuffer_set_udata_size
Unexecuted instantiation: supported_versions.c:_mbuffer_set_udata_size
Unexecuted instantiation: cert.c:_mbuffer_set_udata_size
record.c:_mbuffer_set_udata_size
Line
Count
Source
64
2.19M
{
65
2.19M
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
2.19M
}
cipher.c:_mbuffer_set_udata_size
Line
Count
Source
64
57.2k
{
65
57.2k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
57.2k
}
Unexecuted instantiation: handshake-tls13.c:_mbuffer_set_udata_size
Unexecuted instantiation: mbuffers.c:_mbuffer_set_udata_size
Unexecuted instantiation: buffers.c:_mbuffer_set_udata_size
handshake.c:_mbuffer_set_udata_size
Line
Count
Source
64
66.5k
{
65
66.5k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
66.5k
}
Unexecuted instantiation: sslv2_compat.c:_mbuffer_set_udata_size
Unexecuted instantiation: constate.c:_mbuffer_set_udata_size
Unexecuted instantiation: tls-sig.c:_mbuffer_set_udata_size
Unexecuted instantiation: alert.c:_mbuffer_set_udata_size
Unexecuted instantiation: handshake-checks.c:_mbuffer_set_udata_size
encrypted_extensions.c:_mbuffer_set_udata_size
Line
Count
Source
64
1.24k
{
65
1.24k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
1.24k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_set_udata_size
certificate_verify.c:_mbuffer_set_udata_size
Line
Count
Source
64
1.24k
{
65
1.24k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
1.24k
}
finished.c:_mbuffer_set_udata_size
Line
Count
Source
64
2.49k
{
65
2.49k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
2.49k
}
Unexecuted instantiation: key_update.c:_mbuffer_set_udata_size
hello_retry.c:_mbuffer_set_udata_size
Line
Count
Source
64
191
{
65
191
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
191
}
certificate.c:_mbuffer_set_udata_size
Line
Count
Source
64
1.24k
{
65
1.24k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
1.24k
}
Unexecuted instantiation: early_data.c:_mbuffer_set_udata_size
Unexecuted instantiation: post_handshake.c:_mbuffer_set_udata_size
Unexecuted instantiation: session.c:_mbuffer_set_udata_size
67
68
inline static void _mbuffer_set_udata(mbuffer_st *bufel, void *data,
69
              size_t data_size)
70
0
{
71
0
  memcpy(_mbuffer_get_udata_ptr(bufel), data, data_size);
72
0
  _mbuffer_set_udata_size(bufel, data_size);
73
0
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_set_udata
Unexecuted instantiation: kx.c:_mbuffer_set_udata
Unexecuted instantiation: state.c:_mbuffer_set_udata
Unexecuted instantiation: dtls.c:_mbuffer_set_udata
Unexecuted instantiation: system_override.c:_mbuffer_set_udata
Unexecuted instantiation: prf.c:_mbuffer_set_udata
Unexecuted instantiation: dtls-sw.c:_mbuffer_set_udata
Unexecuted instantiation: ocsp-api.c:_mbuffer_set_udata
Unexecuted instantiation: heartbeat.c:_mbuffer_set_udata
Unexecuted instantiation: key_share.c:_mbuffer_set_udata
Unexecuted instantiation: pre_shared_key.c:_mbuffer_set_udata
Unexecuted instantiation: session_ticket.c:_mbuffer_set_udata
Unexecuted instantiation: status_request.c:_mbuffer_set_udata
Unexecuted instantiation: supported_versions.c:_mbuffer_set_udata
Unexecuted instantiation: cert.c:_mbuffer_set_udata
Unexecuted instantiation: record.c:_mbuffer_set_udata
Unexecuted instantiation: cipher.c:_mbuffer_set_udata
Unexecuted instantiation: handshake-tls13.c:_mbuffer_set_udata
Unexecuted instantiation: mbuffers.c:_mbuffer_set_udata
Unexecuted instantiation: buffers.c:_mbuffer_set_udata
Unexecuted instantiation: handshake.c:_mbuffer_set_udata
Unexecuted instantiation: sslv2_compat.c:_mbuffer_set_udata
Unexecuted instantiation: constate.c:_mbuffer_set_udata
Unexecuted instantiation: tls-sig.c:_mbuffer_set_udata
Unexecuted instantiation: alert.c:_mbuffer_set_udata
Unexecuted instantiation: handshake-checks.c:_mbuffer_set_udata
Unexecuted instantiation: encrypted_extensions.c:_mbuffer_set_udata
Unexecuted instantiation: certificate_request.c:_mbuffer_set_udata
Unexecuted instantiation: certificate_verify.c:_mbuffer_set_udata
Unexecuted instantiation: finished.c:_mbuffer_set_udata
Unexecuted instantiation: key_update.c:_mbuffer_set_udata
Unexecuted instantiation: hello_retry.c:_mbuffer_set_udata
Unexecuted instantiation: certificate.c:_mbuffer_set_udata
Unexecuted instantiation: early_data.c:_mbuffer_set_udata
Unexecuted instantiation: post_handshake.c:_mbuffer_set_udata
Unexecuted instantiation: session.c:_mbuffer_set_udata
74
75
inline static size_t _mbuffer_get_udata_size(mbuffer_st *bufel)
76
3.90M
{
77
3.90M
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
3.90M
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_get_udata_size
Unexecuted instantiation: kx.c:_mbuffer_get_udata_size
Unexecuted instantiation: state.c:_mbuffer_get_udata_size
Unexecuted instantiation: dtls.c:_mbuffer_get_udata_size
Unexecuted instantiation: system_override.c:_mbuffer_get_udata_size
Unexecuted instantiation: prf.c:_mbuffer_get_udata_size
Unexecuted instantiation: dtls-sw.c:_mbuffer_get_udata_size
Unexecuted instantiation: ocsp-api.c:_mbuffer_get_udata_size
Unexecuted instantiation: heartbeat.c:_mbuffer_get_udata_size
Unexecuted instantiation: key_share.c:_mbuffer_get_udata_size
Unexecuted instantiation: pre_shared_key.c:_mbuffer_get_udata_size
Unexecuted instantiation: session_ticket.c:_mbuffer_get_udata_size
Unexecuted instantiation: status_request.c:_mbuffer_get_udata_size
Unexecuted instantiation: supported_versions.c:_mbuffer_get_udata_size
Unexecuted instantiation: cert.c:_mbuffer_get_udata_size
record.c:_mbuffer_get_udata_size
Line
Count
Source
76
3.21M
{
77
3.21M
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
3.21M
}
cipher.c:_mbuffer_get_udata_size
Line
Count
Source
76
114k
{
77
114k
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
114k
}
Unexecuted instantiation: handshake-tls13.c:_mbuffer_get_udata_size
Unexecuted instantiation: mbuffers.c:_mbuffer_get_udata_size
buffers.c:_mbuffer_get_udata_size
Line
Count
Source
76
343k
{
77
343k
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
343k
}
handshake.c:_mbuffer_get_udata_size
Line
Count
Source
76
237k
{
77
237k
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
237k
}
Unexecuted instantiation: sslv2_compat.c:_mbuffer_get_udata_size
Unexecuted instantiation: constate.c:_mbuffer_get_udata_size
Unexecuted instantiation: tls-sig.c:_mbuffer_get_udata_size
Unexecuted instantiation: alert.c:_mbuffer_get_udata_size
Unexecuted instantiation: handshake-checks.c:_mbuffer_get_udata_size
Unexecuted instantiation: encrypted_extensions.c:_mbuffer_get_udata_size
Unexecuted instantiation: certificate_request.c:_mbuffer_get_udata_size
Unexecuted instantiation: certificate_verify.c:_mbuffer_get_udata_size
Unexecuted instantiation: finished.c:_mbuffer_get_udata_size
Unexecuted instantiation: key_update.c:_mbuffer_get_udata_size
Unexecuted instantiation: hello_retry.c:_mbuffer_get_udata_size
Unexecuted instantiation: certificate.c:_mbuffer_get_udata_size
Unexecuted instantiation: early_data.c:_mbuffer_get_udata_size
Unexecuted instantiation: post_handshake.c:_mbuffer_get_udata_size
Unexecuted instantiation: session.c:_mbuffer_get_udata_size
79
80
/* discards size bytes from the begging of the buffer */
81
inline static void _mbuffer_consume(mbuffer_head_st *buf, mbuffer_st *bufel,
82
            size_t size)
83
0
{
84
0
  bufel->uhead_mark = 0;
85
0
  if (bufel->mark + size < bufel->msg.size)
86
0
    bufel->mark += size;
87
0
  else
88
0
    bufel->mark = bufel->msg.size;
89
90
0
  buf->byte_length -= size;
91
0
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_consume
Unexecuted instantiation: kx.c:_mbuffer_consume
Unexecuted instantiation: state.c:_mbuffer_consume
Unexecuted instantiation: dtls.c:_mbuffer_consume
Unexecuted instantiation: system_override.c:_mbuffer_consume
Unexecuted instantiation: prf.c:_mbuffer_consume
Unexecuted instantiation: dtls-sw.c:_mbuffer_consume
Unexecuted instantiation: ocsp-api.c:_mbuffer_consume
Unexecuted instantiation: heartbeat.c:_mbuffer_consume
Unexecuted instantiation: key_share.c:_mbuffer_consume
Unexecuted instantiation: pre_shared_key.c:_mbuffer_consume
Unexecuted instantiation: session_ticket.c:_mbuffer_consume
Unexecuted instantiation: status_request.c:_mbuffer_consume
Unexecuted instantiation: supported_versions.c:_mbuffer_consume
Unexecuted instantiation: cert.c:_mbuffer_consume
Unexecuted instantiation: record.c:_mbuffer_consume
Unexecuted instantiation: cipher.c:_mbuffer_consume
Unexecuted instantiation: handshake-tls13.c:_mbuffer_consume
Unexecuted instantiation: mbuffers.c:_mbuffer_consume
Unexecuted instantiation: buffers.c:_mbuffer_consume
Unexecuted instantiation: handshake.c:_mbuffer_consume
Unexecuted instantiation: sslv2_compat.c:_mbuffer_consume
Unexecuted instantiation: constate.c:_mbuffer_consume
Unexecuted instantiation: tls-sig.c:_mbuffer_consume
Unexecuted instantiation: alert.c:_mbuffer_consume
Unexecuted instantiation: handshake-checks.c:_mbuffer_consume
Unexecuted instantiation: encrypted_extensions.c:_mbuffer_consume
Unexecuted instantiation: certificate_request.c:_mbuffer_consume
Unexecuted instantiation: certificate_verify.c:_mbuffer_consume
Unexecuted instantiation: finished.c:_mbuffer_consume
Unexecuted instantiation: key_update.c:_mbuffer_consume
Unexecuted instantiation: hello_retry.c:_mbuffer_consume
Unexecuted instantiation: certificate.c:_mbuffer_consume
Unexecuted instantiation: early_data.c:_mbuffer_consume
Unexecuted instantiation: post_handshake.c:_mbuffer_consume
Unexecuted instantiation: session.c:_mbuffer_consume
92
93
inline static size_t _mbuffer_get_uhead_size(mbuffer_st *bufel)
94
106k
{
95
106k
  return bufel->uhead_mark;
96
106k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_get_uhead_size
kx.c:_mbuffer_get_uhead_size
Line
Count
Source
94
11.3k
{
95
11.3k
  return bufel->uhead_mark;
96
11.3k
}
Unexecuted instantiation: state.c:_mbuffer_get_uhead_size
Unexecuted instantiation: dtls.c:_mbuffer_get_uhead_size
Unexecuted instantiation: system_override.c:_mbuffer_get_uhead_size
Unexecuted instantiation: prf.c:_mbuffer_get_uhead_size
Unexecuted instantiation: dtls-sw.c:_mbuffer_get_uhead_size
Unexecuted instantiation: ocsp-api.c:_mbuffer_get_uhead_size
Unexecuted instantiation: heartbeat.c:_mbuffer_get_uhead_size
Unexecuted instantiation: key_share.c:_mbuffer_get_uhead_size
Unexecuted instantiation: pre_shared_key.c:_mbuffer_get_uhead_size
Unexecuted instantiation: session_ticket.c:_mbuffer_get_uhead_size
Unexecuted instantiation: status_request.c:_mbuffer_get_uhead_size
Unexecuted instantiation: supported_versions.c:_mbuffer_get_uhead_size
Unexecuted instantiation: cert.c:_mbuffer_get_uhead_size
Unexecuted instantiation: record.c:_mbuffer_get_uhead_size
Unexecuted instantiation: cipher.c:_mbuffer_get_uhead_size
Unexecuted instantiation: handshake-tls13.c:_mbuffer_get_uhead_size
Unexecuted instantiation: mbuffers.c:_mbuffer_get_uhead_size
Unexecuted instantiation: buffers.c:_mbuffer_get_uhead_size
handshake.c:_mbuffer_get_uhead_size
Line
Count
Source
94
91.4k
{
95
91.4k
  return bufel->uhead_mark;
96
91.4k
}
Unexecuted instantiation: sslv2_compat.c:_mbuffer_get_uhead_size
Unexecuted instantiation: constate.c:_mbuffer_get_uhead_size
Unexecuted instantiation: tls-sig.c:_mbuffer_get_uhead_size
Unexecuted instantiation: alert.c:_mbuffer_get_uhead_size
Unexecuted instantiation: handshake-checks.c:_mbuffer_get_uhead_size
encrypted_extensions.c:_mbuffer_get_uhead_size
Line
Count
Source
94
1.24k
{
95
1.24k
  return bufel->uhead_mark;
96
1.24k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_get_uhead_size
certificate_verify.c:_mbuffer_get_uhead_size
Line
Count
Source
94
1.24k
{
95
1.24k
  return bufel->uhead_mark;
96
1.24k
}
Unexecuted instantiation: finished.c:_mbuffer_get_uhead_size
Unexecuted instantiation: key_update.c:_mbuffer_get_uhead_size
hello_retry.c:_mbuffer_get_uhead_size
Line
Count
Source
94
191
{
95
191
  return bufel->uhead_mark;
96
191
}
certificate.c:_mbuffer_get_uhead_size
Line
Count
Source
94
1.24k
{
95
1.24k
  return bufel->uhead_mark;
96
1.24k
}
Unexecuted instantiation: early_data.c:_mbuffer_get_uhead_size
Unexecuted instantiation: post_handshake.c:_mbuffer_get_uhead_size
Unexecuted instantiation: session.c:_mbuffer_get_uhead_size
97
98
inline static void _mbuffer_set_uhead_size(mbuffer_st *bufel, size_t size)
99
379k
{
100
379k
  bufel->uhead_mark = size;
101
379k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_set_uhead_size
kx.c:_mbuffer_set_uhead_size
Line
Count
Source
99
23.3k
{
100
23.3k
  bufel->uhead_mark = size;
101
23.3k
}
Unexecuted instantiation: state.c:_mbuffer_set_uhead_size
Unexecuted instantiation: dtls.c:_mbuffer_set_uhead_size
Unexecuted instantiation: system_override.c:_mbuffer_set_uhead_size
Unexecuted instantiation: prf.c:_mbuffer_set_uhead_size
Unexecuted instantiation: dtls-sw.c:_mbuffer_set_uhead_size
Unexecuted instantiation: ocsp-api.c:_mbuffer_set_uhead_size
Unexecuted instantiation: heartbeat.c:_mbuffer_set_uhead_size
Unexecuted instantiation: key_share.c:_mbuffer_set_uhead_size
Unexecuted instantiation: pre_shared_key.c:_mbuffer_set_uhead_size
Unexecuted instantiation: session_ticket.c:_mbuffer_set_uhead_size
Unexecuted instantiation: status_request.c:_mbuffer_set_uhead_size
Unexecuted instantiation: supported_versions.c:_mbuffer_set_uhead_size
Unexecuted instantiation: cert.c:_mbuffer_set_uhead_size
record.c:_mbuffer_set_uhead_size
Line
Count
Source
99
57.3k
{
100
57.3k
  bufel->uhead_mark = size;
101
57.3k
}
cipher.c:_mbuffer_set_uhead_size
Line
Count
Source
99
57.2k
{
100
57.2k
  bufel->uhead_mark = size;
101
57.2k
}
Unexecuted instantiation: handshake-tls13.c:_mbuffer_set_uhead_size
Unexecuted instantiation: mbuffers.c:_mbuffer_set_uhead_size
buffers.c:_mbuffer_set_uhead_size
Line
Count
Source
99
137k
{
100
137k
  bufel->uhead_mark = size;
101
137k
}
handshake.c:_mbuffer_set_uhead_size
Line
Count
Source
99
95.6k
{
100
95.6k
  bufel->uhead_mark = size;
101
95.6k
}
Unexecuted instantiation: sslv2_compat.c:_mbuffer_set_uhead_size
Unexecuted instantiation: constate.c:_mbuffer_set_uhead_size
Unexecuted instantiation: tls-sig.c:_mbuffer_set_uhead_size
Unexecuted instantiation: alert.c:_mbuffer_set_uhead_size
Unexecuted instantiation: handshake-checks.c:_mbuffer_set_uhead_size
encrypted_extensions.c:_mbuffer_set_uhead_size
Line
Count
Source
99
2.49k
{
100
2.49k
  bufel->uhead_mark = size;
101
2.49k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_set_uhead_size
certificate_verify.c:_mbuffer_set_uhead_size
Line
Count
Source
99
2.49k
{
100
2.49k
  bufel->uhead_mark = size;
101
2.49k
}
finished.c:_mbuffer_set_uhead_size
Line
Count
Source
99
1.24k
{
100
1.24k
  bufel->uhead_mark = size;
101
1.24k
}
Unexecuted instantiation: key_update.c:_mbuffer_set_uhead_size
hello_retry.c:_mbuffer_set_uhead_size
Line
Count
Source
99
389
{
100
389
  bufel->uhead_mark = size;
101
389
}
certificate.c:_mbuffer_set_uhead_size
Line
Count
Source
99
2.49k
{
100
2.49k
  bufel->uhead_mark = size;
101
2.49k
}
Unexecuted instantiation: early_data.c:_mbuffer_set_uhead_size
Unexecuted instantiation: post_handshake.c:_mbuffer_set_uhead_size
Unexecuted instantiation: session.c:_mbuffer_set_uhead_size
102
103
inline static void _mbuffer_init(mbuffer_st *bufel, size_t max)
104
48.3k
{
105
48.3k
  memset(bufel, 0, sizeof(*bufel));
106
48.3k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
48.3k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
48.3k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_init
kx.c:_mbuffer_init
Line
Count
Source
104
11.3k
{
105
11.3k
  memset(bufel, 0, sizeof(*bufel));
106
11.3k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
11.3k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
11.3k
}
Unexecuted instantiation: state.c:_mbuffer_init
Unexecuted instantiation: dtls.c:_mbuffer_init
Unexecuted instantiation: system_override.c:_mbuffer_init
Unexecuted instantiation: prf.c:_mbuffer_init
Unexecuted instantiation: dtls-sw.c:_mbuffer_init
Unexecuted instantiation: ocsp-api.c:_mbuffer_init
Unexecuted instantiation: heartbeat.c:_mbuffer_init
Unexecuted instantiation: key_share.c:_mbuffer_init
Unexecuted instantiation: pre_shared_key.c:_mbuffer_init
Unexecuted instantiation: session_ticket.c:_mbuffer_init
Unexecuted instantiation: status_request.c:_mbuffer_init
Unexecuted instantiation: supported_versions.c:_mbuffer_init
Unexecuted instantiation: cert.c:_mbuffer_init
Unexecuted instantiation: record.c:_mbuffer_init
Unexecuted instantiation: cipher.c:_mbuffer_init
Unexecuted instantiation: handshake-tls13.c:_mbuffer_init
Unexecuted instantiation: mbuffers.c:_mbuffer_init
Unexecuted instantiation: buffers.c:_mbuffer_init
handshake.c:_mbuffer_init
Line
Count
Source
104
33.0k
{
105
33.0k
  memset(bufel, 0, sizeof(*bufel));
106
33.0k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
33.0k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
33.0k
}
Unexecuted instantiation: sslv2_compat.c:_mbuffer_init
Unexecuted instantiation: constate.c:_mbuffer_init
Unexecuted instantiation: tls-sig.c:_mbuffer_init
Unexecuted instantiation: alert.c:_mbuffer_init
Unexecuted instantiation: handshake-checks.c:_mbuffer_init
encrypted_extensions.c:_mbuffer_init
Line
Count
Source
104
1.24k
{
105
1.24k
  memset(bufel, 0, sizeof(*bufel));
106
1.24k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
1.24k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
1.24k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_init
certificate_verify.c:_mbuffer_init
Line
Count
Source
104
1.24k
{
105
1.24k
  memset(bufel, 0, sizeof(*bufel));
106
1.24k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
1.24k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
1.24k
}
Unexecuted instantiation: finished.c:_mbuffer_init
Unexecuted instantiation: key_update.c:_mbuffer_init
hello_retry.c:_mbuffer_init
Line
Count
Source
104
191
{
105
191
  memset(bufel, 0, sizeof(*bufel));
106
191
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
191
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
191
}
certificate.c:_mbuffer_init
Line
Count
Source
104
1.24k
{
105
1.24k
  memset(bufel, 0, sizeof(*bufel));
106
1.24k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
1.24k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
1.24k
}
Unexecuted instantiation: early_data.c:_mbuffer_init
Unexecuted instantiation: post_handshake.c:_mbuffer_init
Unexecuted instantiation: session.c:_mbuffer_init
111
112
/* Helper functions to utilize a gnutls_buffer_st in order
113
 * to generate a gnutls_mbuffer_st, without multiple allocations.
114
 */
115
inline static int _gnutls_buffer_init_mbuffer(gnutls_buffer_st *buf,
116
                size_t header_size)
117
49.0k
{
118
49.0k
  int ret;
119
49.0k
  mbuffer_st *bufel;
120
121
49.0k
  _gnutls_buffer_init(buf);
122
123
49.0k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
49.0k
  if (ret < 0)
125
0
    return gnutls_assert_val(ret);
126
127
  /* we store the uhead size on the uninitialized bufel, only to read
128
   * it back on _gnutls_buffer_to_mbuffer(). */
129
49.0k
  bufel = (void *)buf->data;
130
49.0k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
49.0k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
49.0k
  return 0;
135
49.0k
}
Unexecuted instantiation: cert-cred-x509.c:_gnutls_buffer_init_mbuffer
kx.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
11.9k
{
118
11.9k
  int ret;
119
11.9k
  mbuffer_st *bufel;
120
121
11.9k
  _gnutls_buffer_init(buf);
122
123
11.9k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
11.9k
  if (ret < 0)
125
0
    return gnutls_assert_val(ret);
126
127
  /* we store the uhead size on the uninitialized bufel, only to read
128
   * it back on _gnutls_buffer_to_mbuffer(). */
129
11.9k
  bufel = (void *)buf->data;
130
11.9k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
11.9k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
11.9k
  return 0;
135
11.9k
}
Unexecuted instantiation: state.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: dtls.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: system_override.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: prf.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: dtls-sw.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: ocsp-api.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: heartbeat.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: key_share.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: pre_shared_key.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: session_ticket.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: status_request.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: supported_versions.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: cert.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: record.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: cipher.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: handshake-tls13.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: mbuffers.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: buffers.c:_gnutls_buffer_init_mbuffer
handshake.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
33.1k
{
118
33.1k
  int ret;
119
33.1k
  mbuffer_st *bufel;
120
121
33.1k
  _gnutls_buffer_init(buf);
122
123
33.1k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
33.1k
  if (ret < 0)
125
0
    return gnutls_assert_val(ret);
126
127
  /* we store the uhead size on the uninitialized bufel, only to read
128
   * it back on _gnutls_buffer_to_mbuffer(). */
129
33.1k
  bufel = (void *)buf->data;
130
33.1k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
33.1k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
33.1k
  return 0;
135
33.1k
}
Unexecuted instantiation: sslv2_compat.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: constate.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: tls-sig.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: alert.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: handshake-checks.c:_gnutls_buffer_init_mbuffer
encrypted_extensions.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
1.24k
{
118
1.24k
  int ret;
119
1.24k
  mbuffer_st *bufel;
120
121
1.24k
  _gnutls_buffer_init(buf);
122
123
1.24k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
1.24k
  if (ret < 0)
125
0
    return gnutls_assert_val(ret);
126
127
  /* we store the uhead size on the uninitialized bufel, only to read
128
   * it back on _gnutls_buffer_to_mbuffer(). */
129
1.24k
  bufel = (void *)buf->data;
130
1.24k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
1.24k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
1.24k
  return 0;
135
1.24k
}
Unexecuted instantiation: certificate_request.c:_gnutls_buffer_init_mbuffer
certificate_verify.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
1.24k
{
118
1.24k
  int ret;
119
1.24k
  mbuffer_st *bufel;
120
121
1.24k
  _gnutls_buffer_init(buf);
122
123
1.24k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
1.24k
  if (ret < 0)
125
0
    return gnutls_assert_val(ret);
126
127
  /* we store the uhead size on the uninitialized bufel, only to read
128
   * it back on _gnutls_buffer_to_mbuffer(). */
129
1.24k
  bufel = (void *)buf->data;
130
1.24k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
1.24k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
1.24k
  return 0;
135
1.24k
}
Unexecuted instantiation: finished.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: key_update.c:_gnutls_buffer_init_mbuffer
hello_retry.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
198
{
118
198
  int ret;
119
198
  mbuffer_st *bufel;
120
121
198
  _gnutls_buffer_init(buf);
122
123
198
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
198
  if (ret < 0)
125
0
    return gnutls_assert_val(ret);
126
127
  /* we store the uhead size on the uninitialized bufel, only to read
128
   * it back on _gnutls_buffer_to_mbuffer(). */
129
198
  bufel = (void *)buf->data;
130
198
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
198
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
198
  return 0;
135
198
}
certificate.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
1.24k
{
118
1.24k
  int ret;
119
1.24k
  mbuffer_st *bufel;
120
121
1.24k
  _gnutls_buffer_init(buf);
122
123
1.24k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
1.24k
  if (ret < 0)
125
0
    return gnutls_assert_val(ret);
126
127
  /* we store the uhead size on the uninitialized bufel, only to read
128
   * it back on _gnutls_buffer_to_mbuffer(). */
129
1.24k
  bufel = (void *)buf->data;
130
1.24k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
1.24k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
1.24k
  return 0;
135
1.24k
}
Unexecuted instantiation: early_data.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: post_handshake.c:_gnutls_buffer_init_mbuffer
Unexecuted instantiation: session.c:_gnutls_buffer_init_mbuffer
136
137
#define _gnutls_buffer_init_handshake_mbuffer(b) \
138
49.0k
  _gnutls_buffer_init_mbuffer(b, HANDSHAKE_HEADER_SIZE(session))
139
140
/* Cannot fail */
141
inline static mbuffer_st *_gnutls_buffer_to_mbuffer(gnutls_buffer_st *buf)
142
48.3k
{
143
48.3k
  mbuffer_st *bufel;
144
48.3k
  unsigned header_size;
145
146
48.3k
  bufel = (void *)buf->data;
147
148
48.3k
  header_size = _mbuffer_get_uhead_size(bufel);
149
48.3k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
48.3k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
48.3k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
48.3k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
48.3k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
48.3k
  return bufel;
159
48.3k
}
Unexecuted instantiation: cert-cred-x509.c:_gnutls_buffer_to_mbuffer
kx.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
11.3k
{
143
11.3k
  mbuffer_st *bufel;
144
11.3k
  unsigned header_size;
145
146
11.3k
  bufel = (void *)buf->data;
147
148
11.3k
  header_size = _mbuffer_get_uhead_size(bufel);
149
11.3k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
11.3k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
11.3k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
11.3k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
11.3k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
11.3k
  return bufel;
159
11.3k
}
Unexecuted instantiation: state.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: dtls.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: system_override.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: prf.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: dtls-sw.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: ocsp-api.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: heartbeat.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: key_share.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: pre_shared_key.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: session_ticket.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: status_request.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: supported_versions.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: cert.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: record.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: cipher.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: handshake-tls13.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: mbuffers.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: buffers.c:_gnutls_buffer_to_mbuffer
handshake.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
33.0k
{
143
33.0k
  mbuffer_st *bufel;
144
33.0k
  unsigned header_size;
145
146
33.0k
  bufel = (void *)buf->data;
147
148
33.0k
  header_size = _mbuffer_get_uhead_size(bufel);
149
33.0k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
33.0k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
33.0k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
33.0k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
33.0k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
33.0k
  return bufel;
159
33.0k
}
Unexecuted instantiation: sslv2_compat.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: constate.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: tls-sig.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: alert.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: handshake-checks.c:_gnutls_buffer_to_mbuffer
encrypted_extensions.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
1.24k
{
143
1.24k
  mbuffer_st *bufel;
144
1.24k
  unsigned header_size;
145
146
1.24k
  bufel = (void *)buf->data;
147
148
1.24k
  header_size = _mbuffer_get_uhead_size(bufel);
149
1.24k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
1.24k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
1.24k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
1.24k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
1.24k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
1.24k
  return bufel;
159
1.24k
}
Unexecuted instantiation: certificate_request.c:_gnutls_buffer_to_mbuffer
certificate_verify.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
1.24k
{
143
1.24k
  mbuffer_st *bufel;
144
1.24k
  unsigned header_size;
145
146
1.24k
  bufel = (void *)buf->data;
147
148
1.24k
  header_size = _mbuffer_get_uhead_size(bufel);
149
1.24k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
1.24k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
1.24k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
1.24k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
1.24k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
1.24k
  return bufel;
159
1.24k
}
Unexecuted instantiation: finished.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: key_update.c:_gnutls_buffer_to_mbuffer
hello_retry.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
191
{
143
191
  mbuffer_st *bufel;
144
191
  unsigned header_size;
145
146
191
  bufel = (void *)buf->data;
147
148
191
  header_size = _mbuffer_get_uhead_size(bufel);
149
191
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
191
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
191
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
191
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
191
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
191
  return bufel;
159
191
}
certificate.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
1.24k
{
143
1.24k
  mbuffer_st *bufel;
144
1.24k
  unsigned header_size;
145
146
1.24k
  bufel = (void *)buf->data;
147
148
1.24k
  header_size = _mbuffer_get_uhead_size(bufel);
149
1.24k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
1.24k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
1.24k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
1.24k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
1.24k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
1.24k
  return bufel;
159
1.24k
}
Unexecuted instantiation: early_data.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: post_handshake.c:_gnutls_buffer_to_mbuffer
Unexecuted instantiation: session.c:_gnutls_buffer_to_mbuffer
160
161
inline static mbuffer_st *_gnutls_handshake_alloc(gnutls_session_t session,
162
              size_t maximum)
163
20.3k
{
164
20.3k
  mbuffer_st *bufel =
165
20.3k
    _mbuffer_alloc(HANDSHAKE_HEADER_SIZE(session) + maximum);
166
167
20.3k
  if (!bufel)
168
0
    return NULL;
169
170
20.3k
  _mbuffer_set_uhead_size(bufel, HANDSHAKE_HEADER_SIZE(session));
171
20.3k
  _mbuffer_set_udata_size(bufel, maximum);
172
173
20.3k
  return bufel;
174
20.3k
}
Unexecuted instantiation: cert-cred-x509.c:_gnutls_handshake_alloc
Unexecuted instantiation: kx.c:_gnutls_handshake_alloc
Unexecuted instantiation: state.c:_gnutls_handshake_alloc
Unexecuted instantiation: dtls.c:_gnutls_handshake_alloc
Unexecuted instantiation: system_override.c:_gnutls_handshake_alloc
Unexecuted instantiation: prf.c:_gnutls_handshake_alloc
Unexecuted instantiation: dtls-sw.c:_gnutls_handshake_alloc
Unexecuted instantiation: ocsp-api.c:_gnutls_handshake_alloc
Unexecuted instantiation: heartbeat.c:_gnutls_handshake_alloc
Unexecuted instantiation: key_share.c:_gnutls_handshake_alloc
Unexecuted instantiation: pre_shared_key.c:_gnutls_handshake_alloc
Unexecuted instantiation: session_ticket.c:_gnutls_handshake_alloc
Unexecuted instantiation: status_request.c:_gnutls_handshake_alloc
Unexecuted instantiation: supported_versions.c:_gnutls_handshake_alloc
Unexecuted instantiation: cert.c:_gnutls_handshake_alloc
Unexecuted instantiation: record.c:_gnutls_handshake_alloc
Unexecuted instantiation: cipher.c:_gnutls_handshake_alloc
Unexecuted instantiation: handshake-tls13.c:_gnutls_handshake_alloc
Unexecuted instantiation: mbuffers.c:_gnutls_handshake_alloc
Unexecuted instantiation: buffers.c:_gnutls_handshake_alloc
handshake.c:_gnutls_handshake_alloc
Line
Count
Source
163
19.0k
{
164
19.0k
  mbuffer_st *bufel =
165
19.0k
    _mbuffer_alloc(HANDSHAKE_HEADER_SIZE(session) + maximum);
166
167
19.0k
  if (!bufel)
168
0
    return NULL;
169
170
19.0k
  _mbuffer_set_uhead_size(bufel, HANDSHAKE_HEADER_SIZE(session));
171
19.0k
  _mbuffer_set_udata_size(bufel, maximum);
172
173
19.0k
  return bufel;
174
19.0k
}
Unexecuted instantiation: sslv2_compat.c:_gnutls_handshake_alloc
Unexecuted instantiation: constate.c:_gnutls_handshake_alloc
Unexecuted instantiation: tls-sig.c:_gnutls_handshake_alloc
Unexecuted instantiation: alert.c:_gnutls_handshake_alloc
Unexecuted instantiation: handshake-checks.c:_gnutls_handshake_alloc
Unexecuted instantiation: encrypted_extensions.c:_gnutls_handshake_alloc
Unexecuted instantiation: certificate_request.c:_gnutls_handshake_alloc
Unexecuted instantiation: certificate_verify.c:_gnutls_handshake_alloc
finished.c:_gnutls_handshake_alloc
Line
Count
Source
163
1.24k
{
164
1.24k
  mbuffer_st *bufel =
165
1.24k
    _mbuffer_alloc(HANDSHAKE_HEADER_SIZE(session) + maximum);
166
167
1.24k
  if (!bufel)
168
0
    return NULL;
169
170
1.24k
  _mbuffer_set_uhead_size(bufel, HANDSHAKE_HEADER_SIZE(session));
171
1.24k
  _mbuffer_set_udata_size(bufel, maximum);
172
173
1.24k
  return bufel;
174
1.24k
}
Unexecuted instantiation: key_update.c:_gnutls_handshake_alloc
Unexecuted instantiation: hello_retry.c:_gnutls_handshake_alloc
Unexecuted instantiation: certificate.c:_gnutls_handshake_alloc
Unexecuted instantiation: early_data.c:_gnutls_handshake_alloc
Unexecuted instantiation: post_handshake.c:_gnutls_handshake_alloc
Unexecuted instantiation: session.c:_gnutls_handshake_alloc
175
176
/* Free a segment, if the pointer is not NULL
177
 *
178
 * We take a ** to detect and fix double free bugs (the dangling
179
 * pointer case). It also makes sure the pointer has a known value
180
 * after freeing.
181
 */
182
inline static void _mbuffer_xfree(mbuffer_st **bufel)
183
72.9k
{
184
72.9k
  if (*bufel)
185
72.9k
    gnutls_free(*bufel);
186
187
  *bufel = NULL;
188
72.9k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_xfree
Unexecuted instantiation: kx.c:_mbuffer_xfree
Unexecuted instantiation: state.c:_mbuffer_xfree
Unexecuted instantiation: dtls.c:_mbuffer_xfree
Unexecuted instantiation: system_override.c:_mbuffer_xfree
Unexecuted instantiation: prf.c:_mbuffer_xfree
Unexecuted instantiation: dtls-sw.c:_mbuffer_xfree
Unexecuted instantiation: ocsp-api.c:_mbuffer_xfree
Unexecuted instantiation: heartbeat.c:_mbuffer_xfree
Unexecuted instantiation: key_share.c:_mbuffer_xfree
Unexecuted instantiation: pre_shared_key.c:_mbuffer_xfree
Unexecuted instantiation: session_ticket.c:_mbuffer_xfree
Unexecuted instantiation: status_request.c:_mbuffer_xfree
Unexecuted instantiation: supported_versions.c:_mbuffer_xfree
Unexecuted instantiation: cert.c:_mbuffer_xfree
record.c:_mbuffer_xfree
Line
Count
Source
183
64.5k
{
184
64.5k
  if (*bufel)
185
64.5k
    gnutls_free(*bufel);
186
187
  *bufel = NULL;
188
64.5k
}
Unexecuted instantiation: cipher.c:_mbuffer_xfree
Unexecuted instantiation: handshake-tls13.c:_mbuffer_xfree
Unexecuted instantiation: mbuffers.c:_mbuffer_xfree
buffers.c:_mbuffer_xfree
Line
Count
Source
183
8.45k
{
184
8.45k
  if (*bufel)
185
8.45k
    gnutls_free(*bufel);
186
187
  *bufel = NULL;
188
8.45k
}
Unexecuted instantiation: handshake.c:_mbuffer_xfree
Unexecuted instantiation: sslv2_compat.c:_mbuffer_xfree
Unexecuted instantiation: constate.c:_mbuffer_xfree
Unexecuted instantiation: tls-sig.c:_mbuffer_xfree
Unexecuted instantiation: alert.c:_mbuffer_xfree
Unexecuted instantiation: handshake-checks.c:_mbuffer_xfree
Unexecuted instantiation: encrypted_extensions.c:_mbuffer_xfree
Unexecuted instantiation: certificate_request.c:_mbuffer_xfree
Unexecuted instantiation: certificate_verify.c:_mbuffer_xfree
Unexecuted instantiation: finished.c:_mbuffer_xfree
Unexecuted instantiation: key_update.c:_mbuffer_xfree
Unexecuted instantiation: hello_retry.c:_mbuffer_xfree
Unexecuted instantiation: certificate.c:_mbuffer_xfree
Unexecuted instantiation: early_data.c:_mbuffer_xfree
Unexecuted instantiation: post_handshake.c:_mbuffer_xfree
Unexecuted instantiation: session.c:_mbuffer_xfree
189
190
#ifdef ENABLE_ALIGN16
191
mbuffer_st *_mbuffer_alloc_align16(size_t maximum_size, unsigned align_pos);
192
int _mbuffer_linearize_align16(mbuffer_head_st *buf, unsigned align_pos);
193
#else
194
#define _mbuffer_alloc_align16(x, y) _mbuffer_alloc(x)
195
#define _mbuffer_linearize_align16(x, y) _mbuffer_linearize(x)
196
#endif
197
198
#endif /* GNUTLS_LIB_MBUFFERS_H */