Coverage Report

Created: 2026-05-16 06:52

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
200k
{
55
200k
  return bufel->msg.data + bufel->mark;
56
200k
}
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
63.0k
{
55
63.0k
  return bufel->msg.data + bufel->mark;
56
63.0k
}
cipher.c:_mbuffer_get_uhead_ptr
Line
Count
Source
54
62.9k
{
55
62.9k
  return bufel->msg.data + bufel->mark;
56
62.9k
}
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
74.9k
{
55
74.9k
  return bufel->msg.data + bufel->mark;
56
74.9k
}
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
5.26M
{
60
5.26M
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
5.26M
}
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
3.45M
{
60
3.45M
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
3.45M
}
cipher.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
63.0k
{
60
63.0k
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
63.0k
}
Unexecuted instantiation: handshake-tls13.c:_mbuffer_get_udata_ptr
mbuffers.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
1.38M
{
60
1.38M
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
1.38M
}
buffers.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
229k
{
60
229k
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
229k
}
handshake.c:_mbuffer_get_udata_ptr
Line
Count
Source
59
131k
{
60
131k
  return bufel->msg.data + bufel->uhead_mark + bufel->mark;
61
131k
}
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.73M
{
65
2.73M
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
2.73M
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_set_udata_size
kx.c:_mbuffer_set_udata_size
Line
Count
Source
64
12.1k
{
65
12.1k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
12.1k
}
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.57M
{
65
2.57M
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
2.57M
}
cipher.c:_mbuffer_set_udata_size
Line
Count
Source
64
62.9k
{
65
62.9k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
62.9k
}
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
73.0k
{
65
73.0k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
73.0k
}
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.27k
{
65
1.27k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
1.27k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_set_udata_size
certificate_verify.c:_mbuffer_set_udata_size
Line
Count
Source
64
1.27k
{
65
1.27k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
1.27k
}
finished.c:_mbuffer_set_udata_size
Line
Count
Source
64
2.55k
{
65
2.55k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
2.55k
}
Unexecuted instantiation: key_update.c:_mbuffer_set_udata_size
hello_retry.c:_mbuffer_set_udata_size
Line
Count
Source
64
196
{
65
196
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
196
}
certificate.c:_mbuffer_set_udata_size
Line
Count
Source
64
1.27k
{
65
1.27k
  bufel->msg.size = size + bufel->uhead_mark + bufel->mark;
66
1.27k
}
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
4.54M
{
77
4.54M
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
4.54M
}
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.77M
{
77
3.77M
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
3.77M
}
cipher.c:_mbuffer_get_udata_size
Line
Count
Source
76
125k
{
77
125k
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
125k
}
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
382k
{
77
382k
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
382k
}
handshake.c:_mbuffer_get_udata_size
Line
Count
Source
76
259k
{
77
259k
  return bufel->msg.size - bufel->uhead_mark - bufel->mark;
78
259k
}
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
116k
{
95
116k
  return bufel->uhead_mark;
96
116k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_get_uhead_size
kx.c:_mbuffer_get_uhead_size
Line
Count
Source
94
12.1k
{
95
12.1k
  return bufel->uhead_mark;
96
12.1k
}
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
100k
{
95
100k
  return bufel->uhead_mark;
96
100k
}
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.27k
{
95
1.27k
  return bufel->uhead_mark;
96
1.27k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_get_uhead_size
certificate_verify.c:_mbuffer_get_uhead_size
Line
Count
Source
94
1.27k
{
95
1.27k
  return bufel->uhead_mark;
96
1.27k
}
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
196
{
95
196
  return bufel->uhead_mark;
96
196
}
certificate.c:_mbuffer_get_uhead_size
Line
Count
Source
94
1.27k
{
95
1.27k
  return bufel->uhead_mark;
96
1.27k
}
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
419k
{
100
419k
  bufel->uhead_mark = size;
101
419k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_set_uhead_size
kx.c:_mbuffer_set_uhead_size
Line
Count
Source
99
24.9k
{
100
24.9k
  bufel->uhead_mark = size;
101
24.9k
}
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
63.0k
{
100
63.0k
  bufel->uhead_mark = size;
101
63.0k
}
cipher.c:_mbuffer_set_uhead_size
Line
Count
Source
99
62.9k
{
100
62.9k
  bufel->uhead_mark = size;
101
62.9k
}
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
153k
{
100
153k
  bufel->uhead_mark = size;
101
153k
}
handshake.c:_mbuffer_set_uhead_size
Line
Count
Source
99
105k
{
100
105k
  bufel->uhead_mark = size;
101
105k
}
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.55k
{
100
2.55k
  bufel->uhead_mark = size;
101
2.55k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_set_uhead_size
certificate_verify.c:_mbuffer_set_uhead_size
Line
Count
Source
99
2.55k
{
100
2.55k
  bufel->uhead_mark = size;
101
2.55k
}
finished.c:_mbuffer_set_uhead_size
Line
Count
Source
99
1.27k
{
100
1.27k
  bufel->uhead_mark = size;
101
1.27k
}
Unexecuted instantiation: key_update.c:_mbuffer_set_uhead_size
hello_retry.c:_mbuffer_set_uhead_size
Line
Count
Source
99
398
{
100
398
  bufel->uhead_mark = size;
101
398
}
certificate.c:_mbuffer_set_uhead_size
Line
Count
Source
99
2.55k
{
100
2.55k
  bufel->uhead_mark = size;
101
2.55k
}
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
53.1k
{
105
53.1k
  memset(bufel, 0, sizeof(*bufel));
106
53.1k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
53.1k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
53.1k
}
Unexecuted instantiation: cert-cred-x509.c:_mbuffer_init
kx.c:_mbuffer_init
Line
Count
Source
104
12.1k
{
105
12.1k
  memset(bufel, 0, sizeof(*bufel));
106
12.1k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
12.1k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
12.1k
}
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
36.9k
{
105
36.9k
  memset(bufel, 0, sizeof(*bufel));
106
36.9k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
36.9k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
36.9k
}
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.27k
{
105
1.27k
  memset(bufel, 0, sizeof(*bufel));
106
1.27k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
1.27k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
1.27k
}
Unexecuted instantiation: certificate_request.c:_mbuffer_init
certificate_verify.c:_mbuffer_init
Line
Count
Source
104
1.27k
{
105
1.27k
  memset(bufel, 0, sizeof(*bufel));
106
1.27k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
1.27k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
1.27k
}
Unexecuted instantiation: finished.c:_mbuffer_init
Unexecuted instantiation: key_update.c:_mbuffer_init
hello_retry.c:_mbuffer_init
Line
Count
Source
104
196
{
105
196
  memset(bufel, 0, sizeof(*bufel));
106
196
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
196
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
196
}
certificate.c:_mbuffer_init
Line
Count
Source
104
1.27k
{
105
1.27k
  memset(bufel, 0, sizeof(*bufel));
106
1.27k
  bufel->maximum_size = max;
107
108
  /* payload points after the mbuffer_st structure */
109
1.27k
  bufel->msg.data = (uint8_t *)bufel + sizeof(mbuffer_st);
110
1.27k
}
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
53.8k
{
118
53.8k
  int ret;
119
53.8k
  mbuffer_st *bufel;
120
121
53.8k
  _gnutls_buffer_init(buf);
122
123
53.8k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
53.8k
  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
53.8k
  bufel = (void *)buf->data;
130
53.8k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
53.8k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
53.8k
  return 0;
135
53.8k
}
Unexecuted instantiation: cert-cred-x509.c:_gnutls_buffer_init_mbuffer
kx.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
12.7k
{
118
12.7k
  int ret;
119
12.7k
  mbuffer_st *bufel;
120
121
12.7k
  _gnutls_buffer_init(buf);
122
123
12.7k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
12.7k
  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
12.7k
  bufel = (void *)buf->data;
130
12.7k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
12.7k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
12.7k
  return 0;
135
12.7k
}
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
36.9k
{
118
36.9k
  int ret;
119
36.9k
  mbuffer_st *bufel;
120
121
36.9k
  _gnutls_buffer_init(buf);
122
123
36.9k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
36.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
36.9k
  bufel = (void *)buf->data;
130
36.9k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
36.9k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
36.9k
  return 0;
135
36.9k
}
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.27k
{
118
1.27k
  int ret;
119
1.27k
  mbuffer_st *bufel;
120
121
1.27k
  _gnutls_buffer_init(buf);
122
123
1.27k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
1.27k
  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.27k
  bufel = (void *)buf->data;
130
1.27k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
1.27k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
1.27k
  return 0;
135
1.27k
}
Unexecuted instantiation: certificate_request.c:_gnutls_buffer_init_mbuffer
certificate_verify.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
1.27k
{
118
1.27k
  int ret;
119
1.27k
  mbuffer_st *bufel;
120
121
1.27k
  _gnutls_buffer_init(buf);
122
123
1.27k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
1.27k
  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.27k
  bufel = (void *)buf->data;
130
1.27k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
1.27k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
1.27k
  return 0;
135
1.27k
}
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
202
{
118
202
  int ret;
119
202
  mbuffer_st *bufel;
120
121
202
  _gnutls_buffer_init(buf);
122
123
202
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
202
  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
202
  bufel = (void *)buf->data;
130
202
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
202
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
202
  return 0;
135
202
}
certificate.c:_gnutls_buffer_init_mbuffer
Line
Count
Source
117
1.27k
{
118
1.27k
  int ret;
119
1.27k
  mbuffer_st *bufel;
120
121
1.27k
  _gnutls_buffer_init(buf);
122
123
1.27k
  ret = _gnutls_buffer_resize(buf, sizeof(mbuffer_st) + header_size);
124
1.27k
  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.27k
  bufel = (void *)buf->data;
130
1.27k
  _mbuffer_set_uhead_size(bufel, header_size);
131
132
1.27k
  buf->length = sizeof(mbuffer_st) + header_size;
133
134
1.27k
  return 0;
135
1.27k
}
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
53.8k
  _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
53.1k
{
143
53.1k
  mbuffer_st *bufel;
144
53.1k
  unsigned header_size;
145
146
53.1k
  bufel = (void *)buf->data;
147
148
53.1k
  header_size = _mbuffer_get_uhead_size(bufel);
149
53.1k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
53.1k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
53.1k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
53.1k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
53.1k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
53.1k
  return bufel;
159
53.1k
}
Unexecuted instantiation: cert-cred-x509.c:_gnutls_buffer_to_mbuffer
kx.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
12.1k
{
143
12.1k
  mbuffer_st *bufel;
144
12.1k
  unsigned header_size;
145
146
12.1k
  bufel = (void *)buf->data;
147
148
12.1k
  header_size = _mbuffer_get_uhead_size(bufel);
149
12.1k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
12.1k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
12.1k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
12.1k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
12.1k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
12.1k
  return bufel;
159
12.1k
}
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
36.9k
{
143
36.9k
  mbuffer_st *bufel;
144
36.9k
  unsigned header_size;
145
146
36.9k
  bufel = (void *)buf->data;
147
148
36.9k
  header_size = _mbuffer_get_uhead_size(bufel);
149
36.9k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
36.9k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
36.9k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
36.9k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
36.9k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
36.9k
  return bufel;
159
36.9k
}
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.27k
{
143
1.27k
  mbuffer_st *bufel;
144
1.27k
  unsigned header_size;
145
146
1.27k
  bufel = (void *)buf->data;
147
148
1.27k
  header_size = _mbuffer_get_uhead_size(bufel);
149
1.27k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
1.27k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
1.27k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
1.27k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
1.27k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
1.27k
  return bufel;
159
1.27k
}
Unexecuted instantiation: certificate_request.c:_gnutls_buffer_to_mbuffer
certificate_verify.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
1.27k
{
143
1.27k
  mbuffer_st *bufel;
144
1.27k
  unsigned header_size;
145
146
1.27k
  bufel = (void *)buf->data;
147
148
1.27k
  header_size = _mbuffer_get_uhead_size(bufel);
149
1.27k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
1.27k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
1.27k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
1.27k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
1.27k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
1.27k
  return bufel;
159
1.27k
}
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
196
{
143
196
  mbuffer_st *bufel;
144
196
  unsigned header_size;
145
146
196
  bufel = (void *)buf->data;
147
148
196
  header_size = _mbuffer_get_uhead_size(bufel);
149
196
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
196
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
196
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
196
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
196
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
196
  return bufel;
159
196
}
certificate.c:_gnutls_buffer_to_mbuffer
Line
Count
Source
142
1.27k
{
143
1.27k
  mbuffer_st *bufel;
144
1.27k
  unsigned header_size;
145
146
1.27k
  bufel = (void *)buf->data;
147
148
1.27k
  header_size = _mbuffer_get_uhead_size(bufel);
149
1.27k
  assert(buf->length >= sizeof(mbuffer_st) + header_size);
150
151
1.27k
  _mbuffer_init(bufel, buf->length - sizeof(mbuffer_st));
152
153
1.27k
  _mbuffer_set_udata_size(bufel, buf->length - sizeof(mbuffer_st));
154
1.27k
  _mbuffer_set_uhead_size(bufel, header_size);
155
156
1.27k
  _gnutls_buffer_init(buf); /* avoid double frees */
157
158
1.27k
  return bufel;
159
1.27k
}
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
21.8k
{
164
21.8k
  mbuffer_st *bufel =
165
21.8k
    _mbuffer_alloc(HANDSHAKE_HEADER_SIZE(session) + maximum);
166
167
21.8k
  if (!bufel)
168
0
    return NULL;
169
170
21.8k
  _mbuffer_set_uhead_size(bufel, HANDSHAKE_HEADER_SIZE(session));
171
21.8k
  _mbuffer_set_udata_size(bufel, maximum);
172
173
21.8k
  return bufel;
174
21.8k
}
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
20.5k
{
164
20.5k
  mbuffer_st *bufel =
165
20.5k
    _mbuffer_alloc(HANDSHAKE_HEADER_SIZE(session) + maximum);
166
167
20.5k
  if (!bufel)
168
0
    return NULL;
169
170
20.5k
  _mbuffer_set_uhead_size(bufel, HANDSHAKE_HEADER_SIZE(session));
171
20.5k
  _mbuffer_set_udata_size(bufel, maximum);
172
173
20.5k
  return bufel;
174
20.5k
}
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.27k
{
164
1.27k
  mbuffer_st *bufel =
165
1.27k
    _mbuffer_alloc(HANDSHAKE_HEADER_SIZE(session) + maximum);
166
167
1.27k
  if (!bufel)
168
0
    return NULL;
169
170
1.27k
  _mbuffer_set_uhead_size(bufel, HANDSHAKE_HEADER_SIZE(session));
171
1.27k
  _mbuffer_set_udata_size(bufel, maximum);
172
173
1.27k
  return bufel;
174
1.27k
}
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
75.0k
{
184
75.0k
  if (*bufel)
185
75.0k
    gnutls_free(*bufel);
186
187
  *bufel = NULL;
188
75.0k
}
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
66.2k
{
184
66.2k
  if (*bufel)
185
66.2k
    gnutls_free(*bufel);
186
187
  *bufel = NULL;
188
66.2k
}
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.75k
{
184
8.75k
  if (*bufel)
185
8.75k
    gnutls_free(*bufel);
186
187
  *bufel = NULL;
188
8.75k
}
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 */