OpenCoverage

sshbuf-getput-basic.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssh/src/sshbuf-getput-basic.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8int-
9sshbuf_get(struct sshbuf *buf, void *v, size_t len)-
10{-
11 const u_char *p = sshbuf_ptr(buf);-
12 int r;-
13-
14 if ((
(r = sshbuf_co...buf, len)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 65 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
r = sshbuf_consume(buf, len)) < 0
(r = sshbuf_co...buf, len)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 65 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
)
1-65
15 return
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
1
16 if (v !=
v != ((void *)0)Description
TRUEevaluated 65 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEnever evaluated
0-65
17 ((void *)0)
v != ((void *)0)Description
TRUEevaluated 65 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEnever evaluated
0-65
18 && len != 0
len != 0Description
TRUEevaluated 33 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEevaluated 32 times by 1 test
Evaluated by:
  • test_kex
)
32-33
19 memcpy(v, p, len);
executed 33 times by 2 tests: memcpy(v, p, len);
Executed by:
  • test_kex
  • test_sshbuf
33
20 return
executed 65 times by 2 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
0;
executed 65 times by 2 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
65
21}-
22-
23int-
24sshbuf_get_u64(struct sshbuf *buf, u_int64_t *valp)-
25{-
26 const u_char *p = sshbuf_ptr(buf);-
27 int r;-
28-
29 if ((
(r = sshbuf_co...e(buf, 8)) < 0Description
TRUEevaluated 97 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1285256 times by 3 tests
Evaluated by:
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_consume(buf, 8)) < 0
(r = sshbuf_co...e(buf, 8)) < 0Description
TRUEevaluated 97 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1285256 times by 3 tests
Evaluated by:
  • test_kex
  • test_sshbuf
  • test_sshkey
)
97-1285256
30 return
executed 97 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 97 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
97
31 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1285256 times by 3 tests
Evaluated by:
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-1285256
32 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1285256 times by 3 tests
Evaluated by:
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-1285256
33 )-
34 *
executed 1285256 times by 3 tests: *valp = (((u_int64_t)(((const u_char *)(p))[0]) << 56) | ((u_int64_t)(((const u_char *)(p))[1]) << 48) | ((u_int64_t)(((const u_char *)(p))[2]) << 40) | ((u_int64_t)(((const u_char *)(p))[3]) << 32) | ((u_int64_t)(((const u_char *)(p))[4]) << 24) | ((u_int64_t)(((const u_char *)(p))[5]) << 16) | ((u_int64_t)(((const u_char *)(p))[6]) << 8) | (u_int64_t)(((const u_char *)(p))[7]));
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = (((u_int64_t)(((const u_char *)(p))[0]) << 56) | ((u_int64_t)(((const u_char *)(p))[1]) << 48) | ((u_int64_t)(((const u_char *)(p))[2]) << 40) | ((u_int64_t)(((const u_char *)(p))[3]) << 32) | ((u_int64_t)(((const u_char *)(p))[4]) << 24) | ((u_int64_t)(((const u_char *)(p))[5]) << 16) | ((u_int64_t)(((const u_char *)(p))[6]) << 8) | (u_int64_t)(((const u_char *)(p))[7]));
executed 1285256 times by 3 tests: *valp = (((u_int64_t)(((const u_char *)(p))[0]) << 56) | ((u_int64_t)(((const u_char *)(p))[1]) << 48) | ((u_int64_t)(((const u_char *)(p))[2]) << 40) | ((u_int64_t)(((const u_char *)(p))[3]) << 32) | ((u_int64_t)(((const u_char *)(p))[4]) << 24) | ((u_int64_t)(((const u_char *)(p))[5]) << 16) | ((u_int64_t)(((const u_char *)(p))[6]) << 8) | (u_int64_t)(((const u_char *)(p))[7]));
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
1285256
35 return
executed 1285256 times by 3 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1285256 times by 3 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
1285256
36}-
37-
38int-
39sshbuf_get_u32(struct sshbuf *buf, u_int32_t *valp)-
40{-
41 const u_char *p = sshbuf_ptr(buf);-
42 int r;-
43-
44 if ((
(r = sshbuf_co...e(buf, 4)) < 0Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1329270 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_consume(buf, 4)) < 0
(r = sshbuf_co...e(buf, 4)) < 0Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1329270 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
18-1329270
45 return
executed 18 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 18 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
18
46 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1328950 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 320 times by 1 test
Evaluated by:
  • test_kex
320-1328950
47 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1328950 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 320 times by 1 test
Evaluated by:
  • test_kex
320-1328950
48 )-
49 *
executed 1328950 times by 5 tests: *valp = (((u_int32_t)(((const u_char *)(p))[0]) << 24) | ((u_int32_t)(((const u_char *)(p))[1]) << 16) | ((u_int32_t)(((const u_char *)(p))[2]) << 8) | (u_int32_t)(((const u_char *)(p))[3]));
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = (((u_int32_t)(((const u_char *)(p))[0]) << 24) | ((u_int32_t)(((const u_char *)(p))[1]) << 16) | ((u_int32_t)(((const u_char *)(p))[2]) << 8) | (u_int32_t)(((const u_char *)(p))[3]));
executed 1328950 times by 5 tests: *valp = (((u_int32_t)(((const u_char *)(p))[0]) << 24) | ((u_int32_t)(((const u_char *)(p))[1]) << 16) | ((u_int32_t)(((const u_char *)(p))[2]) << 8) | (u_int32_t)(((const u_char *)(p))[3]));
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
1328950
50 return
executed 1329270 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1329270 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
1329270
51}-
52-
53int-
54sshbuf_get_u16(struct sshbuf *buf, u_int16_t *valp)-
55{-
56 const u_char *p = sshbuf_ptr(buf);-
57 int r;-
58-
59 if ((
(r = sshbuf_co...e(buf, 2)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1239381 times by 1 test
Evaluated by:
  • test_sshbuf
r = sshbuf_consume(buf, 2)) < 0
(r = sshbuf_co...e(buf, 2)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1239381 times by 1 test
Evaluated by:
  • test_sshbuf
)
1-1239381
60 return
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
1
61 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1239381 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEnever evaluated
0-1239381
62 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1239381 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEnever evaluated
0-1239381
63 )-
64 *
executed 1239381 times by 1 test: *valp = (((u_int16_t)(((const u_char *)(p))[0]) << 8) | (u_int16_t)(((const u_char *)(p))[1]));
Executed by:
  • test_sshbuf
valp = (((u_int16_t)(((const u_char *)(p))[0]) << 8) | (u_int16_t)(((const u_char *)(p))[1]));
executed 1239381 times by 1 test: *valp = (((u_int16_t)(((const u_char *)(p))[0]) << 8) | (u_int16_t)(((const u_char *)(p))[1]));
Executed by:
  • test_sshbuf
1239381
65 return
executed 1239381 times by 1 test: return 0;
Executed by:
  • test_sshbuf
0;
executed 1239381 times by 1 test: return 0;
Executed by:
  • test_sshbuf
1239381
66}-
67-
68int-
69sshbuf_get_u8(struct sshbuf *buf, u_char *valp)-
70{-
71 const u_char *p = sshbuf_ptr(buf);-
72 int r;-
73-
74 if ((
(r = sshbuf_co...e(buf, 1)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1275242 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_consume(buf, 1)) < 0
(r = sshbuf_co...e(buf, 1)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1275242 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
1-1275242
75 return
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
1
76 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1269802 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 5440 times by 1 test
Evaluated by:
  • test_kex
5440-1269802
77 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1269802 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 5440 times by 1 test
Evaluated by:
  • test_kex
5440-1269802
78 )-
79 *
executed 1269802 times by 5 tests: *valp = (u_int8_t)*p;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = (u_int8_t)*p;
executed 1269802 times by 5 tests: *valp = (u_int8_t)*p;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
1269802
80 return
executed 1275242 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1275242 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
1275242
81}-
82-
83int-
84sshbuf_get_string(struct sshbuf *buf, u_char **valp, size_t *lenp)-
85{-
86 const u_char *val;-
87 size_t len;-
88 int r;-
89-
90 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1357619 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1357619
91 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1357619 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1357619
92 )-
93 *
executed 1357619 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp =
executed 1357619 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1357619
94 ((void *)0)
executed 1357619 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1357619
95 ;
executed 1357619 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1357619
96 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 1357619 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1357619
97 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 1357619 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1357619
98 )-
99 *
executed 1357619 times by 6 tests: *lenp = 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
lenp = 0;
executed 1357619 times by 6 tests: *lenp = 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1357619
100 if ((
(r = sshbuf_ge...al, &len)) < 0Description
TRUEevaluated 4725 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1356094 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_get_string_direct(buf, &val, &len)) < 0
(r = sshbuf_ge...al, &len)) < 0Description
TRUEevaluated 4725 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1356094 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
4725-1356094
101 return
executed 4725 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 4725 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
4725
102 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1352894 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1352894
103 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1352894 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1352894
104 ) {-
105 if ((*
(*valp = mallo...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1352894 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = malloc(len + 1)) ==
(*valp = mallo...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1352894 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-1352894
106 ((void *)0)
(*valp = mallo...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1352894 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-1352894
107 ) {-
108 ;-
109 return
never executed: return -2;
-2;
never executed: return -2;
0
110 }-
111 if (len != 0
len != 0Description
TRUEevaluated 1352820 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 74 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshkey
)
74-1352820
112 memcpy(*valp, val, len);
executed 1352820 times by 6 tests: memcpy(*valp, val, len);
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1352820
113 (*valp)[len] = '\0';-
114 }
executed 1352894 times by 6 tests: end of block
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1352894
115 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 1352894 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1352894
116 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 1352894 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 3200 times by 1 test
Evaluated by:
  • test_kex
3200-1352894
117 )-
118 *
executed 1352894 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
lenp = len;
executed 1352894 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1352894
119 return
executed 1356094 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1356094 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1356094
120}-
121-
122int-
123sshbuf_get_string_direct(struct sshbuf *buf, const u_char **valp, size_t *lenp)-
124{-
125 size_t len;-
126 const u_char *p;-
127 int r;-
128-
129 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1378046 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 319661 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
319661-1378046
130 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1378046 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 319661 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
319661-1378046
131 )-
132 *
executed 1378046 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp =
executed 1378046 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1378046
133 ((void *)0)
executed 1378046 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1378046
134 ;
executed 1378046 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1378046
135 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 1378046 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 319661 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
319661-1378046
136 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 1378046 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 319661 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
319661-1378046
137 )-
138 *
executed 1378046 times by 6 tests: *lenp = 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
lenp = 0;
executed 1378046 times by 6 tests: *lenp = 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1378046
139 if ((
(r = sshbuf_pe...&p, &len)) < 0Description
TRUEevaluated 6304 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1691403 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_peek_string_direct(buf, &p, &len)) < 0
(r = sshbuf_pe...&p, &len)) < 0Description
TRUEevaluated 6304 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1691403 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
6304-1691403
140 return
executed 6304 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 6304 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
6304
141 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 1372476 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 318927 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
318927-1372476
142 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 1372476 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 318927 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
318927-1372476
143 )-
144 *
executed 1372476 times by 6 tests: *valp = p;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = p;
executed 1372476 times by 6 tests: *valp = p;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1372476
145 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 1372476 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 318927 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
318927-1372476
146 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 1372476 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 318927 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
318927-1372476
147 )-
148 *
executed 1372476 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
lenp = len;
executed 1372476 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1372476
149 if (sshbuf_consume(buf, len + 4) != 0
sshbuf_consume... len + 4) != 0Description
TRUEnever evaluated
FALSEevaluated 1691403 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
0-1691403
150-
151 ;-
152 ;-
153 return
never executed: return -1;
-1;
never executed: return -1;
0
154 }-
155 return
executed 1691403 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1691403 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1691403
156}-
157-
158int-
159sshbuf_peek_string_direct(const struct sshbuf *buf, const u_char **valp,-
160 size_t *lenp)-
161{-
162 u_int32_t len;-
163 const u_char *p = sshbuf_ptr(buf);-
164-
165 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 4617117 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-4617117
166 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 4617117 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-4617117
167 )-
168 *
executed 4617117 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp =
executed 4617117 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
4617117
169 ((void *)0)
executed 4617117 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
4617117
170 ;
executed 4617117 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
4617117
171 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 4617117 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-4617117
172 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 4617117 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-4617117
173 )-
174 *
executed 4617117 times by 6 tests: *lenp = 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
lenp = 0;
executed 4617117 times by 6 tests: *lenp = 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
4617117
175 if (sshbuf_len(buf) < 4
sshbuf_len(buf) < 4Description
TRUEevaluated 343 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 4616838 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
343-4616838
176 ;-
177 return
executed 343 times by 1 test: return -3;
Executed by:
  • test_sshkey
-3;
executed 343 times by 1 test: return -3;
Executed by:
  • test_sshkey
343
178 }-
179 len = (((u_int32_t)(((const u_char *)(p))[0]) << 24) | ((u_int32_t)(((const u_char *)(p))[1]) << 16) | ((u_int32_t)(((const u_char *)(p))[2]) << 8) | (u_int32_t)(((const u_char *)(p))[3]));-
180 if (len > 0x8000000 - 4
len > 0x8000000 - 4Description
TRUEevaluated 2485855 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 2130983 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
2130983-2485855
181 ;-
182 return
executed 2485855 times by 2 tests: return -6;
Executed by:
  • test_sshbuf
  • test_sshkey
-6;
executed 2485855 times by 2 tests: return -6;
Executed by:
  • test_sshbuf
  • test_sshkey
2485855
183 }-
184 if (sshbuf_len(buf) - 4 < len
sshbuf_len(buf) - 4 < lenDescription
TRUEevaluated 15093 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 2115890 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
15093-2115890
185 ;-
186 return
executed 15093 times by 2 tests: return -3;
Executed by:
  • test_sshbuf
  • test_sshkey
-3;
executed 15093 times by 2 tests: return -3;
Executed by:
  • test_sshbuf
  • test_sshkey
15093
187 }-
188 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 2115826 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-2115826
189 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 2115826 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-2115826
190 )-
191 *
executed 2115826 times by 6 tests: *valp = p + 4;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = p + 4;
executed 2115826 times by 6 tests: *valp = p + 4;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
2115826
192 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 2115826 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-2115826
193 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 2115826 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
64-2115826
194 )-
195 *
executed 2115826 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
lenp = len;
executed 2115826 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
2115826
196 return
executed 2115890 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 2115890 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
2115890
197}-
198-
199int-
200sshbuf_get_cstring(struct sshbuf *buf, char **valp, size_t *lenp)-
201{-
202 size_t len;-
203 const u_char *p, *z;-
204 int r;-
205-
206 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 274625 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-274625
207 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 274625 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-274625
208 )-
209 *
executed 274625 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp =
executed 274625 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
274625
210 ((void *)0)
executed 274625 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
274625
211 ;
executed 274625 times by 6 tests: *valp = ((void *)0) ;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
274625
212 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 15534 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 259091 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
15534-259091
213 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 15534 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 259091 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
15534-259091
214 )-
215 *
executed 15534 times by 2 tests: *lenp = 0;
Executed by:
  • test_sshbuf
  • test_sshkey
