idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
10,400 | ssh_remote_ipaddr(struct ssh *ssh)
{
/* Check whether we have cached the ipaddr. */
if (ssh->remote_ipaddr == NULL)
ssh->remote_ipaddr = ssh_packet_connection_is_on_socket(ssh) ?
get_peer_ipaddr(ssh->state->connection_in) :
strdup("UNKNOWN");
if (ssh->remote_ipaddr == NULL)
return "UNKNOWN";
return ... | DoS Overflow | 0 | ssh_remote_ipaddr(struct ssh *ssh)
{
/* Check whether we have cached the ipaddr. */
if (ssh->remote_ipaddr == NULL)
ssh->remote_ipaddr = ssh_packet_connection_is_on_socket(ssh) ?
get_peer_ipaddr(ssh->state->connection_in) :
strdup("UNKNOWN");
if (ssh->remote_ipaddr == NULL)
return "UNKNOWN";
return ... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,401 | sshpkt_disconnect(struct ssh *ssh, const char *fmt,...)
{
char buf[1024];
va_list args;
int r;
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
if (compat20) {
if ((r = sshpkt_start(ssh, SSH2_MSG_DISCONNECT)) != 0 ||
(r = sshpkt_put_u32(ssh, SSH2_DISCONNECT_PROTOCOL_ERROR)) !=... | DoS Overflow | 0 | sshpkt_disconnect(struct ssh *ssh, const char *fmt,...)
{
char buf[1024];
va_list args;
int r;
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
if (compat20) {
if ((r = sshpkt_start(ssh, SSH2_MSG_DISCONNECT)) != 0 ||
(r = sshpkt_put_u32(ssh, SSH2_DISCONNECT_PROTOCOL_ERROR)) !=... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,402 | sshpkt_fatal(struct ssh *ssh, const char *tag, int r)
{
switch (r) {
case SSH_ERR_CONN_CLOSED:
logit("Connection closed by %.200s", ssh_remote_ipaddr(ssh));
cleanup_exit(255);
case SSH_ERR_CONN_TIMEOUT:
logit("Connection to %.200s timed out", ssh_remote_ipaddr(ssh));
cleanup_exit(255);
case SSH_ERR_DISCONNE... | DoS Overflow | 0 | sshpkt_fatal(struct ssh *ssh, const char *tag, int r)
{
switch (r) {
case SSH_ERR_CONN_CLOSED:
logit("Connection closed by %.200s", ssh_remote_ipaddr(ssh));
cleanup_exit(255);
case SSH_ERR_CONN_TIMEOUT:
logit("Connection to %.200s timed out", ssh_remote_ipaddr(ssh));
cleanup_exit(255);
case SSH_ERR_DISCONNE... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,403 | sshpkt_get(struct ssh *ssh, void *valp, size_t len)
{
return sshbuf_get(ssh->state->incoming_packet, valp, len);
}
| DoS Overflow | 0 | sshpkt_get(struct ssh *ssh, void *valp, size_t len)
{
return sshbuf_get(ssh->state->incoming_packet, valp, len);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,404 | sshpkt_get_bignum1(struct ssh *ssh, BIGNUM *v)
{
return sshbuf_get_bignum1(ssh->state->incoming_packet, v);
}
| DoS Overflow | 0 | sshpkt_get_bignum1(struct ssh *ssh, BIGNUM *v)
{
return sshbuf_get_bignum1(ssh->state->incoming_packet, v);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,405 | sshpkt_get_bignum2(struct ssh *ssh, BIGNUM *v)
{
return sshbuf_get_bignum2(ssh->state->incoming_packet, v);
}
| DoS Overflow | 0 | sshpkt_get_bignum2(struct ssh *ssh, BIGNUM *v)
{
return sshbuf_get_bignum2(ssh->state->incoming_packet, v);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,406 | sshpkt_get_cstring(struct ssh *ssh, char **valp, size_t *lenp)
{
return sshbuf_get_cstring(ssh->state->incoming_packet, valp, lenp);
}
| DoS Overflow | 0 | sshpkt_get_cstring(struct ssh *ssh, char **valp, size_t *lenp)
{
return sshbuf_get_cstring(ssh->state->incoming_packet, valp, lenp);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,407 | sshpkt_get_ec(struct ssh *ssh, EC_POINT *v, const EC_GROUP *g)
{
return sshbuf_get_ec(ssh->state->incoming_packet, v, g);
}
| DoS Overflow | 0 | sshpkt_get_ec(struct ssh *ssh, EC_POINT *v, const EC_GROUP *g)
{
return sshbuf_get_ec(ssh->state->incoming_packet, v, g);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,408 | sshpkt_get_end(struct ssh *ssh)
{
if (sshbuf_len(ssh->state->incoming_packet) > 0)
return SSH_ERR_UNEXPECTED_TRAILING_DATA;
return 0;
}
| DoS Overflow | 0 | sshpkt_get_end(struct ssh *ssh)
{
if (sshbuf_len(ssh->state->incoming_packet) > 0)
return SSH_ERR_UNEXPECTED_TRAILING_DATA;
return 0;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,409 | sshpkt_get_string(struct ssh *ssh, u_char **valp, size_t *lenp)
{
return sshbuf_get_string(ssh->state->incoming_packet, valp, lenp);
}
| DoS Overflow | 0 | sshpkt_get_string(struct ssh *ssh, u_char **valp, size_t *lenp)
{
return sshbuf_get_string(ssh->state->incoming_packet, valp, lenp);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,410 | sshpkt_get_string_direct(struct ssh *ssh, const u_char **valp, size_t *lenp)
{
return sshbuf_get_string_direct(ssh->state->incoming_packet, valp, lenp);
}
| DoS Overflow | 0 | sshpkt_get_string_direct(struct ssh *ssh, const u_char **valp, size_t *lenp)
{
return sshbuf_get_string_direct(ssh->state->incoming_packet, valp, lenp);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,411 | sshpkt_get_u32(struct ssh *ssh, u_int32_t *valp)
{
return sshbuf_get_u32(ssh->state->incoming_packet, valp);
}
| DoS Overflow | 0 | sshpkt_get_u32(struct ssh *ssh, u_int32_t *valp)
{
return sshbuf_get_u32(ssh->state->incoming_packet, valp);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,412 | sshpkt_get_u64(struct ssh *ssh, u_int64_t *valp)
{
return sshbuf_get_u64(ssh->state->incoming_packet, valp);
}
| DoS Overflow | 0 | sshpkt_get_u64(struct ssh *ssh, u_int64_t *valp)
{
return sshbuf_get_u64(ssh->state->incoming_packet, valp);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,413 | sshpkt_ptr(struct ssh *ssh, size_t *lenp)
{
if (lenp != NULL)
*lenp = sshbuf_len(ssh->state->incoming_packet);
return sshbuf_ptr(ssh->state->incoming_packet);
}
| DoS Overflow | 0 | sshpkt_ptr(struct ssh *ssh, size_t *lenp)
{
if (lenp != NULL)
*lenp = sshbuf_len(ssh->state->incoming_packet);
return sshbuf_ptr(ssh->state->incoming_packet);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,414 | sshpkt_put(struct ssh *ssh, const void *v, size_t len)
{
return sshbuf_put(ssh->state->outgoing_packet, v, len);
}
| DoS Overflow | 0 | sshpkt_put(struct ssh *ssh, const void *v, size_t len)
{
return sshbuf_put(ssh->state->outgoing_packet, v, len);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,415 | sshpkt_put_bignum1(struct ssh *ssh, const BIGNUM *v)
{
return sshbuf_put_bignum1(ssh->state->outgoing_packet, v);
}
| DoS Overflow | 0 | sshpkt_put_bignum1(struct ssh *ssh, const BIGNUM *v)
{
return sshbuf_put_bignum1(ssh->state->outgoing_packet, v);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,416 | sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v)
{
return sshbuf_put_bignum2(ssh->state->outgoing_packet, v);
}
| DoS Overflow | 0 | sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v)
{
return sshbuf_put_bignum2(ssh->state->outgoing_packet, v);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,417 | sshpkt_put_cstring(struct ssh *ssh, const void *v)
{
return sshbuf_put_cstring(ssh->state->outgoing_packet, v);
}
| DoS Overflow | 0 | sshpkt_put_cstring(struct ssh *ssh, const void *v)
{
return sshbuf_put_cstring(ssh->state->outgoing_packet, v);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,418 | sshpkt_put_ec(struct ssh *ssh, const EC_POINT *v, const EC_GROUP *g)
{
return sshbuf_put_ec(ssh->state->outgoing_packet, v, g);
}
| DoS Overflow | 0 | sshpkt_put_ec(struct ssh *ssh, const EC_POINT *v, const EC_GROUP *g)
{
return sshbuf_put_ec(ssh->state->outgoing_packet, v, g);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,419 | sshpkt_put_string(struct ssh *ssh, const void *v, size_t len)
{
return sshbuf_put_string(ssh->state->outgoing_packet, v, len);
}
| DoS Overflow | 0 | sshpkt_put_string(struct ssh *ssh, const void *v, size_t len)
{
return sshbuf_put_string(ssh->state->outgoing_packet, v, len);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,420 | sshpkt_put_stringb(struct ssh *ssh, const struct sshbuf *v)
{
return sshbuf_put_stringb(ssh->state->outgoing_packet, v);
}
| DoS Overflow | 0 | sshpkt_put_stringb(struct ssh *ssh, const struct sshbuf *v)
{
return sshbuf_put_stringb(ssh->state->outgoing_packet, v);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,421 | sshpkt_put_u32(struct ssh *ssh, u_int32_t val)
{
return sshbuf_put_u32(ssh->state->outgoing_packet, val);
}
| DoS Overflow | 0 | sshpkt_put_u32(struct ssh *ssh, u_int32_t val)
{
return sshbuf_put_u32(ssh->state->outgoing_packet, val);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,422 | sshpkt_put_u8(struct ssh *ssh, u_char val)
{
return sshbuf_put_u8(ssh->state->outgoing_packet, val);
}
| DoS Overflow | 0 | sshpkt_put_u8(struct ssh *ssh, u_char val)
{
return sshbuf_put_u8(ssh->state->outgoing_packet, val);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,423 | sshpkt_putb(struct ssh *ssh, const struct sshbuf *b)
{
return sshbuf_putb(ssh->state->outgoing_packet, b);
}
| DoS Overflow | 0 | sshpkt_putb(struct ssh *ssh, const struct sshbuf *b)
{
return sshbuf_putb(ssh->state->outgoing_packet, b);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,424 | sshpkt_send(struct ssh *ssh)
{
if (compat20)
return ssh_packet_send2(ssh);
else
return ssh_packet_send1(ssh);
}
| DoS Overflow | 0 | sshpkt_send(struct ssh *ssh)
{
if (compat20)
return ssh_packet_send2(ssh);
else
return ssh_packet_send1(ssh);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,425 | sshpkt_start(struct ssh *ssh, u_char type)
{
u_char buf[9];
int len;
DBG(debug("packet_start[%d]", type));
len = compat20 ? 6 : 9;
memset(buf, 0, len - 1);
buf[len - 1] = type;
sshbuf_reset(ssh->state->outgoing_packet);
return sshbuf_put(ssh->state->outgoing_packet, buf, len);
}
| DoS Overflow | 0 | sshpkt_start(struct ssh *ssh, u_char type)
{
u_char buf[9];
int len;
DBG(debug("packet_start[%d]", type));
len = compat20 ? 6 : 9;
memset(buf, 0, len - 1);
buf[len - 1] = type;
sshbuf_reset(ssh->state->outgoing_packet);
return sshbuf_put(ssh->state->outgoing_packet, buf, len);
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,426 | start_compression_in(struct ssh *ssh)
{
if (ssh->state->compression_in_started == 1)
inflateEnd(&ssh->state->compression_in_stream);
switch (inflateInit(&ssh->state->compression_in_stream)) {
case Z_OK:
ssh->state->compression_in_started = 1;
break;
case Z_MEM_ERROR:
return SSH_ERR_ALLOC_FAIL;
default:
r... | DoS Overflow | 0 | start_compression_in(struct ssh *ssh)
{
if (ssh->state->compression_in_started == 1)
inflateEnd(&ssh->state->compression_in_stream);
switch (inflateInit(&ssh->state->compression_in_stream)) {
case Z_OK:
ssh->state->compression_in_started = 1;
break;
case Z_MEM_ERROR:
return SSH_ERR_ALLOC_FAIL;
default:
r... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,427 | start_compression_out(struct ssh *ssh, int level)
{
if (level < 1 || level > 9)
return SSH_ERR_INVALID_ARGUMENT;
debug("Enabling compression at level %d.", level);
if (ssh->state->compression_out_started == 1)
deflateEnd(&ssh->state->compression_out_stream);
switch (deflateInit(&ssh->state->compression_out_stre... | DoS Overflow | 0 | start_compression_out(struct ssh *ssh, int level)
{
if (level < 1 || level > 9)
return SSH_ERR_INVALID_ARGUMENT;
debug("Enabling compression at level %d.", level);
if (ssh->state->compression_out_started == 1)
deflateEnd(&ssh->state->compression_out_stream);
switch (deflateInit(&ssh->state->compression_out_stre... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,428 | uncompress_buffer(struct ssh *ssh, struct sshbuf *in, struct sshbuf *out)
{
u_char buf[4096];
int r, status;
if (ssh->state->compression_in_started != 1)
return SSH_ERR_INTERNAL_ERROR;
if ((ssh->state->compression_in_stream.next_in =
sshbuf_mutable_ptr(in)) == NULL)
return SSH_ERR_INTERNAL_ERROR;
ssh->s... | DoS Overflow | 0 | uncompress_buffer(struct ssh *ssh, struct sshbuf *in, struct sshbuf *out)
{
u_char buf[4096];
int r, status;
if (ssh->state->compression_in_started != 1)
return SSH_ERR_INTERNAL_ERROR;
if ((ssh->state->compression_in_stream.next_in =
sshbuf_mutable_ptr(in)) == NULL)
return SSH_ERR_INTERNAL_ERROR;
ssh->s... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.216 2015/10/21 11:33:03 gsoares Exp $ */
+/* $OpenBSD: packet.c,v 1.217 2015/11/08 21:59:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1581,6 +1581,7 @@ ssh_packet_read_poll2(struct ssh *ssh, ... | CWE-119 | null | null |
10,429 | _gcry_pk_ecc_get_sexp (gcry_sexp_t *r_sexp, int mode, mpi_ec_t ec)
{
gpg_err_code_t rc;
gcry_mpi_t mpi_G = NULL;
gcry_mpi_t mpi_Q = NULL;
if (!ec->p || !ec->a || !ec->b || !ec->G || !ec->n || !ec->h)
return GPG_ERR_BAD_CRYPT_CTX;
if (mode == GCRY_PK_GET_SECKEY && !ec->d)
return GPG_ERR_NO_SECKEY;
... | +Info | 0 | _gcry_pk_ecc_get_sexp (gcry_sexp_t *r_sexp, int mode, mpi_ec_t ec)
{
gpg_err_code_t rc;
gcry_mpi_t mpi_G = NULL;
gcry_mpi_t mpi_Q = NULL;
if (!ec->p || !ec->a || !ec->b || !ec->G || !ec->n || !ec->h)
return GPG_ERR_BAD_CRYPT_CTX;
if (mode == GCRY_PK_GET_SECKEY && !ec->d)
return GPG_ERR_NO_SECKEY;
... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,430 | check_secret_key (ECC_secret_key *sk, mpi_ec_t ec, int flags)
{
int rc = 1;
mpi_point_struct Q;
gcry_mpi_t x1, y1;
gcry_mpi_t x2 = NULL;
gcry_mpi_t y2 = NULL;
point_init (&Q);
x1 = mpi_new (0);
if (ec->model == MPI_EC_MONTGOMERY)
y1 = NULL;
else
y1 = mpi_new (0);
/* G in E(F_p) */
if (!_... | +Info | 0 | check_secret_key (ECC_secret_key *sk, mpi_ec_t ec, int flags)
{
int rc = 1;
mpi_point_struct Q;
gcry_mpi_t x1, y1;
gcry_mpi_t x2 = NULL;
gcry_mpi_t y2 = NULL;
point_init (&Q);
x1 = mpi_new (0);
if (ec->model == MPI_EC_MONTGOMERY)
y1 = NULL;
else
y1 = mpi_new (0);
/* G in E(F_p) */
if (!_... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,431 | compute_keygrip (gcry_md_hd_t md, gcry_sexp_t keyparms)
{
#define N_COMPONENTS 7
static const char names[N_COMPONENTS] = "pabgnhq";
gpg_err_code_t rc;
gcry_sexp_t l1;
gcry_mpi_t values[N_COMPONENTS];
int idx;
char *curvename = NULL;
int flags = 0;
enum gcry_mpi_ec_models model = 0;
enum ecc_dialects d... | +Info | 0 | compute_keygrip (gcry_md_hd_t md, gcry_sexp_t keyparms)
{
#define N_COMPONENTS 7
static const char names[N_COMPONENTS] = "pabgnhq";
gpg_err_code_t rc;
gcry_sexp_t l1;
gcry_mpi_t values[N_COMPONENTS];
int idx;
char *curvename = NULL;
int flags = 0;
enum gcry_mpi_ec_models model = 0;
enum ecc_dialects d... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,432 | ecc_check_secret_key (gcry_sexp_t keyparms)
{
gcry_err_code_t rc;
gcry_sexp_t l1 = NULL;
int flags = 0;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
ECC_secret_key sk;
mpi_ec_t ec = NULL;
memset (&sk, 0, sizeof sk);
/* Look for flags. */
l1 = sexp_find_token (keyparm... | +Info | 0 | ecc_check_secret_key (gcry_sexp_t keyparms)
{
gcry_err_code_t rc;
gcry_sexp_t l1 = NULL;
int flags = 0;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
ECC_secret_key sk;
mpi_ec_t ec = NULL;
memset (&sk, 0, sizeof sk);
/* Look for flags. */
l1 = sexp_find_token (keyparm... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,433 | ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms)
{
unsigned int nbits;
gcry_err_code_t rc;
struct pk_encoding_ctx ctx;
gcry_sexp_t l1 = NULL;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
gcry_mpi_t mpi_s = NULL;
gcry_mpi_t mpi_e = NULL;
gcr... | +Info | 0 | ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms)
{
unsigned int nbits;
gcry_err_code_t rc;
struct pk_encoding_ctx ctx;
gcry_sexp_t l1 = NULL;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
gcry_mpi_t mpi_s = NULL;
gcry_mpi_t mpi_e = NULL;
gcr... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,434 | ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey)
{
gpg_err_code_t rc;
unsigned int nbits;
elliptic_curve_t E;
ECC_secret_key sk;
gcry_mpi_t Gx = NULL;
gcry_mpi_t Gy = NULL;
gcry_mpi_t Qx = NULL;
gcry_mpi_t Qy = NULL;
char *curve_name = NULL;
gcry_sexp_t l1;
mpi_ec_t ctx = NULL;
gcr... | +Info | 0 | ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey)
{
gpg_err_code_t rc;
unsigned int nbits;
elliptic_curve_t E;
ECC_secret_key sk;
gcry_mpi_t Gx = NULL;
gcry_mpi_t Gy = NULL;
gcry_mpi_t Qx = NULL;
gcry_mpi_t Qy = NULL;
char *curve_name = NULL;
gcry_sexp_t l1;
mpi_ec_t ctx = NULL;
gcr... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,435 | ecc_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms)
{
gcry_err_code_t rc;
struct pk_encoding_ctx ctx;
gcry_mpi_t data = NULL;
gcry_sexp_t l1 = NULL;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
ECC_secret_key sk;
gcry_mpi_t sig_r = NULL;
gcry_mpi_t si... | +Info | 0 | ecc_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms)
{
gcry_err_code_t rc;
struct pk_encoding_ctx ctx;
gcry_mpi_t data = NULL;
gcry_sexp_t l1 = NULL;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
ECC_secret_key sk;
gcry_mpi_t sig_r = NULL;
gcry_mpi_t si... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,436 | ecc_verify (gcry_sexp_t s_sig, gcry_sexp_t s_data, gcry_sexp_t s_keyparms)
{
gcry_err_code_t rc;
struct pk_encoding_ctx ctx;
gcry_sexp_t l1 = NULL;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
gcry_mpi_t sig_r = NULL;
gcry_mpi_t sig_s = NULL;
gcry_mpi_t data = NULL;
ECC_... | +Info | 0 | ecc_verify (gcry_sexp_t s_sig, gcry_sexp_t s_data, gcry_sexp_t s_keyparms)
{
gcry_err_code_t rc;
struct pk_encoding_ctx ctx;
gcry_sexp_t l1 = NULL;
char *curvename = NULL;
gcry_mpi_t mpi_g = NULL;
gcry_mpi_t mpi_q = NULL;
gcry_mpi_t sig_r = NULL;
gcry_mpi_t sig_s = NULL;
gcry_mpi_t data = NULL;
ECC_... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,437 | nist_generate_key (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx,
int flags, unsigned int nbits,
gcry_mpi_t *r_x, gcry_mpi_t *r_y)
{
mpi_point_struct Q;
gcry_random_level_t random_level;
gcry_mpi_t x, y;
const unsigned int pbits = mpi_get_nbits (E->p);
point_init... | +Info | 0 | nist_generate_key (ECC_secret_key *sk, elliptic_curve_t *E, mpi_ec_t ctx,
int flags, unsigned int nbits,
gcry_mpi_t *r_x, gcry_mpi_t *r_y)
{
mpi_point_struct Q;
gcry_random_level_t random_level;
gcry_mpi_t x, y;
const unsigned int pbits = mpi_get_nbits (E->p);
point_init... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,438 | run_selftests (int algo, int extended, selftest_report_func_t report)
{
(void)extended;
if (algo != GCRY_PK_ECC)
return GPG_ERR_PUBKEY_ALGO;
return selftests_ecdsa (report);
}
| +Info | 0 | run_selftests (int algo, int extended, selftest_report_func_t report)
{
(void)extended;
if (algo != GCRY_PK_ECC)
return GPG_ERR_PUBKEY_ALGO;
return selftests_ecdsa (report);
}
| @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,439 | selftest_sign (gcry_sexp_t pkey, gcry_sexp_t skey)
{
/* Sample data from RFC 6979 section A.2.5, hash is of message "sample" */
static const char sample_data[] =
"(data (flags rfc6979)"
" (hash sha256 #af2bdbe1aa9b6ec1e2ade1d694f41fc71a831d0268e98915"
/**/ "62113d8a62add1bf#))";
static const... | +Info | 0 | selftest_sign (gcry_sexp_t pkey, gcry_sexp_t skey)
{
/* Sample data from RFC 6979 section A.2.5, hash is of message "sample" */
static const char sample_data[] =
"(data (flags rfc6979)"
" (hash sha256 #af2bdbe1aa9b6ec1e2ade1d694f41fc71a831d0268e98915"
/**/ "62113d8a62add1bf#))";
static const... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,440 | selftests_ecdsa (selftest_report_func_t report)
{
const char *what;
const char *errtxt;
gcry_error_t err;
gcry_sexp_t skey = NULL;
gcry_sexp_t pkey = NULL;
what = "convert";
err = sexp_sscan (&skey, NULL, sample_secret_key_secp256,
strlen (sample_secret_key_secp256));
if (!err)
... | +Info | 0 | selftests_ecdsa (selftest_report_func_t report)
{
const char *what;
const char *errtxt;
gcry_error_t err;
gcry_sexp_t skey = NULL;
gcry_sexp_t pkey = NULL;
what = "convert";
err = sexp_sscan (&skey, NULL, sample_secret_key_secp256,
strlen (sample_secret_key_secp256));
if (!err)
... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,441 | test_ecdh_only_keys (ECC_secret_key *sk, unsigned int nbits, int flags)
{
ECC_public_key pk;
gcry_mpi_t test;
mpi_point_struct R_;
gcry_mpi_t x0, x1;
mpi_ec_t ec;
if (DBG_CIPHER)
log_debug ("Testing ECDH only key.\n");
point_init (&R_);
pk.E = _gcry_ecc_curve_copy (sk->E);
point_init (&pk.Q);
... | +Info | 0 | test_ecdh_only_keys (ECC_secret_key *sk, unsigned int nbits, int flags)
{
ECC_public_key pk;
gcry_mpi_t test;
mpi_point_struct R_;
gcry_mpi_t x0, x1;
mpi_ec_t ec;
if (DBG_CIPHER)
log_debug ("Testing ECDH only key.\n");
point_init (&R_);
pk.E = _gcry_ecc_curve_copy (sk->E);
point_init (&pk.Q);
... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,442 | test_keys (ECC_secret_key *sk, unsigned int nbits)
{
ECC_public_key pk;
gcry_mpi_t test = mpi_new (nbits);
mpi_point_struct R_;
gcry_mpi_t c = mpi_new (nbits);
gcry_mpi_t out = mpi_new (nbits);
gcry_mpi_t r = mpi_new (nbits);
gcry_mpi_t s = mpi_new (nbits);
if (DBG_CIPHER)
log_debug ("Testing key.\... | +Info | 0 | test_keys (ECC_secret_key *sk, unsigned int nbits)
{
ECC_public_key pk;
gcry_mpi_t test = mpi_new (nbits);
mpi_point_struct R_;
gcry_mpi_t c = mpi_new (nbits);
gcry_mpi_t out = mpi_new (nbits);
gcry_mpi_t r = mpi_new (nbits);
gcry_mpi_t s = mpi_new (nbits);
if (DBG_CIPHER)
log_debug ("Testing key.\... | @@ -1628,9 +1628,22 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!(flags & PUBKEY_FLAG_DJB_TWEAK)
+ if ((flags & PUBKEY_FLAG_DJB_TWEAK))
+ {
/* For X25519, by its definition, validation shou... | CWE-200 | null | null |
10,443 | _gcry_mpi_point_free_parts (mpi_point_t p)
{
mpi_free (p->x); p->x = NULL;
mpi_free (p->y); p->y = NULL;
mpi_free (p->z); p->z = NULL;
}
| +Info | 0 | _gcry_mpi_point_free_parts (mpi_point_t p)
{
mpi_free (p->x); p->x = NULL;
mpi_free (p->y); p->y = NULL;
mpi_free (p->z); p->z = NULL;
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,444 | _gcry_mpi_point_get (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z,
mpi_point_t point)
{
if (x)
mpi_set (x, point->x);
if (y)
mpi_set (y, point->y);
if (z)
mpi_set (z, point->z);
}
| +Info | 0 | _gcry_mpi_point_get (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z,
mpi_point_t point)
{
if (x)
mpi_set (x, point->x);
if (y)
mpi_set (y, point->y);
if (z)
mpi_set (z, point->z);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,445 | _gcry_mpi_point_init (mpi_point_t p)
{
p->x = mpi_new (0);
p->y = mpi_new (0);
p->z = mpi_new (0);
}
| +Info | 0 | _gcry_mpi_point_init (mpi_point_t p)
{
p->x = mpi_new (0);
p->y = mpi_new (0);
p->z = mpi_new (0);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,446 | _gcry_mpi_point_log (const char *name, mpi_point_t point, mpi_ec_t ctx)
{
gcry_mpi_t x, y;
char buf[100];
if (!point)
{
snprintf (buf, sizeof buf - 1, "%s.*", name);
log_mpidump (buf, NULL);
return;
}
snprintf (buf, sizeof buf - 1, "%s.X", name);
if (ctx)
{
x = mpi_new (0... | +Info | 0 | _gcry_mpi_point_log (const char *name, mpi_point_t point, mpi_ec_t ctx)
{
gcry_mpi_t x, y;
char buf[100];
if (!point)
{
snprintf (buf, sizeof buf - 1, "%s.*", name);
log_mpidump (buf, NULL);
return;
}
snprintf (buf, sizeof buf - 1, "%s.X", name);
if (ctx)
{
x = mpi_new (0... | @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,447 | _gcry_mpi_point_new (unsigned int nbits)
{
mpi_point_t p;
(void)nbits; /* Currently not used. */
p = xmalloc (sizeof *p);
_gcry_mpi_point_init (p);
return p;
}
| +Info | 0 | _gcry_mpi_point_new (unsigned int nbits)
{
mpi_point_t p;
(void)nbits; /* Currently not used. */
p = xmalloc (sizeof *p);
_gcry_mpi_point_init (p);
return p;
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,448 | _gcry_mpi_point_release (mpi_point_t p)
{
if (p)
{
_gcry_mpi_point_free_parts (p);
xfree (p);
}
}
| +Info | 0 | _gcry_mpi_point_release (mpi_point_t p)
{
if (p)
{
_gcry_mpi_point_free_parts (p);
xfree (p);
}
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,449 | _gcry_mpi_point_snatch_set (mpi_point_t point,
gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z)
{
if (!point)
point = mpi_point_new (0);
if (x)
mpi_snatch (point->x, x);
else
mpi_clear (point->x);
if (y)
mpi_snatch (point->y, y);
else
mpi_clear (point->y);
if (z)
... | +Info | 0 | _gcry_mpi_point_snatch_set (mpi_point_t point,
gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z)
{
if (!point)
point = mpi_point_new (0);
if (x)
mpi_snatch (point->x, x);
else
mpi_clear (point->x);
if (y)
mpi_snatch (point->y, y);
else
mpi_clear (point->y);
if (z)
... | @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,450 | ec_addm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ctx)
{
mpi_add (w, u, v);
ec_mod (w, ctx);
}
| +Info | 0 | ec_addm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ctx)
{
mpi_add (w, u, v);
ec_mod (w, ctx);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,451 | ec_get_a_is_pminus3 (mpi_ec_t ec)
{
gcry_mpi_t tmp;
if (!ec->t.valid.a_is_pminus3)
{
ec->t.valid.a_is_pminus3 = 1;
tmp = mpi_alloc_like (ec->p);
mpi_sub_ui (tmp, ec->p, 3);
ec->t.a_is_pminus3 = !mpi_cmp (ec->a, tmp);
mpi_free (tmp);
}
return ec->t.a_is_pminus3;
}
| +Info | 0 | ec_get_a_is_pminus3 (mpi_ec_t ec)
{
gcry_mpi_t tmp;
if (!ec->t.valid.a_is_pminus3)
{
ec->t.valid.a_is_pminus3 = 1;
tmp = mpi_alloc_like (ec->p);
mpi_sub_ui (tmp, ec->p, 3);
ec->t.a_is_pminus3 = !mpi_cmp (ec->a, tmp);
mpi_free (tmp);
}
return ec->t.a_is_pminus3;
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,452 | ec_get_two_inv_p (mpi_ec_t ec)
{
if (!ec->t.valid.two_inv_p)
{
ec->t.valid.two_inv_p = 1;
if (!ec->t.two_inv_p)
ec->t.two_inv_p = mpi_alloc (0);
ec_invm (ec->t.two_inv_p, mpi_const (MPI_C_TWO), ec);
}
return ec->t.two_inv_p;
}
| +Info | 0 | ec_get_two_inv_p (mpi_ec_t ec)
{
if (!ec->t.valid.two_inv_p)
{
ec->t.valid.two_inv_p = 1;
if (!ec->t.two_inv_p)
ec->t.two_inv_p = mpi_alloc (0);
ec_invm (ec->t.two_inv_p, mpi_const (MPI_C_TWO), ec);
}
return ec->t.two_inv_p;
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,453 | ec_invm (gcry_mpi_t x, gcry_mpi_t a, mpi_ec_t ctx)
{
if (!mpi_invm (x, a, ctx->p))
{
log_error ("ec_invm: inverse does not exist:\n");
log_mpidump (" a", a);
log_mpidump (" p", ctx->p);
}
}
| +Info | 0 | ec_invm (gcry_mpi_t x, gcry_mpi_t a, mpi_ec_t ctx)
{
if (!mpi_invm (x, a, ctx->p))
{
log_error ("ec_invm: inverse does not exist:\n");
log_mpidump (" a", a);
log_mpidump (" p", ctx->p);
}
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,454 | ec_mul2 (gcry_mpi_t w, gcry_mpi_t u, mpi_ec_t ctx)
{
mpi_lshift (w, u, 1);
ec_mod (w, ctx);
}
| +Info | 0 | ec_mul2 (gcry_mpi_t w, gcry_mpi_t u, mpi_ec_t ctx)
{
mpi_lshift (w, u, 1);
ec_mod (w, ctx);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,455 | ec_mulm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ctx)
{
mpi_mul (w, u, v);
ec_mod (w, ctx);
}
| +Info | 0 | ec_mulm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ctx)
{
mpi_mul (w, u, v);
ec_mod (w, ctx);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,456 | ec_pow2 (gcry_mpi_t w, const gcry_mpi_t b, mpi_ec_t ctx)
{
/* Using mpi_mul is slightly faster (at least on amd64). */
/* mpi_powm (w, b, mpi_const (MPI_C_TWO), ctx->p); */
ec_mulm (w, b, b, ctx);
}
| +Info | 0 | ec_pow2 (gcry_mpi_t w, const gcry_mpi_t b, mpi_ec_t ctx)
{
/* Using mpi_mul is slightly faster (at least on amd64). */
/* mpi_powm (w, b, mpi_const (MPI_C_TWO), ctx->p); */
ec_mulm (w, b, b, ctx);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,457 | ec_pow3 (gcry_mpi_t w, const gcry_mpi_t b, mpi_ec_t ctx)
{
mpi_powm (w, b, mpi_const (MPI_C_THREE), ctx->p);
}
| +Info | 0 | ec_pow3 (gcry_mpi_t w, const gcry_mpi_t b, mpi_ec_t ctx)
{
mpi_powm (w, b, mpi_const (MPI_C_THREE), ctx->p);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,458 | ec_powm (gcry_mpi_t w, const gcry_mpi_t b, const gcry_mpi_t e,
mpi_ec_t ctx)
{
mpi_powm (w, b, e, ctx->p);
/* _gcry_mpi_abs (w); */
}
| +Info | 0 | ec_powm (gcry_mpi_t w, const gcry_mpi_t b, const gcry_mpi_t e,
mpi_ec_t ctx)
{
mpi_powm (w, b, e, ctx->p);
/* _gcry_mpi_abs (w); */
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,459 | ec_subm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ec)
{
mpi_sub (w, u, v);
while (w->sign)
mpi_add (w, w, ec->p);
/*ec_mod (w, ec);*/
}
| +Info | 0 | ec_subm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ec)
{
mpi_sub (w, u, v);
while (w->sign)
mpi_add (w, w, ec->p);
/*ec_mod (w, ec);*/
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,460 | point_set (mpi_point_t d, mpi_point_t s)
{
mpi_set (d->x, s->x);
mpi_set (d->y, s->y);
mpi_set (d->z, s->z);
}
| +Info | 0 | point_set (mpi_point_t d, mpi_point_t s)
{
mpi_set (d->x, s->x);
mpi_set (d->y, s->y);
mpi_set (d->z, s->z);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,461 | point_swap_cond (mpi_point_t d, mpi_point_t s, unsigned long swap,
mpi_ec_t ctx)
{
mpi_swap_cond (d->x, s->x, swap);
if (ctx->model != MPI_EC_MONTGOMERY)
mpi_swap_cond (d->y, s->y, swap);
mpi_swap_cond (d->z, s->z, swap);
}
| +Info | 0 | point_swap_cond (mpi_point_t d, mpi_point_t s, unsigned long swap,
mpi_ec_t ctx)
{
mpi_swap_cond (d->x, s->x, swap);
if (ctx->model != MPI_EC_MONTGOMERY)
mpi_swap_cond (d->y, s->y, swap);
mpi_swap_cond (d->z, s->z, swap);
}
| @@ -382,6 +382,29 @@ ec_get_two_inv_p (mpi_ec_t ec)
}
+static const char *curve25519_bad_points[] = {
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
+ "0x00b8495f16056286fdb1329ceb8d09da6ac49ff1fae35616aeb8413b7c7ae... | CWE-200 | null | null |
10,462 | cf2_builder_cubeTo( CF2_OutlineCallbacks callbacks,
const CF2_CallbackParams params )
{
/* downcast the object pointer */
CF2_Outline outline = (CF2_Outline)callbacks;
CFF_Builder* builder;
FT_ASSERT( outline && outline->decoder );
FT_ASSERT( params->op == CF2_Pa... | DoS | 0 | cf2_builder_cubeTo( CF2_OutlineCallbacks callbacks,
const CF2_CallbackParams params )
{
/* downcast the object pointer */
CF2_Outline outline = (CF2_Outline)callbacks;
CFF_Builder* builder;
FT_ASSERT( outline && outline->decoder );
FT_ASSERT( params->op == CF2_Pa... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,463 | cf2_builder_lineTo( CF2_OutlineCallbacks callbacks,
const CF2_CallbackParams params )
{
/* downcast the object pointer */
CF2_Outline outline = (CF2_Outline)callbacks;
CFF_Builder* builder;
FT_ASSERT( outline && outline->decoder );
FT_ASSERT( params->op == CF2_Pa... | DoS | 0 | cf2_builder_lineTo( CF2_OutlineCallbacks callbacks,
const CF2_CallbackParams params )
{
/* downcast the object pointer */
CF2_Outline outline = (CF2_Outline)callbacks;
CFF_Builder* builder;
FT_ASSERT( outline && outline->decoder );
FT_ASSERT( params->op == CF2_Pa... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,464 | cf2_builder_moveTo( CF2_OutlineCallbacks callbacks,
const CF2_CallbackParams params )
{
/* downcast the object pointer */
CF2_Outline outline = (CF2_Outline)callbacks;
CFF_Builder* builder;
(void)params; /* only used in debug mode */
FT_ASSERT( outline &&... | DoS | 0 | cf2_builder_moveTo( CF2_OutlineCallbacks callbacks,
const CF2_CallbackParams params )
{
/* downcast the object pointer */
CF2_Outline outline = (CF2_Outline)callbacks;
CFF_Builder* builder;
(void)params; /* only used in debug mode */
FT_ASSERT( outline &&... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,465 | cf2_checkTransform( const CF2_Matrix* transform,
CF2_Int unitsPerEm )
{
CF2_Fixed maxScale;
FT_ASSERT( unitsPerEm > 0 );
if ( transform->a <= 0 || transform->d <= 0 )
return FT_THROW( Invalid_Size_Handle );
FT_ASSERT( transform->b == 0 && transform->c == ... | DoS | 0 | cf2_checkTransform( const CF2_Matrix* transform,
CF2_Int unitsPerEm )
{
CF2_Fixed maxScale;
FT_ASSERT( unitsPerEm > 0 );
if ( transform->a <= 0 || transform->d <= 0 )
return FT_THROW( Invalid_Size_Handle );
FT_ASSERT( transform->b == 0 && transform->c == ... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,466 | cf2_decoder_parse_charstrings( CFF_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len )
{
FT_Memory memory;
FT_Error error = FT_Err_Ok;
CF2_Font font;
FT_ASSERT( decoder && decoder->cff );
memor... | DoS | 0 | cf2_decoder_parse_charstrings( CFF_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len )
{
FT_Memory memory;
FT_Error error = FT_Err_Ok;
CF2_Font font;
FT_ASSERT( decoder && decoder->cff );
memor... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,467 | cf2_freeSeacComponent( CFF_Decoder* decoder,
CF2_Buffer buf )
{
FT_ASSERT( decoder );
cff_free_glyph_data( decoder->builder.face,
(FT_Byte**)&buf->start,
(FT_ULong)( buf->end - buf->start ) );
}
| DoS | 0 | cf2_freeSeacComponent( CFF_Decoder* decoder,
CF2_Buffer buf )
{
FT_ASSERT( decoder );
cff_free_glyph_data( decoder->builder.face,
(FT_Byte**)&buf->start,
(FT_ULong)( buf->end - buf->start ) );
}
| @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,468 | cf2_free_instance( void* ptr )
{
CF2_Font font = (CF2_Font)ptr;
if ( font )
{
FT_Memory memory = font->memory;
(void)memory;
}
}
| DoS | 0 | cf2_free_instance( void* ptr )
{
CF2_Font font = (CF2_Font)ptr;
if ( font )
{
FT_Memory memory = font->memory;
(void)memory;
}
}
| @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,469 | cf2_getBlueMetrics( CFF_Decoder* decoder,
CF2_Fixed* blueScale,
CF2_Fixed* blueShift,
CF2_Fixed* blueFuzz )
{
FT_ASSERT( decoder && decoder->current_subfont );
*blueScale = FT_DivFix(
decoder->current_subfont->pr... | DoS | 0 | cf2_getBlueMetrics( CFF_Decoder* decoder,
CF2_Fixed* blueScale,
CF2_Fixed* blueShift,
CF2_Fixed* blueFuzz )
{
FT_ASSERT( decoder && decoder->current_subfont );
*blueScale = FT_DivFix(
decoder->current_subfont->pr... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,470 | cf2_getBlueValues( CFF_Decoder* decoder,
size_t* count,
FT_Pos* *data )
{
FT_ASSERT( decoder && decoder->current_subfont );
*count = decoder->current_subfont->private_dict.num_blue_values;
*data = (FT_Pos*)
&decoder->current_subfont-... | DoS | 0 | cf2_getBlueValues( CFF_Decoder* decoder,
size_t* count,
FT_Pos* *data )
{
FT_ASSERT( decoder && decoder->current_subfont );
*count = decoder->current_subfont->private_dict.num_blue_values;
*data = (FT_Pos*)
&decoder->current_subfont-... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,471 | cf2_getFamilyOtherBlues( CFF_Decoder* decoder,
size_t* count,
FT_Pos* *data )
{
FT_ASSERT( decoder && decoder->current_subfont );
*count = decoder->current_subfont->private_dict.num_family_other_blues;
*data = (FT_Pos*)
&... | DoS | 0 | cf2_getFamilyOtherBlues( CFF_Decoder* decoder,
size_t* count,
FT_Pos* *data )
{
FT_ASSERT( decoder && decoder->current_subfont );
*count = decoder->current_subfont->private_dict.num_family_other_blues;
*data = (FT_Pos*)
&... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,472 | cf2_getLanguageGroup( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return decoder->current_subfont->private_dict.language_group;
}
| DoS | 0 | cf2_getLanguageGroup( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return decoder->current_subfont->private_dict.language_group;
}
| @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,473 | cf2_getOtherBlues( CFF_Decoder* decoder,
size_t* count,
FT_Pos* *data )
{
FT_ASSERT( decoder && decoder->current_subfont );
*count = decoder->current_subfont->private_dict.num_other_blues;
*data = (FT_Pos*)
&decoder->current_subfont-... | DoS | 0 | cf2_getOtherBlues( CFF_Decoder* decoder,
size_t* count,
FT_Pos* *data )
{
FT_ASSERT( decoder && decoder->current_subfont );
*count = decoder->current_subfont->private_dict.num_other_blues;
*data = (FT_Pos*)
&decoder->current_subfont-... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,474 | cf2_getPpemY( CFF_Decoder* decoder )
{
FT_ASSERT( decoder &&
decoder->builder.face &&
decoder->builder.face->root.size );
/*
* Note that `y_ppem' can be zero if there wasn't a call to
* `FT_Set_Char_Size' or something similar. Ho... | DoS | 0 | cf2_getPpemY( CFF_Decoder* decoder )
{
FT_ASSERT( decoder &&
decoder->builder.face &&
decoder->builder.face->root.size );
/*
* Note that `y_ppem' can be zero if there wasn't a call to
* `FT_Set_Char_Size' or something similar. Ho... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,475 | cf2_getScaleAndHintFlag( CFF_Decoder* decoder,
CF2_Fixed* x_scale,
CF2_Fixed* y_scale,
FT_Bool* hinted,
FT_Bool* scaled )
{
FT_ASSERT( decoder && decoder->builder.glyph );
/* note: F... | DoS | 0 | cf2_getScaleAndHintFlag( CFF_Decoder* decoder,
CF2_Fixed* x_scale,
CF2_Fixed* y_scale,
FT_Bool* hinted,
FT_Bool* scaled )
{
FT_ASSERT( decoder && decoder->builder.glyph );
/* note: F... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,476 | cf2_getSeacComponent( CFF_Decoder* decoder,
CF2_UInt code,
CF2_Buffer buf )
{
CF2_Int gid;
FT_Byte* charstring;
FT_ULong len;
FT_Error error;
FT_ASSERT( decoder );
FT_ZERO( buf );
gid = cff_lookup_glyph_by_stdcharcode( dec... | DoS | 0 | cf2_getSeacComponent( CFF_Decoder* decoder,
CF2_UInt code,
CF2_Buffer buf )
{
CF2_Int gid;
FT_Byte* charstring;
FT_ULong len;
FT_Error error;
FT_ASSERT( decoder );
FT_ZERO( buf );
gid = cff_lookup_glyph_by_stdcharcode( dec... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,477 | cf2_getStdHW( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return cf2_intToFixed(
decoder->current_subfont->private_dict.standard_width );
}
| DoS | 0 | cf2_getStdHW( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return cf2_intToFixed(
decoder->current_subfont->private_dict.standard_width );
}
| @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,478 | cf2_getStdVW( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return cf2_intToFixed(
decoder->current_subfont->private_dict.standard_height );
}
| DoS | 0 | cf2_getStdVW( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return cf2_intToFixed(
decoder->current_subfont->private_dict.standard_height );
}
| @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,479 | cf2_getSubfont( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return decoder->current_subfont;
}
| DoS | 0 | cf2_getSubfont( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->current_subfont );
return decoder->current_subfont;
}
| @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,480 | cf2_outline_init( CF2_Outline outline,
FT_Memory memory,
FT_Error* error )
{
FT_MEM_ZERO( outline, sizeof ( CF2_OutlineRec ) );
outline->root.memory = memory;
outline->root.error = error;
outline->root.moveTo = cf2_builder_moveTo;
outline->root.l... | DoS | 0 | cf2_outline_init( CF2_Outline outline,
FT_Memory memory,
FT_Error* error )
{
FT_MEM_ZERO( outline, sizeof ( CF2_OutlineRec ) );
outline->root.memory = memory;
outline->root.error = error;
outline->root.moveTo = cf2_builder_moveTo;
outline->root.l... | @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,481 | cf2_setGlyphWidth( CF2_Outline outline,
CF2_Fixed width )
{
CFF_Decoder* decoder = outline->decoder;
FT_ASSERT( decoder );
decoder->glyph_width = cf2_fixedToInt( width );
}
| DoS | 0 | cf2_setGlyphWidth( CF2_Outline outline,
CF2_Fixed width )
{
CFF_Decoder* decoder = outline->decoder;
FT_ASSERT( decoder );
decoder->glyph_width = cf2_fixedToInt( width );
}
| @@ -521,7 +521,7 @@
CF2_UInt idx,
CF2_Buffer buf )
{
- FT_ASSERT( decoder && decoder->globals );
+ FT_ASSERT( decoder );
FT_ZERO( buf );
@@ -529,6 +529,8 @@
if ( idx >= decoder->num_globals )
return TRUE; /* error */... | CWE-20 | null | null |
10,482 | void *create_device_tree(int *sizep)
{
void *fdt;
int ret;
*sizep = FDT_MAX_SIZE;
fdt = g_malloc0(FDT_MAX_SIZE);
ret = fdt_create(fdt, FDT_MAX_SIZE);
if (ret < 0) {
goto fail;
}
ret = fdt_finish_reservemap(fdt);
if (ret < 0) {
goto fail;
}
ret = fdt_begin_nod... | Overflow | 0 | void *create_device_tree(int *sizep)
{
void *fdt;
int ret;
*sizep = FDT_MAX_SIZE;
fdt = g_malloc0(FDT_MAX_SIZE);
ret = fdt_create(fdt, FDT_MAX_SIZE);
if (ret < 0) {
goto fail;
}
ret = fdt_finish_reservemap(fdt);
if (ret < 0) {
goto fail;
}
ret = fdt_begin_nod... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,483 | static int findnode_nofail(void *fdt, const char *node_path)
{
int offset;
offset = fdt_path_offset(fdt, node_path);
if (offset < 0) {
error_report("%s Couldn't find node %s: %s", __func__, node_path,
fdt_strerror(offset));
exit(1);
}
return offset;
}
| Overflow | 0 | static int findnode_nofail(void *fdt, const char *node_path)
{
int offset;
offset = fdt_path_offset(fdt, node_path);
if (offset < 0) {
error_report("%s Couldn't find node %s: %s", __func__, node_path,
fdt_strerror(offset));
exit(1);
}
return offset;
}
| @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,484 | void *load_device_tree_from_sysfs(void)
{
void *host_fdt;
int host_fdt_size;
host_fdt = create_device_tree(&host_fdt_size);
read_fstree(host_fdt, SYSFS_DT_BASEDIR);
if (fdt_check_header(host_fdt)) {
error_report("%s host device tree extracted into memory is invalid",
__... | Overflow | 0 | void *load_device_tree_from_sysfs(void)
{
void *host_fdt;
int host_fdt_size;
host_fdt = create_device_tree(&host_fdt_size);
read_fstree(host_fdt, SYSFS_DT_BASEDIR);
if (fdt_check_header(host_fdt)) {
error_report("%s host device tree extracted into memory is invalid",
__... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,485 | int qemu_fdt_add_subnode(void *fdt, const char *name)
{
char *dupname = g_strdup(name);
char *basename = strrchr(dupname, '/');
int retval;
int parent = 0;
if (!basename) {
g_free(dupname);
return -1;
}
basename[0] = '\0';
basename++;
if (dupname[0]) {
pare... | Overflow | 0 | int qemu_fdt_add_subnode(void *fdt, const char *name)
{
char *dupname = g_strdup(name);
char *basename = strrchr(dupname, '/');
int retval;
int parent = 0;
if (!basename) {
g_free(dupname);
return -1;
}
basename[0] = '\0';
basename++;
if (dupname[0]) {
pare... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,486 | uint32_t qemu_fdt_alloc_phandle(void *fdt)
{
static int phandle = 0x0;
/*
* We need to find out if the user gave us special instruction at
* which phandle id to start allocating phandles.
*/
if (!phandle) {
phandle = machine_phandle_start(current_machine);
}
if (!phandle) {
... | Overflow | 0 | uint32_t qemu_fdt_alloc_phandle(void *fdt)
{
static int phandle = 0x0;
/*
* We need to find out if the user gave us special instruction at
* which phandle id to start allocating phandles.
*/
if (!phandle) {
phandle = machine_phandle_start(current_machine);
}
if (!phandle) {
... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,487 | void qemu_fdt_dumpdtb(void *fdt, int size)
{
const char *dumpdtb = qemu_opt_get(qemu_get_machine_opts(), "dumpdtb");
if (dumpdtb) {
/* Dump the dtb to a file and quit */
exit(g_file_set_contents(dumpdtb, fdt, size, NULL) ? 0 : 1);
}
}
| Overflow | 0 | void qemu_fdt_dumpdtb(void *fdt, int size)
{
const char *dumpdtb = qemu_opt_get(qemu_get_machine_opts(), "dumpdtb");
if (dumpdtb) {
/* Dump the dtb to a file and quit */
exit(g_file_set_contents(dumpdtb, fdt, size, NULL) ? 0 : 1);
}
}
| @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,488 | uint32_t qemu_fdt_get_phandle(void *fdt, const char *path)
{
uint32_t r;
r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));
if (r == 0) {
error_report("%s: Couldn't get phandle for %s: %s", __func__,
path, fdt_strerror(r));
exit(1);
}
return r;
}
| Overflow | 0 | uint32_t qemu_fdt_get_phandle(void *fdt, const char *path)
{
uint32_t r;
r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));
if (r == 0) {
error_report("%s: Couldn't get phandle for %s: %s", __func__,
path, fdt_strerror(r));
exit(1);
}
return r;
}
| @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,489 | const void *qemu_fdt_getprop(void *fdt, const char *node_path,
const char *property, int *lenp, Error **errp)
{
int len;
const void *r;
if (!lenp) {
lenp = &len;
}
r = fdt_getprop(fdt, findnode_nofail(fdt, node_path), property, lenp);
if (!r) {
error... | Overflow | 0 | const void *qemu_fdt_getprop(void *fdt, const char *node_path,
const char *property, int *lenp, Error **errp)
{
int len;
const void *r;
if (!lenp) {
lenp = &len;
}
r = fdt_getprop(fdt, findnode_nofail(fdt, node_path), property, lenp);
if (!r) {
error... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,490 | uint32_t qemu_fdt_getprop_cell(void *fdt, const char *node_path,
const char *property, int *lenp, Error **errp)
{
int len;
const uint32_t *p;
if (!lenp) {
lenp = &len;
}
p = qemu_fdt_getprop(fdt, node_path, property, lenp, errp);
if (!p) {
return 0... | Overflow | 0 | uint32_t qemu_fdt_getprop_cell(void *fdt, const char *node_path,
const char *property, int *lenp, Error **errp)
{
int len;
const uint32_t *p;
if (!lenp) {
lenp = &len;
}
p = qemu_fdt_getprop(fdt, node_path, property, lenp, errp);
if (!p) {
return 0... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,491 | char **qemu_fdt_node_unit_path(void *fdt, const char *name, Error **errp)
{
char *prefix = g_strdup_printf("%s@", name);
unsigned int path_len = 16, n = 0;
GSList *path_list = NULL, *iter;
const char *iter_name;
int offset, len, ret;
char **path_array;
offset = fdt_next_node(fdt, -1, NULL)... | Overflow | 0 | char **qemu_fdt_node_unit_path(void *fdt, const char *name, Error **errp)
{
char *prefix = g_strdup_printf("%s@", name);
unsigned int path_len = 16, n = 0;
GSList *path_list = NULL, *iter;
const char *iter_name;
int offset, len, ret;
char **path_array;
offset = fdt_next_node(fdt, -1, NULL)... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,492 | int qemu_fdt_setprop(void *fdt, const char *node_path,
const char *property, const void *val, int size)
{
int r;
r = fdt_setprop(fdt, findnode_nofail(fdt, node_path), property, val, size);
if (r < 0) {
error_report("%s: Couldn't set %s/%s: %s", __func__, node_path,
... | Overflow | 0 | int qemu_fdt_setprop(void *fdt, const char *node_path,
const char *property, const void *val, int size)
{
int r;
r = fdt_setprop(fdt, findnode_nofail(fdt, node_path), property, val, size);
if (r < 0) {
error_report("%s: Couldn't set %s/%s: %s", __func__, node_path,
... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,493 | int qemu_fdt_setprop_cell(void *fdt, const char *node_path,
const char *property, uint32_t val)
{
int r;
r = fdt_setprop_cell(fdt, findnode_nofail(fdt, node_path), property, val);
if (r < 0) {
error_report("%s: Couldn't set %s/%s = %#08x: %s", __func__,
... | Overflow | 0 | int qemu_fdt_setprop_cell(void *fdt, const char *node_path,
const char *property, uint32_t val)
{
int r;
r = fdt_setprop_cell(fdt, findnode_nofail(fdt, node_path), property, val);
if (r < 0) {
error_report("%s: Couldn't set %s/%s = %#08x: %s", __func__,
... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,494 | int qemu_fdt_setprop_sized_cells_from_array(void *fdt,
const char *node_path,
const char *property,
int numvalues,
uint64_t *values)
{
uint3... | Overflow | 0 | int qemu_fdt_setprop_sized_cells_from_array(void *fdt,
const char *node_path,
const char *property,
int numvalues,
uint64_t *values)
{
uint3... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,495 | int qemu_fdt_setprop_string(void *fdt, const char *node_path,
const char *property, const char *string)
{
int r;
r = fdt_setprop_string(fdt, findnode_nofail(fdt, node_path), property, string);
if (r < 0) {
error_report("%s: Couldn't set %s/%s = %s: %s", __func__,
... | Overflow | 0 | int qemu_fdt_setprop_string(void *fdt, const char *node_path,
const char *property, const char *string)
{
int r;
r = fdt_setprop_string(fdt, findnode_nofail(fdt, node_path), property, string);
if (r < 0) {
error_report("%s: Couldn't set %s/%s = %s: %s", __func__,
... | @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,496 | int qemu_fdt_setprop_u64(void *fdt, const char *node_path,
const char *property, uint64_t val)
{
val = cpu_to_be64(val);
return qemu_fdt_setprop(fdt, node_path, property, &val, sizeof(val));
}
| Overflow | 0 | int qemu_fdt_setprop_u64(void *fdt, const char *node_path,
const char *property, uint64_t val)
{
val = cpu_to_be64(val);
return qemu_fdt_setprop(fdt, node_path, property, &val, sizeof(val));
}
| @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep)
/* First allocate space in qemu for device tree */
fdt = g_malloc0(dt_size);
- dt_file_load_size = load_image(filename_path, fdt);
+ dt_file_load_size = load_image_size(filename_path, fdt, dt_size);
if (dt_file_load_s... | CWE-119 | null | null |
10,497 | static int ahci_cond_start_engines(AHCIDevice *ad, bool allow_stop)
{
AHCIPortRegs *pr = &ad->port_regs;
if (pr->cmd & PORT_CMD_START) {
if (ahci_map_clb_address(ad)) {
pr->cmd |= PORT_CMD_LIST_ON;
} else {
error_report("AHCI: Failed to start DMA engine: "
... | DoS Exec Code | 0 | static int ahci_cond_start_engines(AHCIDevice *ad, bool allow_stop)
{
AHCIPortRegs *pr = &ad->port_regs;
if (pr->cmd & PORT_CMD_START) {
if (ahci_map_clb_address(ad)) {
pr->cmd |= PORT_CMD_LIST_ON;
} else {
error_report("AHCI: Failed to start DMA engine: "
... | @@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *ncq_tfs)
ide_state->error = ABRT_ERR;
ide_state->status = READY_STAT | ERR_STAT;
ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
+ ncq_tfs->used = 0;
}
static void ncq_finish(NCQTransferState *ncq_tfs) | null | null | null |
10,498 | static bool ahci_map_clb_address(AHCIDevice *ad)
{
AHCIPortRegs *pr = &ad->port_regs;
ad->cur_cmd = NULL;
map_page(ad->hba->as, &ad->lst,
((uint64_t)pr->lst_addr_hi << 32) | pr->lst_addr, 1024);
return ad->lst != NULL;
}
| DoS Exec Code | 0 | static bool ahci_map_clb_address(AHCIDevice *ad)
{
AHCIPortRegs *pr = &ad->port_regs;
ad->cur_cmd = NULL;
map_page(ad->hba->as, &ad->lst,
((uint64_t)pr->lst_addr_hi << 32) | pr->lst_addr, 1024);
return ad->lst != NULL;
}
| @@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *ncq_tfs)
ide_state->error = ABRT_ERR;
ide_state->status = READY_STAT | ERR_STAT;
ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
+ ncq_tfs->used = 0;
}
static void ncq_finish(NCQTransferState *ncq_tfs) | null | null | null |
10,499 | static bool ahci_map_fis_address(AHCIDevice *ad)
{
AHCIPortRegs *pr = &ad->port_regs;
map_page(ad->hba->as, &ad->res_fis,
((uint64_t)pr->fis_addr_hi << 32) | pr->fis_addr, 256);
return ad->res_fis != NULL;
}
| DoS Exec Code | 0 | static bool ahci_map_fis_address(AHCIDevice *ad)
{
AHCIPortRegs *pr = &ad->port_regs;
map_page(ad->hba->as, &ad->res_fis,
((uint64_t)pr->fis_addr_hi << 32) | pr->fis_addr, 256);
return ad->res_fis != NULL;
}
| @@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *ncq_tfs)
ide_state->error = ABRT_ERR;
ide_state->status = READY_STAT | ERR_STAT;
ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
+ ncq_tfs->used = 0;
}
static void ncq_finish(NCQTransferState *ncq_tfs) | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.