lenp = 0;
executed 15534 times by 2 tests: *lenp = 0;
Executed by:
  • test_sshbuf
  • test_sshkey
15534
216 if ((
(r = sshbuf_pe...p, &len)) != 0Description
TRUEevaluated 11053 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 263572 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_peek_string_direct(buf, &p, &len)) != 0
(r = sshbuf_pe...p, &len)) != 0Description
TRUEevaluated 11053 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 263572 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
11053-263572
217 return
executed 11053 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 11053 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
11053
218-
219 if (len > 0
len > 0Description
TRUEevaluated 262077 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1495 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshkey
&&
1495-262077
220 (
(z = memchr(p ...!= ((void *)0)Description
TRUEevaluated 422 times by 3 tests
Evaluated by:
  • test_hostkeys
  • test_sshbuf
  • test_sshkey
FALSEevaluated 261655 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
z = memchr(p , '\0', len)) !=
(z = memchr(p ...!= ((void *)0)Description
TRUEevaluated 422 times by 3 tests
Evaluated by:
  • test_hostkeys
  • test_sshbuf
  • test_sshkey
FALSEevaluated 261655 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
422-261655
221 ((void *)0)
(z = memchr(p ...!= ((void *)0)Description
TRUEevaluated 422 times by 3 tests
Evaluated by:
  • test_hostkeys
  • test_sshbuf
  • test_sshkey
FALSEevaluated 261655 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
422-261655
222 && z < p + len - 1
z < p + len - 1Description
TRUEevaluated 387 times by 3 tests
Evaluated by:
  • test_hostkeys
  • test_sshbuf
  • test_sshkey
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
) {
35-387
223 ;-
224 return
executed 387 times by 3 tests: return -4;
Executed by:
  • test_hostkeys
  • test_sshbuf
  • test_sshkey
-4;
executed 387 times by 3 tests: return -4;
Executed by:
  • test_hostkeys
  • test_sshbuf
  • test_sshkey
387
225 }-
226 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_get_string_direct(buf,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-263185
227 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-263185
228 ,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-263185
229 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-263185
230 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
0-263185
231 return
never executed: return -1;
-1;
never executed: return -1;
0
232 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-263185
233 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-263185
234 ) {-
235 if ((*
(*valp = mallo...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = malloc(len + 1)) ==
(*valp = mallo...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-263185
236 ((void *)0)
(*valp = mallo...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 263185 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-263185
237 ) {-
238 ;-
239 return
never executed: return -2;
-2;
never executed: return -2;
0
240 }-
241 if (len != 0
len != 0Description
TRUEevaluated 261690 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 1495 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshkey
)
1495-261690
242 memcpy(*valp, p, len);
executed 261690 times by 6 tests: memcpy(*valp, p, len);
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
261690
243 (*valp)[len] = '\0';-
244 }
executed 263185 times by 6 tests: end of block
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
263185
245 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 15350 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 247835 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshkey
15350-247835
246 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 15350 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 247835 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshkey
15350-247835
247 )-
248 *
executed 15350 times by 2 tests: *lenp = (size_t)len;
Executed by:
  • test_sshbuf
  • test_sshkey
lenp = (size_t)len;
executed 15350 times by 2 tests: *lenp = (size_t)len;
Executed by:
  • test_sshbuf
  • test_sshkey
15350
249 return
executed 263185 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 263185 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
263185
250}-
251-
252int-
253sshbuf_get_stringb(struct sshbuf *buf, struct sshbuf *v)-
254{-
255 u_int32_t len;-
256 u_char *p;-
257 int r;-
258-
259-
260-
261-
262-
263-
264 if ((
(r = sshbuf_pe...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
r = sshbuf_peek_string_direct(buf,
(r = sshbuf_pe...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
0-64
265 ((void *)0)
(r = sshbuf_pe...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
0-64
266 ,
(r = sshbuf_pe...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
0-64
267 ((void *)0)
(r = sshbuf_pe...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
0-64
268 )) != 0
(r = sshbuf_pe...d *)0) )) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
||
0-64
269 (
(r = sshbuf_ge...f, &len)) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
r = sshbuf_get_u32(buf, &len)) != 0
(r = sshbuf_ge...f, &len)) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
||
0-64
270 (
(r = sshbuf_re...len, &p)) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
r = sshbuf_reserve(v, len, &p)) != 0
(r = sshbuf_re...len, &p)) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
||
0-64
271 (
(r = sshbuf_ge... p, len)) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
r = sshbuf_get(buf, p, len)) != 0
(r = sshbuf_ge... p, len)) != 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • test_kex
)
0-64
272 return
never executed: return r;
r;
never executed: return r;
0
273 return
executed 64 times by 1 test: return 0;
Executed by:
  • test_kex
0;
executed 64 times by 1 test: return 0;
Executed by:
  • test_kex
64
274}-
275-
276int-
277sshbuf_put(struct sshbuf *buf, const void *v, size_t len)-
278{-
279 u_char *p;-
280 int r;-
281-
282 if ((
(r = sshbuf_re... len, &p)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1561867 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_reserve(buf, len, &p)) < 0
(r = sshbuf_re... len, &p)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1561867 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
1-1561867
283 return
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
1
284 if (len != 0
len != 0Description
TRUEevaluated 1535366 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 26501 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshkey
)
26501-1535366
285 memcpy(p, v, len);
executed 1535366 times by 6 tests: memcpy(p, v, len);
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1535366
286 return
executed 1561867 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1561867 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1561867
287}-
288-
289int-
290sshbuf_putb(struct sshbuf *buf, const struct sshbuf *v)-
291{-
292 return
executed 42354 times by 3 tests: return sshbuf_put(buf, sshbuf_ptr(v), sshbuf_len(v));
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
sshbuf_put(buf, sshbuf_ptr(v), sshbuf_len(v));
executed 42354 times by 3 tests: return sshbuf_put(buf, sshbuf_ptr(v), sshbuf_len(v));
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
42354
293}-
294-
295int-
296sshbuf_putf(struct sshbuf *buf, const char *fmt, ...)-
297{-
298 va_list ap;-
299 int r;-
300-
301 -
302__builtin_va_start(-
303ap-
304,-
305fmt-
306)-
307 ;-
308 r = sshbuf_putfv(buf, fmt, ap);-
309 -
310__builtin_va_end(-
311ap-
312)-
313 ;-
314 return
executed 12 times by 2 tests: return r;
Executed by:
  • ssh-keygen
  • test_sshbuf
r;
executed 12 times by 2 tests: return r;
Executed by:
  • ssh-keygen
  • test_sshbuf
12
315}-
316-
317int-
318sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap)-
319{-
320 va_list ap2;-
321 int r, len;-
322 u_char *p;-
323-
324 -
325__builtin_va_copy(-
326ap2-
327,-
328ap-
329)-
330 ;-
331 if ((
(len = vsnprin...fmt, ap2)) < 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
len = vsnprintf(
(len = vsnprin...fmt, ap2)) < 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
0-12
332 ((void *)0)
(len = vsnprin...fmt, ap2)) < 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
0-12
333 , 0, fmt, ap2)) < 0
(len = vsnprin...fmt, ap2)) < 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
) {
0-12
334 r = -10;-
335 goto
never executed: goto out;
out;
never executed: goto out;
0
336 }-
337 if (len == 0
len == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
) {
0-12
338 r = 0;-
339 goto
never executed: goto out;
out;
never executed: goto out;
0
340 }-
341 -
342__builtin_va_end(-
343ap2-
344)-
345 ;-
346 -
347__builtin_va_copy(-
348ap2-
349,-
350ap-
351)-
352 ;-
353 if ((
(r = sshbuf_re... + 1, &p)) < 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0
(r = sshbuf_re... + 1, &p)) < 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
)
0-12
354 goto
never executed: goto out;
out;
never executed: goto out;
0
355 if ((
(r = vsnprintf..., ap2)) != lenDescription
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len
(r = vsnprintf..., ap2)) != lenDescription
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
) {
0-12
356 r = -1;-
357 goto
never executed: goto out;
out;
never executed: goto out;
0
358 }-
359-
360 if ((
(r = sshbuf_co...(buf, 1)) != 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
r = sshbuf_consume_end(buf, 1)) != 0
(r = sshbuf_co...(buf, 1)) != 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • ssh-keygen
  • test_sshbuf
)
0-12
361 goto
never executed: goto out;
out;
never executed: goto out;
0
362 r = 0;-
363 out:
code before this statement executed 12 times by 2 tests: out:
Executed by:
  • ssh-keygen
  • test_sshbuf
12
364 -
365__builtin_va_end(-
366ap2-
367)-
368 ;-
369 return
executed 12 times by 2 tests: return r;
Executed by:
  • ssh-keygen
  • test_sshbuf
r;
executed 12 times by 2 tests: return r;
Executed by:
  • ssh-keygen
  • test_sshbuf
12
370}-
371-
372int-
373sshbuf_put_u64(struct sshbuf *buf, u_int64_t val)-
374{-
375 u_char *p;-
376 int r;-
377-
378 if ((
(r = sshbuf_re...f, 8, &p)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 168 times by 3 tests
Evaluated by:
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_reserve(buf, 8, &p)) < 0
(r = sshbuf_re...f, 8, &p)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 168 times by 3 tests
Evaluated by:
  • test_kex
  • test_sshbuf
  • test_sshkey
)
1-168
379 return
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
1
380 do { const u_int64_t __v = (val); ((u_char *)(p))[0] = (__v >> 56) & 0xff; ((u_char *)(p))[1] = (__v >> 48) & 0xff; ((u_char *)(p))[2] = (__v >> 40) & 0xff; ((u_char *)(p))[3] = (__v >> 32) & 0xff; ((u_char *)(p))[4] = (__v >> 24) & 0xff; ((u_char *)(p))[5] = (__v >> 16) & 0xff; ((u_char *)(p))[6] = (__v >> 8) & 0xff; ((u_char *)(p))[7] = __v & 0xff; } while (0);-
381 return
executed 168 times by 3 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 168 times by 3 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
  • test_sshkey
168
382}-
383-
384int-
385sshbuf_put_u32(struct sshbuf *buf, u_int32_t val)-
386{-
387 u_char *p;-
388 int r;-
389-
390 if ((
(r = sshbuf_re...f, 4, &p)) < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1721 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_reserve(buf, 4, &p)) < 0
(r = sshbuf_re...f, 4, &p)) < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1721 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
)
2-1721
391 return
executed 2 times by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 2 times by 1 test: return r;
Executed by:
  • test_sshbuf
2
392 do { const u_int32_t __v = (val); ((u_char *)(p))[0] = (__v >> 24) & 0xff; ((u_char *)(p))[1] = (__v >> 16) & 0xff; ((u_char *)(p))[2] = (__v >> 8) & 0xff; ((u_char *)(p))[3] = __v & 0xff; } while (0);-
393 return
executed 1721 times by 4 tests: return 0;
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1721 times by 4 tests: return 0;
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
1721
394}-
395-
396int-
397sshbuf_put_u16(struct sshbuf *buf, u_int16_t val)-
398{-
399 u_char *p;-
400 int r;-
401-
402 if ((
(r = sshbuf_re...f, 2, &p)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 11 times by 1 test
Evaluated by:
  • test_sshbuf
r = sshbuf_reserve(buf, 2, &p)) < 0
(r = sshbuf_re...f, 2, &p)) < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 11 times by 1 test
Evaluated by:
  • test_sshbuf
)
1-11
403 return
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 1 time by 1 test: return r;
Executed by:
  • test_sshbuf
1
404 do { const u_int16_t __v = (val); ((u_char *)(p))[0] = (__v >> 8) & 0xff; ((u_char *)(p))[1] = __v & 0xff; } while (0);-
405 return
executed 11 times by 1 test: return 0;
Executed by:
  • test_sshbuf
0;
executed 11 times by 1 test: return 0;
Executed by:
  • test_sshbuf
11
406}-
407-
408int-
409sshbuf_put_u8(struct sshbuf *buf, u_char val)-
410{-
411 u_char *p;-
412 int r;-
413-
414 if ((
(r = sshbuf_re...f, 1, &p)) < 0Description
TRUEnever evaluated
FALSEevaluated 8185580 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_reserve(buf, 1, &p)) < 0
(r = sshbuf_re...f, 1, &p)) < 0Description
TRUEnever evaluated
FALSEevaluated 8185580 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
0-8185580
415 return
never executed: return r;
r;
never executed: return r;
0
416 p[0] = val;-
417 return
executed 8185580 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 8185580 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
8185580
418}-
419-
420int-
421sshbuf_put_string(struct sshbuf *buf, const void *v, size_t len)-
422{-
423 u_char *d;-
424 int r;-
425-
426 if (len > 0x8000000 - 4
len > 0x8000000 - 4Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 6826 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
1-6826
427 ;-
428 return
executed 1 time by 1 test: return -9;
Executed by:
  • test_sshbuf
-9;
executed 1 time by 1 test: return -9;
Executed by:
  • test_sshbuf
1
429 }-
430 if ((
(r = sshbuf_re... + 4, &d)) < 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 6823 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_reserve(buf, len + 4, &d)) < 0
(r = sshbuf_re... + 4, &d)) < 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 6823 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
3-6823
431 return
executed 3 times by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 3 times by 1 test: return r;
Executed by:
  • test_sshbuf
3
432 do { const u_int32_t __v = (len); ((u_char *)(d))[0] = (__v >> 24) & 0xff; ((u_char *)(d))[1] = (__v >> 16) & 0xff; ((u_char *)(d))[2] = (__v >> 8) & 0xff; ((u_char *)(d))[3] = __v & 0xff; } while (0);-
433 if (len != 0
len != 0Description
TRUEevaluated 6330 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 493 times by 3 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshkey
)
493-6330
434 memcpy(d + 4, v, len);
executed 6330 times by 5 tests: memcpy(d + 4, v, len);
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
6330
435 return
executed 6823 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 6823 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
6823
436}-
437-
438int-
439sshbuf_put_cstring(struct sshbuf *buf, const char *v)-
440{-
441 return
executed 3105 times by 5 tests: return sshbuf_put_string(buf, v, v == ((void *)0) ? 0 : strlen(v));
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
sshbuf_put_string(buf, v, v ==
executed 3105 times by 5 tests: return sshbuf_put_string(buf, v, v == ((void *)0) ? 0 : strlen(v));
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
3105
442 ((void *)0)
executed 3105 times by 5 tests: return sshbuf_put_string(buf, v, v == ((void *)0) ? 0 : strlen(v));
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
3105
443 ? 0 : strlen(v));
executed 3105 times by 5 tests: return sshbuf_put_string(buf, v, v == ((void *)0) ? 0 : strlen(v));
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
3105
444}-
445-
446int-
447sshbuf_put_stringb(struct sshbuf *buf, const struct sshbuf *v)-
448{-
449 return
executed 279 times by 4 tests: return sshbuf_put_string(buf, sshbuf_ptr(v), sshbuf_len(v));
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
sshbuf_put_string(buf, sshbuf_ptr(v), sshbuf_len(v));
executed 279 times by 4 tests: return sshbuf_put_string(buf, sshbuf_ptr(v), sshbuf_len(v));
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
279
450}-
451-
452int-
453sshbuf_froms(struct sshbuf *buf, struct sshbuf **bufp)-
454{-
455 const u_char *p;-
456 size_t len;-
457 struct sshbuf *ret;-
458 int r;-
459-
460 if (buf ==
buf == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 91140 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0-91140
461 ((void *)0)
buf == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 91140 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0-91140
462 || bufp ==
bufp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 91140 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0-91140
463 ((void *)0)
bufp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 91140 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0-91140
464 )-
465 return
never executed: return -10;
-10;
never executed: return -10;
0
466 *bufp = -
467 ((void *)0)-
468 ;-
469 if ((
(r = sshbuf_pe...p, &len)) != 0Description
TRUEevaluated 2157 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_peek_string_direct(buf, &p, &len)) != 0
(r = sshbuf_pe...p, &len)) != 0Description
TRUEevaluated 2157 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
2157-88983
470 return
executed 2157 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 2157 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
2157
471 if ((
(ret = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
ret = sshbuf_from(p, len)) ==
(ret = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0-88983
472 ((void *)0)
(ret = sshbuf_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0-88983
473 )-
474 return
never executed: return -2;
-2;
never executed: return -2;
0
475 if ((
(r = sshbuf_co...len + 4)) != 0Description
TRUEnever evaluated
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_consume(buf, len + 4)) != 0
(r = sshbuf_co...len + 4)) != 0Description
TRUEnever evaluated
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
||
0-88983
476 (
(r = sshbuf_se...et, buf)) != 0Description
TRUEnever evaluated
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_set_parent(ret, buf)) != 0
(r = sshbuf_se...et, buf)) != 0Description
TRUEnever evaluated
FALSEevaluated 88983 times by 4 tests
Evaluated by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
0-88983
477 sshbuf_free(ret);-
478 return
never executed: return r;
r;
never executed: return r;
0
479 }-
480 *bufp = ret;-
481 return
executed 88983 times by 4 tests: return 0;
Executed by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 88983 times by 4 tests: return 0;
Executed by:
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
88983
482}-
483-
484int-
485sshbuf_put_bignum2_bytes(struct sshbuf *buf, const void *v, size_t len)-
486{-
487 u_char *d;-
488 const u_char *s = (const u_char *)v;-
489 int r, prepend;-
490-
491 if (len > 0x8000000 - 5
len > 0x8000000 - 5Description
TRUEnever evaluated
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
) {
0-46
492 ;-
493 return
never executed: return -9;
-9;
never executed: return -9;
0
494 }-
495-
496 for (; len > 0
len > 0Description
TRUEevaluated 50 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
&& *
*s == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 44 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
s == 0
*s == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 44 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
; len--, s++)
2-50
497 ;
executed 6 times by 1 test: ;
Executed by:
  • test_sshbuf
6
498-
499-
500-
501-
502 prepend = len > 0
len > 0Description
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
&& (
(s[0] & 0x80) != 0Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
s[0] & 0x80) != 0
(s[0] & 0x80) != 0Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
;
2-44
503 if ((
(r = sshbuf_re...pend, &d)) < 0Description
TRUEnever evaluated
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
r = sshbuf_reserve(buf, len + 4 + prepend, &d)) < 0
(r = sshbuf_re...pend, &d)) < 0Description
TRUEnever evaluated
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
)
0-46
504 return
never executed: return r;
r;
never executed: return r;
0
505 do { const u_int32_t __v = (len + prepend); ((u_char *)(d))[0] = (__v >> 24) & 0xff; ((u_char *)(d))[1] = (__v >> 16) & 0xff; ((u_char *)(d))[2] = (__v >> 8) & 0xff; ((u_char *)(d))[3] = __v & 0xff; } while (0);-
506 if (prepend
prependDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
)
22-24
507 d[4] = 0;
executed 22 times by 2 tests: d[4] = 0;
Executed by:
  • test_kex
  • test_sshbuf
22
508 if (len != 0
len != 0Description
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • test_kex
  • test_sshbuf
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
)
2-44
509 memcpy(d + 4 + prepend, s, len);
executed 44 times by 2 tests: memcpy(d + 4 + prepend, s, len);
Executed by:
  • test_kex
  • test_sshbuf
44
510 return
executed 46 times by 2 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
0;
executed 46 times by 2 tests: return 0;
Executed by:
  • test_kex
  • test_sshbuf
46
511}-
512-
513int-
514sshbuf_get_bignum2_bytes_direct(struct sshbuf *buf,-
515 const u_char **valp, size_t *lenp)-
516{-
517 const u_char *d;-
518 size_t len, olen;-
519 int r;-
520-
521 if ((
(r = sshbuf_pe...d, &olen)) < 0Description
TRUEevaluated 1242165 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 65080 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_peek_string_direct(buf, &d, &olen)) < 0
(r = sshbuf_pe...d, &olen)) < 0Description
TRUEevaluated 1242165 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 65080 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
65080-1242165
522 return
executed 1242165 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 1242165 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
1242165
523 len = olen;-
524-
525 if ((len != 0
len != 0Description
TRUEevaluated 65078 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshkey
&& (*
(*d & 0x80) != 0Description
TRUEevaluated 295 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64783 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
d & 0x80) != 0
(*d & 0x80) != 0Description
TRUEevaluated 295 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64783 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
))
2-65078
526 return
executed 295 times by 2 tests: return -5;
Executed by:
  • test_sshbuf
  • test_sshkey
-5;
executed 295 times by 2 tests: return -5;
Executed by:
  • test_sshbuf
  • test_sshkey
295
527-
528 if (len > (16384 / 8) + 1
len > (16384 / 8) + 1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
||
1-64784
529 (len == (16384 / 8) + 1
len == (16384 / 8) + 1Description
TRUEnever evaluated
FALSEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
&& *
*d != 0Description
TRUEnever evaluated
FALSEnever evaluated
d != 0
*d != 0Description
TRUEnever evaluated
FALSEnever evaluated
))
0-64784
530 return
executed 1 time by 1 test: return -7;
Executed by:
  • test_sshbuf
-7;
executed 1 time by 1 test: return -7;
Executed by:
  • test_sshbuf
1
531-
532 while (len > 0
len > 0Description
TRUEevaluated 117796 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 12 times by 1 test
Evaluated by:
  • test_sshkey
&& *
*d == 0x00Description
TRUEevaluated 53024 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64772 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
d == 0x00
*d == 0x00Description
TRUEevaluated 53024 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64772 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
12-117796
533 d++;-
534 len--;-
535 }
executed 53024 times by 6 tests: end of block
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
53024
536 if (valp !=
valp != ((void *)0)Description
TRUEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-64784
537 ((void *)0)
valp != ((void *)0)Description
TRUEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-64784
538 )-
539 *
executed 64784 times by 6 tests: *valp = d;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
valp = d;
executed 64784 times by 6 tests: *valp = d;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
64784
540 if (lenp !=
lenp != ((void *)0)Description
TRUEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-64784
541 ((void *)0)
lenp != ((void *)0)Description
TRUEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-64784
542 )-
543 *
executed 64784 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
lenp = len;
executed 64784 times by 6 tests: *lenp = len;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
64784
544 if (sshbuf_consume(buf, olen + 4) != 0
sshbuf_consume...olen + 4) != 0Description
TRUEnever evaluated
FALSEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
0-64784
545-
546 ;-
547 ;-
548 return
never executed: return -1;
-1;
never executed: return -1;
0
549 }-
550 return
executed 64784 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 64784 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
64784
551}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2