idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
14,400 | kex_send_ext_info(struct ssh *ssh)
{
int r;
char *algs;
if ((algs = sshkey_alg_list(0, 1, ',')) == NULL)
return SSH_ERR_ALLOC_FAIL;
if ((r = sshpkt_start(ssh, SSH2_MSG_EXT_INFO)) != 0 ||
(r = sshpkt_put_u32(ssh, 1)) != 0 ||
(r = sshpkt_put_cstring(ssh, "server-sig-algs")) != 0 ||
(r = sshpkt_put_c... | DoS | 0 | kex_send_ext_info(struct ssh *ssh)
{
int r;
char *algs;
if ((algs = sshkey_alg_list(0, 1, ',')) == NULL)
return SSH_ERR_ALLOC_FAIL;
if ((r = sshpkt_start(ssh, SSH2_MSG_EXT_INFO)) != 0 ||
(r = sshpkt_put_u32(ssh, 1)) != 0 ||
(r = sshpkt_put_cstring(ssh, "server-sig-algs")) != 0 ||
(r = sshpkt_put_c... | @@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.121 2016/09/12 23:31:27 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.122 2016/09/19 19:02:19 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -425,6 +425,8 @@ kex_input_newkeys(int type, u_int32_t seq, void *ctxt)
ssh_dispatch_set(ssh, SSH2_M... | CWE-476 | null | null |
14,401 | kex_send_kexinit(struct ssh *ssh)
{
u_char *cookie;
struct kex *kex = ssh->kex;
int r;
if (kex == NULL)
return SSH_ERR_INTERNAL_ERROR;
if (kex->flags & KEX_INIT_SENT)
return 0;
kex->done = 0;
/* generate a random cookie */
if (sshbuf_len(kex->my) < KEX_COOKIE_LEN)
return SSH_ERR_INVALID_FORMAT;
if ((co... | DoS | 0 | kex_send_kexinit(struct ssh *ssh)
{
u_char *cookie;
struct kex *kex = ssh->kex;
int r;
if (kex == NULL)
return SSH_ERR_INTERNAL_ERROR;
if (kex->flags & KEX_INIT_SENT)
return 0;
kex->done = 0;
/* generate a random cookie */
if (sshbuf_len(kex->my) < KEX_COOKIE_LEN)
return SSH_ERR_INVALID_FORMAT;
if ((co... | @@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.121 2016/09/12 23:31:27 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.122 2016/09/19 19:02:19 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -425,6 +425,8 @@ kex_input_newkeys(int type, u_int32_t seq, void *ctxt)
ssh_dispatch_set(ssh, SSH2_M... | CWE-476 | null | null |
14,402 | kex_send_newkeys(struct ssh *ssh)
{
int r;
kex_reset_dispatch(ssh);
if ((r = sshpkt_start(ssh, SSH2_MSG_NEWKEYS)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
return r;
debug("SSH2_MSG_NEWKEYS sent");
debug("expecting SSH2_MSG_NEWKEYS");
ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_input_newkeys);
if (ssh->kex->... | DoS | 0 | kex_send_newkeys(struct ssh *ssh)
{
int r;
kex_reset_dispatch(ssh);
if ((r = sshpkt_start(ssh, SSH2_MSG_NEWKEYS)) != 0 ||
(r = sshpkt_send(ssh)) != 0)
return r;
debug("SSH2_MSG_NEWKEYS sent");
debug("expecting SSH2_MSG_NEWKEYS");
ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_input_newkeys);
if (ssh->kex->... | @@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.121 2016/09/12 23:31:27 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.122 2016/09/19 19:02:19 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -425,6 +425,8 @@ kex_input_newkeys(int type, u_int32_t seq, void *ctxt)
ssh_dispatch_set(ssh, SSH2_M... | CWE-476 | null | null |
14,403 | kex_setup(struct ssh *ssh, char *proposal[PROPOSAL_MAX])
{
int r;
if ((r = kex_new(ssh, proposal, &ssh->kex)) != 0)
return r;
if ((r = kex_send_kexinit(ssh)) != 0) { /* we start */
kex_free(ssh->kex);
ssh->kex = NULL;
return r;
}
return 0;
}
| DoS | 0 | kex_setup(struct ssh *ssh, char *proposal[PROPOSAL_MAX])
{
int r;
if ((r = kex_new(ssh, proposal, &ssh->kex)) != 0)
return r;
if ((r = kex_send_kexinit(ssh)) != 0) { /* we start */
kex_free(ssh->kex);
ssh->kex = NULL;
return r;
}
return 0;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.121 2016/09/12 23:31:27 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.122 2016/09/19 19:02:19 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -425,6 +425,8 @@ kex_input_newkeys(int type, u_int32_t seq, void *ctxt)
ssh_dispatch_set(ssh, SSH2_M... | CWE-476 | null | null |
14,404 | proposals_match(char *my[PROPOSAL_MAX], char *peer[PROPOSAL_MAX])
{
static int check[] = {
PROPOSAL_KEX_ALGS, PROPOSAL_SERVER_HOST_KEY_ALGS, -1
};
int *idx;
char *p;
for (idx = &check[0]; *idx != -1; idx++) {
if ((p = strchr(my[*idx], ',')) != NULL)
*p = '\0';
if ((p = strchr(peer[*idx], ',')) != NULL)
... | DoS | 0 | proposals_match(char *my[PROPOSAL_MAX], char *peer[PROPOSAL_MAX])
{
static int check[] = {
PROPOSAL_KEX_ALGS, PROPOSAL_SERVER_HOST_KEY_ALGS, -1
};
int *idx;
char *p;
for (idx = &check[0]; *idx != -1; idx++) {
if ((p = strchr(my[*idx], ',')) != NULL)
*p = '\0';
if ((p = strchr(peer[*idx], ',')) != NULL)
... | @@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.121 2016/09/12 23:31:27 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.122 2016/09/19 19:02:19 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -425,6 +425,8 @@ kex_input_newkeys(int type, u_int32_t seq, void *ctxt)
ssh_dispatch_set(ssh, SSH2_M... | CWE-476 | null | null |
14,405 | kex_from_blob(struct sshbuf *m, struct kex **kexp)
{
struct kex *kex;
int r;
if ((kex = calloc(1, sizeof(struct kex))) == NULL ||
(kex->my = sshbuf_new()) == NULL ||
(kex->peer = sshbuf_new()) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
}
if ((r = sshbuf_get_string(m, &kex->session_id, &kex->sessio... | DoS | 0 | kex_from_blob(struct sshbuf *m, struct kex **kexp)
{
struct kex *kex;
int r;
if ((kex = calloc(1, sizeof(struct kex))) == NULL ||
(kex->my = sshbuf_new()) == NULL ||
(kex->peer = sshbuf_new()) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
}
if ((r = sshbuf_get_string(m, &kex->session_id, &kex->sessio... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,406 | newkeys_from_blob(struct sshbuf *m, struct ssh *ssh, int mode)
{
struct sshbuf *b = NULL;
struct sshcomp *comp;
struct sshenc *enc;
struct sshmac *mac;
struct newkeys *newkey = NULL;
size_t keylen, ivlen, maclen;
int r;
if ((newkey = calloc(1, sizeof(*newkey))) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
... | DoS | 0 | newkeys_from_blob(struct sshbuf *m, struct ssh *ssh, int mode)
{
struct sshbuf *b = NULL;
struct sshcomp *comp;
struct sshenc *enc;
struct sshmac *mac;
struct newkeys *newkey = NULL;
size_t keylen, ivlen, maclen;
int r;
if ((newkey = calloc(1, sizeof(*newkey))) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,407 | ssh_local_ipaddr(struct ssh *ssh)
{
(void)ssh_remote_ipaddr(ssh); /* Will lookup and cache. */
return ssh->local_ipaddr;
}
| DoS | 0 | ssh_local_ipaddr(struct ssh *ssh)
{
(void)ssh_remote_ipaddr(ssh); /* Will lookup and cache. */
return ssh->local_ipaddr;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,408 | ssh_local_port(struct ssh *ssh)
{
(void)ssh_remote_ipaddr(ssh); /* Will lookup and cache. */
return ssh->local_port;
}
| DoS | 0 | ssh_local_port(struct ssh *ssh)
{
(void)ssh_remote_ipaddr(ssh); /* Will lookup and cache. */
return ssh->local_port;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,409 | ssh_packet_close(struct ssh *ssh)
{
struct session_state *state = ssh->state;
u_int mode;
if (!state->initialized)
return;
state->initialized = 0;
if (state->connection_in == state->connection_out) {
shutdown(state->connection_out, SHUT_RDWR);
close(state->connection_out);
} else {
close(state->connectio... | DoS | 0 | ssh_packet_close(struct ssh *ssh)
{
struct session_state *state = ssh->state;
u_int mode;
if (!state->initialized)
return;
state->initialized = 0;
if (state->connection_in == state->connection_out) {
shutdown(state->connection_out, SHUT_RDWR);
close(state->connection_out);
} else {
close(state->connectio... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,410 | ssh_packet_connection_is_on_socket(struct ssh *ssh)
{
struct session_state *state = ssh->state;
struct sockaddr_storage from, to;
socklen_t fromlen, tolen;
if (state->connection_in == -1 || state->connection_out == -1)
return 0;
/* filedescriptors in and out are the same, so it's a socket */
if (state->connec... | DoS | 0 | ssh_packet_connection_is_on_socket(struct ssh *ssh)
{
struct session_state *state = ssh->state;
struct sockaddr_storage from, to;
socklen_t fromlen, tolen;
if (state->connection_in == -1 || state->connection_out == -1)
return 0;
/* filedescriptors in and out are the same, so it's a socket */
if (state->connec... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,411 | ssh_packet_is_rekeying(struct ssh *ssh)
{
return compat20 &&
(ssh->state->rekeying || (ssh->kex != NULL && ssh->kex->done == 0));
}
| DoS | 0 | ssh_packet_is_rekeying(struct ssh *ssh)
{
return compat20 &&
(ssh->state->rekeying || (ssh->kex != NULL && ssh->kex->done == 0));
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,412 | ssh_packet_need_rekeying(struct ssh *ssh, u_int outbound_packet_len)
{
struct session_state *state = ssh->state;
u_int32_t out_blocks;
/* XXX client can't cope with rekeying pre-auth */
if (!state->after_authentication)
return 0;
/* Haven't keyed yet or KEX in progress. */
if (ssh->kex == NULL || ssh_packet_i... | DoS | 0 | ssh_packet_need_rekeying(struct ssh *ssh, u_int outbound_packet_len)
{
struct session_state *state = ssh->state;
u_int32_t out_blocks;
/* XXX client can't cope with rekeying pre-auth */
if (!state->after_authentication)
return 0;
/* Haven't keyed yet or KEX in progress. */
if (ssh->kex == NULL || ssh_packet_i... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,413 | ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
{
struct session_state *state = ssh->state;
int len, r, ms_remain;
fd_set *setp;
char buf[8192];
struct timeval timeout, start, *timeoutp = NULL;
DBG(debug("packet_read()"));
setp = calloc(howmany(state->connection_in + 1,
NFDBITS),... | DoS | 0 | ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
{
struct session_state *state = ssh->state;
int len, r, ms_remain;
fd_set *setp;
char buf[8192];
struct timeval timeout, start, *timeoutp = NULL;
DBG(debug("packet_read()"));
setp = calloc(howmany(state->connection_in + 1,
NFDBITS),... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,414 | ssh_packet_send1(struct ssh *ssh)
{
struct session_state *state = ssh->state;
u_char buf[8], *cp;
int r, padding, len;
u_int checksum;
/*
* If using packet compression, compress the payload of the outgoing
* packet.
*/
if (state->packet_compression) {
sshbuf_reset(state->compression_buffer);
/* Skip pa... | DoS | 0 | ssh_packet_send1(struct ssh *ssh)
{
struct session_state *state = ssh->state;
u_char buf[8], *cp;
int r, padding, len;
u_int checksum;
/*
* If using packet compression, compress the payload of the outgoing
* packet.
*/
if (state->packet_compression) {
sshbuf_reset(state->compression_buffer);
/* Skip pa... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,415 | ssh_packet_send2_wrapped(struct ssh *ssh)
{
struct session_state *state = ssh->state;
u_char type, *cp, macbuf[SSH_DIGEST_MAX_LENGTH];
u_char tmp, padlen, pad = 0;
u_int authlen = 0, aadlen = 0;
u_int len;
struct sshenc *enc = NULL;
struct sshmac *mac = NULL;
struct sshcomp *comp = NULL;
int r, block_size;... | DoS | 0 | ssh_packet_send2_wrapped(struct ssh *ssh)
{
struct session_state *state = ssh->state;
u_char type, *cp, macbuf[SSH_DIGEST_MAX_LENGTH];
u_char tmp, padlen, pad = 0;
u_int authlen = 0, aadlen = 0;
u_int len;
struct sshenc *enc = NULL;
struct sshmac *mac = NULL;
struct sshcomp *comp = NULL;
int r, block_size;... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,416 | ssh_packet_set_connection(struct ssh *ssh, int fd_in, int fd_out)
{
struct session_state *state;
const struct sshcipher *none = cipher_by_name("none");
int r;
if (none == NULL) {
error("%s: cannot load cipher 'none'", __func__);
return NULL;
}
if (ssh == NULL)
ssh = ssh_alloc_session_state();
if (ssh == N... | DoS | 0 | ssh_packet_set_connection(struct ssh *ssh, int fd_in, int fd_out)
{
struct session_state *state;
const struct sshcipher *none = cipher_by_name("none");
int r;
if (none == NULL) {
error("%s: cannot load cipher 'none'", __func__);
return NULL;
}
if (ssh == NULL)
ssh = ssh_alloc_session_state();
if (ssh == N... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,417 | ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, int number)
{
#ifndef WITH_SSH1
fatal("no SSH protocol 1 support");
#else /* WITH_SSH1 */
struct session_state *state = ssh->state;
const struct sshcipher *cipher = cipher_by_number(number);
int r;
const char *wmsg;
if (cipher == NUL... | DoS | 0 | ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, int number)
{
#ifndef WITH_SSH1
fatal("no SSH protocol 1 support");
#else /* WITH_SSH1 */
struct session_state *state = ssh->state;
const struct sshcipher *cipher = cipher_by_number(number);
int r;
const char *wmsg;
if (cipher == NUL... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,418 | ssh_packet_set_rekey_limits(struct ssh *ssh, u_int64_t bytes, time_t seconds)
{
debug3("rekey after %llu bytes, %d seconds", (unsigned long long)bytes,
(int)seconds);
ssh->state->rekey_limit = bytes;
ssh->state->rekey_interval = seconds;
}
| DoS | 0 | ssh_packet_set_rekey_limits(struct ssh *ssh, u_int64_t bytes, time_t seconds)
{
debug3("rekey after %llu bytes, %d seconds", (unsigned long long)bytes,
(int)seconds);
ssh->state->rekey_limit = bytes;
ssh->state->rekey_interval = seconds;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,419 | ssh_packet_set_state(struct ssh *ssh, struct sshbuf *m)
{
struct session_state *state = ssh->state;
const u_char *ssh1key, *ivin, *ivout, *keyin, *keyout, *input, *output;
size_t ssh1keylen, rlen, slen, ilen, olen;
int r;
u_int ssh1cipher = 0;
if (!compat20) {
if ((r = sshbuf_get_u32(m, &state->remote_protocol... | DoS | 0 | ssh_packet_set_state(struct ssh *ssh, struct sshbuf *m)
{
struct session_state *state = ssh->state;
const u_char *ssh1key, *ivin, *ivout, *keyin, *keyout, *input, *output;
size_t ssh1keylen, rlen, slen, ilen, olen;
int r;
u_int ssh1cipher = 0;
if (!compat20) {
if ((r = sshbuf_get_u32(m, &state->remote_protocol... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,420 | ssh_packet_start_discard(struct ssh *ssh, struct sshenc *enc,
struct sshmac *mac, size_t mac_already, u_int discard)
{
struct session_state *state = ssh->state;
int r;
if (enc == NULL || !cipher_is_cbc(enc->cipher) || (mac && mac->etm)) {
if ((r = sshpkt_disconnect(ssh, "Packet corrupt")) != 0)
return r;
... | DoS | 0 | ssh_packet_start_discard(struct ssh *ssh, struct sshenc *enc,
struct sshmac *mac, size_t mac_already, u_int discard)
{
struct session_state *state = ssh->state;
int r;
if (enc == NULL || !cipher_is_cbc(enc->cipher) || (mac && mac->etm)) {
if ((r = sshpkt_disconnect(ssh, "Packet corrupt")) != 0)
return r;
... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,421 | ssh_packet_stop_discard(struct ssh *ssh)
{
struct session_state *state = ssh->state;
int r;
if (state->packet_discard_mac) {
char buf[1024];
size_t dlen = PACKET_MAX_SIZE;
if (dlen > state->packet_discard_mac_already)
dlen -= state->packet_discard_mac_already;
memset(buf, 'a', sizeof(buf));
while (ssh... | DoS | 0 | ssh_packet_stop_discard(struct ssh *ssh)
{
struct session_state *state = ssh->state;
int r;
if (state->packet_discard_mac) {
char buf[1024];
size_t dlen = PACKET_MAX_SIZE;
if (dlen > state->packet_discard_mac_already)
dlen -= state->packet_discard_mac_already;
memset(buf, 'a', sizeof(buf));
while (ssh... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,422 | ssh_packet_type_is_kex(u_char type)
{
return
type >= SSH2_MSG_TRANSPORT_MIN &&
type <= SSH2_MSG_TRANSPORT_MAX &&
type != SSH2_MSG_SERVICE_REQUEST &&
type != SSH2_MSG_SERVICE_ACCEPT &&
type != SSH2_MSG_EXT_INFO;
}
| DoS | 0 | ssh_packet_type_is_kex(u_char type)
{
return
type >= SSH2_MSG_TRANSPORT_MIN &&
type <= SSH2_MSG_TRANSPORT_MAX &&
type != SSH2_MSG_SERVICE_REQUEST &&
type != SSH2_MSG_SERVICE_ACCEPT &&
type != SSH2_MSG_EXT_INFO;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,423 | ssh_packet_write_poll(struct ssh *ssh)
{
struct session_state *state = ssh->state;
int len = sshbuf_len(state->output);
int r;
if (len > 0) {
len = write(state->connection_out,
sshbuf_ptr(state->output), len);
if (len == -1) {
if (errno == EINTR || errno == EAGAIN ||
errno == EWOULDBLOCK)
r... | DoS | 0 | ssh_packet_write_poll(struct ssh *ssh)
{
struct session_state *state = ssh->state;
int len = sshbuf_len(state->output);
int r;
if (len > 0) {
len = write(state->connection_out,
sshbuf_ptr(state->output), len);
if (len == -1) {
if (errno == EINTR || errno == EAGAIN ||
errno == EWOULDBLOCK)
r... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,424 | ssh_remote_port(struct ssh *ssh)
{
(void)ssh_remote_ipaddr(ssh); /* Will lookup and cache. */
return ssh->remote_port;
}
| DoS | 0 | ssh_remote_port(struct ssh *ssh)
{
(void)ssh_remote_ipaddr(ssh); /* Will lookup and cache. */
return ssh->remote_port;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,425 | ssh_set_newkeys(struct ssh *ssh, int mode)
{
struct session_state *state = ssh->state;
struct sshenc *enc;
struct sshmac *mac;
struct sshcomp *comp;
struct sshcipher_ctx **ccp;
struct packet_state *ps;
u_int64_t *max_blocks;
const char *wmsg, *dir;
int r, crypt_type;
debug2("set_newkeys: mode %d", mode);
i... | DoS | 0 | ssh_set_newkeys(struct ssh *ssh, int mode)
{
struct session_state *state = ssh->state;
struct sshenc *enc;
struct sshmac *mac;
struct sshcomp *comp;
struct sshcipher_ctx **ccp;
struct packet_state *ps;
u_int64_t *max_blocks;
const char *wmsg, *dir;
int r, crypt_type;
debug2("set_newkeys: mode %d", mode);
i... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,426 | sshpkt_fatal(struct ssh *ssh, const char *tag, int r)
{
switch (r) {
case SSH_ERR_CONN_CLOSED:
logdie("Connection closed by %.200s port %d",
ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
case SSH_ERR_CONN_TIMEOUT:
logdie("Connection %s %.200s port %d timed out",
ssh->state->server_side ? "from" : "t... | DoS | 0 | sshpkt_fatal(struct ssh *ssh, const char *tag, int r)
{
switch (r) {
case SSH_ERR_CONN_CLOSED:
logdie("Connection closed by %.200s port %d",
ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
case SSH_ERR_CONN_TIMEOUT:
logdie("Connection %s %.200s port %d timed out",
ssh->state->server_side ? "from" : "t... | @@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.237 2016/09/12 01:22:38 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1907,9 +1907,7 @@ ssh_packet_read_poll2(struct ssh *ss... | CWE-476 | null | null |
14,427 | jbig2_alloc(Jbig2Allocator *allocator, size_t size, size_t num)
{
/* check for integer multiplication overflow */
if (num > 0 && size >= (size_t) - 0x100 / num)
return NULL;
return allocator->alloc(allocator, size * num);
}
| Overflow | 0 | jbig2_alloc(Jbig2Allocator *allocator, size_t size, size_t num)
{
/* check for integer multiplication overflow */
if (num > 0 && size >= (size_t) - 0x100 / num)
return NULL;
return allocator->alloc(allocator, size * num);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,428 | jbig2_ctx_free(Jbig2Ctx *ctx)
{
Jbig2Allocator *ca = ctx->allocator;
int i;
jbig2_free(ca, ctx->buf);
if (ctx->segments != NULL) {
for (i = 0; i < ctx->n_segments; i++)
jbig2_free_segment(ctx, ctx->segments[i]);
jbig2_free(ca, ctx->segments);
}
if (ctx->pages != NUL... | Overflow | 0 | jbig2_ctx_free(Jbig2Ctx *ctx)
{
Jbig2Allocator *ca = ctx->allocator;
int i;
jbig2_free(ca, ctx->buf);
if (ctx->segments != NULL) {
for (i = 0; i < ctx->n_segments; i++)
jbig2_free_segment(ctx, ctx->segments[i]);
jbig2_free(ca, ctx->segments);
}
if (ctx->pages != NUL... | @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,429 | jbig2_ctx_new(Jbig2Allocator *allocator, Jbig2Options options, Jbig2GlobalCtx *global_ctx, Jbig2ErrorCallback error_callback, void *error_callback_data)
{
Jbig2Ctx *result;
if (allocator == NULL)
allocator = &jbig2_default_allocator;
if (error_callback == NULL)
error_callback = &jbig2_defau... | Overflow | 0 | jbig2_ctx_new(Jbig2Allocator *allocator, Jbig2Options options, Jbig2GlobalCtx *global_ctx, Jbig2ErrorCallback error_callback, void *error_callback_data)
{
Jbig2Ctx *result;
if (allocator == NULL)
allocator = &jbig2_default_allocator;
if (error_callback == NULL)
error_callback = &jbig2_defau... | @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,430 | jbig2_data_in(Jbig2Ctx *ctx, const unsigned char *data, size_t size)
{
const size_t initial_buf_size = 1024;
if (ctx->buf == NULL) {
size_t buf_size = initial_buf_size;
do
buf_size <<= 1;
while (buf_size < size);
ctx->buf = jbig2_new(ctx, byte, buf_size);
if... | Overflow | 0 | jbig2_data_in(Jbig2Ctx *ctx, const unsigned char *data, size_t size)
{
const size_t initial_buf_size = 1024;
if (ctx->buf == NULL) {
size_t buf_size = initial_buf_size;
do
buf_size <<= 1;
while (buf_size < size);
ctx->buf = jbig2_new(ctx, byte, buf_size);
if... | @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,431 | jbig2_default_alloc(Jbig2Allocator *allocator, size_t size)
{
return malloc(size);
}
| Overflow | 0 | jbig2_default_alloc(Jbig2Allocator *allocator, size_t size)
{
return malloc(size);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,432 | jbig2_default_error(void *data, const char *msg, Jbig2Severity severity, int32_t seg_idx)
{
/* report only fatal errors by default */
if (severity == JBIG2_SEVERITY_FATAL) {
fprintf(stderr, "jbig2 decoder FATAL ERROR: %s", msg);
if (seg_idx != -1)
fprintf(stderr, " (segment 0x%02x)",... | Overflow | 0 | jbig2_default_error(void *data, const char *msg, Jbig2Severity severity, int32_t seg_idx)
{
/* report only fatal errors by default */
if (severity == JBIG2_SEVERITY_FATAL) {
fprintf(stderr, "jbig2 decoder FATAL ERROR: %s", msg);
if (seg_idx != -1)
fprintf(stderr, " (segment 0x%02x)",... | @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,433 | jbig2_default_free(Jbig2Allocator *allocator, void *p)
{
free(p);
}
| Overflow | 0 | jbig2_default_free(Jbig2Allocator *allocator, void *p)
{
free(p);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,434 | jbig2_default_realloc(Jbig2Allocator *allocator, void *p, size_t size)
{
return realloc(p, size);
}
| Overflow | 0 | jbig2_default_realloc(Jbig2Allocator *allocator, void *p, size_t size)
{
return realloc(p, size);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,435 | jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t segment_number, const char *fmt, ...)
{
char buf[1024];
va_list ap;
int n;
int code;
va_start(ap, fmt);
n = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
if (n < 0 || n == sizeof(buf))
strncpy(buf, "jbig2_error: erro... | Overflow | 0 | jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t segment_number, const char *fmt, ...)
{
char buf[1024];
va_list ap;
int n;
int code;
va_start(ap, fmt);
n = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
if (n < 0 || n == sizeof(buf))
strncpy(buf, "jbig2_error: erro... | @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,436 | jbig2_free(Jbig2Allocator *allocator, void *p)
{
allocator->free(allocator, p);
}
| Overflow | 0 | jbig2_free(Jbig2Allocator *allocator, void *p)
{
allocator->free(allocator, p);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,437 | jbig2_get_int16(const byte *bptr)
{
return get_int16(bptr);
}
| Overflow | 0 | jbig2_get_int16(const byte *bptr)
{
return get_int16(bptr);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,438 | jbig2_get_int32(const byte *bptr)
{
return ((int32_t) get_int16(bptr) << 16) | get_uint16(bptr + 2);
}
| Overflow | 0 | jbig2_get_int32(const byte *bptr)
{
return ((int32_t) get_int16(bptr) << 16) | get_uint16(bptr + 2);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,439 | jbig2_get_uint32(const byte *bptr)
{
return ((uint32_t) get_uint16(bptr) << 16) | get_uint16(bptr + 2);
}
| Overflow | 0 | jbig2_get_uint32(const byte *bptr)
{
return ((uint32_t) get_uint16(bptr) << 16) | get_uint16(bptr + 2);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,440 | jbig2_global_ctx_free(Jbig2GlobalCtx *global_ctx)
{
jbig2_ctx_free((Jbig2Ctx *) global_ctx);
}
| Overflow | 0 | jbig2_global_ctx_free(Jbig2GlobalCtx *global_ctx)
{
jbig2_ctx_free((Jbig2Ctx *) global_ctx);
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,441 | jbig2_make_global_ctx(Jbig2Ctx *ctx)
{
return (Jbig2GlobalCtx *) ctx;
}
| Overflow | 0 | jbig2_make_global_ctx(Jbig2Ctx *ctx)
{
return (Jbig2GlobalCtx *) ctx;
}
| @@ -379,7 +379,7 @@ typedef struct {
} Jbig2WordStreamBuf;
static int
-jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset, uint32_t *word)
+jbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, size_t offset, uint32_t *word)
{
Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *) self;
c... | CWE-119 | null | null |
14,442 | jbig2_decode_generic_region(Jbig2Ctx *ctx,
Jbig2Segment *segment, const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int8_t *gbat = params->gbat;
if (image->stride * image->height > (1 << 24) && segment->data_length < imag... | Overflow | 0 | jbig2_decode_generic_region(Jbig2Ctx *ctx,
Jbig2Segment *segment, const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int8_t *gbat = params->gbat;
if (image->stride * image->height > (1 << 24) && segment->data_length < imag... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,443 | jbig2_decode_generic_region_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
switch (params->GBTEMPLATE) {
case 0:
return jbig2_deco... | Overflow | 0 | jbig2_decode_generic_region_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
switch (params->GBTEMPLATE) {
case 0:
return jbig2_deco... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,444 | jbig2_decode_generic_template0(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = i... | Overflow | 0 | jbig2_decode_generic_template0(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = i... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,445 | jbig2_decode_generic_template0_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | Overflow | 0 | jbig2_decode_generic_template0_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,446 | jbig2_decode_generic_template0_unopt(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->heig... | Overflow | 0 | jbig2_decode_generic_template0_unopt(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->heig... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,447 | jbig2_decode_generic_template1_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | Overflow | 0 | jbig2_decode_generic_template1_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,448 | jbig2_decode_generic_template2(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->height;
const int ... | Overflow | 0 | jbig2_decode_generic_template2(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->height;
const int ... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,449 | jbig2_decode_generic_template2_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | Overflow | 0 | jbig2_decode_generic_template2_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,450 | jbig2_decode_generic_template3_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | Overflow | 0 | jbig2_decode_generic_template3_TPGDON(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->h... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,451 | jbig2_decode_generic_template3_unopt(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->heig... | Overflow | 0 | jbig2_decode_generic_template3_unopt(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats)
{
const int GBW = image->width;
const int GBH = image->heig... | @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,452 | jbig2_generic_stats_size(Jbig2Ctx *ctx, int template)
{
int stats_size = template == 0 ? 1 << 16 : template == 1 ? 1 << 1 << 13 : 1 << 10;
return stats_size;
}
| Overflow | 0 | jbig2_generic_stats_size(Jbig2Ctx *ctx, int template)
{
int stats_size = template == 0 ? 1 << 16 : template == 1 ? 1 << 1 << 13 : 1 << 10;
return stats_size;
}
| @@ -718,7 +718,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte
byte seg_flags;
int8_t gbat[8];
int offset;
- int gbat_bytes = 0;
+ uint32_t gbat_bytes = 0;
Jbig2GenericRegionParams params;
int code = 0;
Jbig2Image *image = NULL; | CWE-119 | null | null |
14,453 | jbig2_decode_pattern_dict(Jbig2Ctx *ctx, Jbig2Segment *segment,
const Jbig2PatternDictParams *params, const byte *data, const size_t size, Jbig2ArithCx *GB_stats)
{
Jbig2PatternDict *hd = NULL;
Jbig2Image *image = NULL;
Jbig2GenericRegionParams rparams;
int code = 0;
/* al... | Overflow | 0 | jbig2_decode_pattern_dict(Jbig2Ctx *ctx, Jbig2Segment *segment,
const Jbig2PatternDictParams *params, const byte *data, const size_t size, Jbig2ArithCx *GB_stats)
{
Jbig2PatternDict *hd = NULL;
Jbig2Image *image = NULL;
Jbig2GenericRegionParams rparams;
int code = 0;
/* al... | @@ -257,8 +257,8 @@ jbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment *segment,
{
uint8_t **GSVALS = NULL;
size_t consumed_bytes = 0;
- int i, j, code, stride;
- int x, y;
+ uint32_t i, j, stride, x, y;
+ int code;
Jbig2Image **GSPLANES;
Jbig2GenericRegionParams rparams;
Jb... | CWE-119 | null | null |
14,454 | jbig2_hd_new(Jbig2Ctx *ctx, const Jbig2PatternDictParams *params, Jbig2Image *image)
{
Jbig2PatternDict *new;
const int N = params->GRAYMAX + 1;
const int HPW = params->HDPW;
const int HPH = params->HDPH;
int i;
/* allocate a new struct */
new = jbig2_new(ctx, Jbig2PatternDict, 1);
if (... | Overflow | 0 | jbig2_hd_new(Jbig2Ctx *ctx, const Jbig2PatternDictParams *params, Jbig2Image *image)
{
Jbig2PatternDict *new;
const int N = params->GRAYMAX + 1;
const int HPW = params->HDPW;
const int HPH = params->HDPH;
int i;
/* allocate a new struct */
new = jbig2_new(ctx, Jbig2PatternDict, 1);
if (... | @@ -257,8 +257,8 @@ jbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment *segment,
{
uint8_t **GSVALS = NULL;
size_t consumed_bytes = 0;
- int i, j, code, stride;
- int x, y;
+ uint32_t i, j, stride, x, y;
+ int code;
Jbig2Image **GSPLANES;
Jbig2GenericRegionParams rparams;
Jb... | CWE-119 | null | null |
14,455 | jbig2_hd_release(Jbig2Ctx *ctx, Jbig2PatternDict *dict)
{
int i;
if (dict == NULL)
return;
for (i = 0; i < dict->n_patterns; i++)
if (dict->patterns[i])
jbig2_image_release(ctx, dict->patterns[i]);
jbig2_free(ctx->allocator, dict->patterns);
jbig2_free(ctx->allocator, di... | Overflow | 0 | jbig2_hd_release(Jbig2Ctx *ctx, Jbig2PatternDict *dict)
{
int i;
if (dict == NULL)
return;
for (i = 0; i < dict->n_patterns; i++)
if (dict->patterns[i])
jbig2_image_release(ctx, dict->patterns[i]);
jbig2_free(ctx->allocator, dict->patterns);
jbig2_free(ctx->allocator, di... | @@ -257,8 +257,8 @@ jbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment *segment,
{
uint8_t **GSVALS = NULL;
size_t consumed_bytes = 0;
- int i, j, code, stride;
- int x, y;
+ uint32_t i, j, stride, x, y;
+ int code;
Jbig2Image **GSPLANES;
Jbig2GenericRegionParams rparams;
Jb... | CWE-119 | null | null |
14,456 | jbig2_pattern_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)
{
Jbig2PatternDictParams params;
Jbig2ArithCx *GB_stats = NULL;
byte flags;
int offset = 0;
/* 7.4.4.1 - Data header */
if (segment->data_length < 7) {
return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, ... | Overflow | 0 | jbig2_pattern_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)
{
Jbig2PatternDictParams params;
Jbig2ArithCx *GB_stats = NULL;
byte flags;
int offset = 0;
/* 7.4.4.1 - Data header */
if (segment->data_length < 7) {
return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, ... | @@ -257,8 +257,8 @@ jbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment *segment,
{
uint8_t **GSVALS = NULL;
size_t consumed_bytes = 0;
- int i, j, code, stride;
- int x, y;
+ uint32_t i, j, stride, x, y;
+ int code;
Jbig2Image **GSPLANES;
Jbig2GenericRegionParams rparams;
Jb... | CWE-119 | null | null |
14,457 | jbig2_build_huffman_table(Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)
{
int *LENCOUNT;
int LENMAX = -1;
const int lencountcount = 256;
const Jbig2HuffmanLine *lines = params->lines;
int n_lines = params->n_lines;
int i, j;
int max_j;
int log_table_size = 0;
Jbig2HuffmanTable *re... | Overflow | 0 | jbig2_build_huffman_table(Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)
{
int *LENCOUNT;
int LENMAX = -1;
const int lencountcount = 256;
const Jbig2HuffmanLine *lines = params->lines;
int n_lines = params->n_lines;
int i, j;
int max_j;
int log_table_size = 0;
Jbig2HuffmanTable *re... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,458 | jbig2_dump_huffman_binary(Jbig2HuffmanState *hs)
{
const uint32_t word = hs->this_word;
int i;
fprintf(stderr, "huffman binary ");
for (i = 31; i >= 0; i--)
fprintf(stderr, ((word >> i) & 1) ? "1" : "0");
fprintf(stderr, "\n");
}
| Overflow | 0 | jbig2_dump_huffman_binary(Jbig2HuffmanState *hs)
{
const uint32_t word = hs->this_word;
int i;
fprintf(stderr, "huffman binary ");
for (i = 31; i >= 0; i--)
fprintf(stderr, ((word >> i) & 1) ? "1" : "0");
fprintf(stderr, "\n");
}
| @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,459 | jbig2_dump_huffman_state(Jbig2HuffmanState *hs)
{
fprintf(stderr, "huffman state %08x %08x offset %d.%d\n", hs->this_word, hs->next_word, hs->offset, hs->offset_bits);
}
| Overflow | 0 | jbig2_dump_huffman_state(Jbig2HuffmanState *hs)
{
fprintf(stderr, "huffman state %08x %08x offset %d.%d\n", hs->this_word, hs->next_word, hs->offset, hs->offset_bits);
}
| @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,460 | jbig2_dump_huffman_table(const Jbig2HuffmanTable *table)
{
int i;
int table_size = (1 << table->log_table_size);
fprintf(stderr, "huffman table %p (log_table_size=%d, %d entries, entryies=%p):\n", table, table->log_table_size, table_size, table->entries);
for (i = 0; i < table_size; i++) {
fpri... | Overflow | 0 | jbig2_dump_huffman_table(const Jbig2HuffmanTable *table)
{
int i;
int table_size = (1 << table->log_table_size);
fprintf(stderr, "huffman table %p (log_table_size=%d, %d entries, entryies=%p):\n", table, table->log_table_size, table_size, table->entries);
for (i = 0; i < table_size; i++) {
fpri... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,461 | jbig2_find_table(Jbig2Ctx *ctx, Jbig2Segment *segment, int index)
{
int i, table_index = 0;
for (i = 0; i < segment->referred_to_segment_count; i++) {
const Jbig2Segment *const rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[i]);
if (rsegment && (rsegment->flags & 63) == 53) {... | Overflow | 0 | jbig2_find_table(Jbig2Ctx *ctx, Jbig2Segment *segment, int index)
{
int i, table_index = 0;
for (i = 0; i < segment->referred_to_segment_count; i++) {
const Jbig2Segment *const rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[i]);
if (rsegment && (rsegment->flags & 63) == 53) {... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,462 | jbig2_huffman_free(Jbig2Ctx *ctx, Jbig2HuffmanState *hs)
{
if (hs != NULL)
jbig2_free(ctx->allocator, hs);
return;
}
| Overflow | 0 | jbig2_huffman_free(Jbig2Ctx *ctx, Jbig2HuffmanState *hs)
{
if (hs != NULL)
jbig2_free(ctx->allocator, hs);
return;
}
| @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,463 | jbig2_huffman_get(Jbig2HuffmanState *hs, const Jbig2HuffmanTable *table, bool *oob)
{
Jbig2HuffmanEntry *entry;
byte flags;
int offset_bits = hs->offset_bits;
uint32_t this_word = hs->this_word;
uint32_t next_word;
int RANGELEN;
int32_t result;
if (hs->offset_limit && hs->offset >= hs->... | Overflow | 0 | jbig2_huffman_get(Jbig2HuffmanState *hs, const Jbig2HuffmanTable *table, bool *oob)
{
Jbig2HuffmanEntry *entry;
byte flags;
int offset_bits = hs->offset_bits;
uint32_t this_word = hs->this_word;
uint32_t next_word;
int RANGELEN;
int32_t result;
if (hs->offset_limit && hs->offset >= hs->... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,464 | jbig2_huffman_new(Jbig2Ctx *ctx, Jbig2WordStream *ws)
{
Jbig2HuffmanState *result = NULL;
result = jbig2_new(ctx, Jbig2HuffmanState, 1);
if (result != NULL) {
result->offset = 0;
result->offset_bits = 0;
result->offset_limit = 0;
result->ws = ws;
result->ctx = ctx;
... | Overflow | 0 | jbig2_huffman_new(Jbig2Ctx *ctx, Jbig2WordStream *ws)
{
Jbig2HuffmanState *result = NULL;
result = jbig2_new(ctx, Jbig2HuffmanState, 1);
if (result != NULL) {
result->offset = 0;
result->offset_bits = 0;
result->offset_limit = 0;
result->ws = ws;
result->ctx = ctx;
... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,465 | jbig2_huffman_offset(Jbig2HuffmanState *hs)
{
return hs->offset + (hs->offset_bits >> 3);
}
| Overflow | 0 | jbig2_huffman_offset(Jbig2HuffmanState *hs)
{
return hs->offset + (hs->offset_bits >> 3);
}
| @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,466 | jbig2_release_huffman_table(Jbig2Ctx *ctx, Jbig2HuffmanTable *table)
{
if (table != NULL) {
jbig2_free(ctx->allocator, table->entries);
jbig2_free(ctx->allocator, table);
}
return;
}
| Overflow | 0 | jbig2_release_huffman_table(Jbig2Ctx *ctx, Jbig2HuffmanTable *table)
{
if (table != NULL) {
jbig2_free(ctx->allocator, table->entries);
jbig2_free(ctx->allocator, table);
}
return;
}
| @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,467 | jbig2_table(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)
{
Jbig2HuffmanParams *params = NULL;
Jbig2HuffmanLine *line = NULL;
segment->result = NULL;
if (segment->data_length < 10)
goto too_short;
{
/* B.2 1) (B.2.1) Code table flags */
const int code_tabl... | Overflow | 0 | jbig2_table(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)
{
Jbig2HuffmanParams *params = NULL;
Jbig2HuffmanLine *line = NULL;
segment->result = NULL;
if (segment->data_length < 10)
goto too_short;
{
/* B.2 1) (B.2.1) Code table flags */
const int code_tabl... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,468 | jbig2_table_free(Jbig2Ctx *ctx, Jbig2HuffmanParams *params)
{
if (params != NULL) {
if (params->lines != NULL)
jbig2_free(ctx->allocator, (void *)params->lines);
jbig2_free(ctx->allocator, params);
}
}
| Overflow | 0 | jbig2_table_free(Jbig2Ctx *ctx, Jbig2HuffmanParams *params)
{
if (params != NULL) {
if (params->lines != NULL)
jbig2_free(ctx->allocator, (void *)params->lines);
jbig2_free(ctx->allocator, params);
}
}
| @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,469 | main(int argc, char **argv)
{
Jbig2Ctx *ctx;
Jbig2HuffmanTable *tables[5];
Jbig2HuffmanState *hs;
Jbig2WordStream ws;
bool oob;
int32_t code;
ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
tables[0] = NULL;
tables[1] = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_A);
t... | Overflow | 0 | main(int argc, char **argv)
{
Jbig2Ctx *ctx;
Jbig2HuffmanTable *tables[5];
Jbig2HuffmanState *hs;
Jbig2WordStream ws;
bool oob;
int32_t code;
ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
tables[0] = NULL;
tables[1] = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_A);
t... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,470 | main(int argc, char **argv)
{
Jbig2Ctx *ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
int i;
for (i = 0; i < countof(tests); i++) {
Jbig2HuffmanTable *table;
Jbig2HuffmanState *hs;
test_stream_t st;
int32_t code;
bool oob;
int j;
st.ws.get_next_wor... | Overflow | 0 | main(int argc, char **argv)
{
Jbig2Ctx *ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
int i;
for (i = 0; i < countof(tests); i++) {
Jbig2HuffmanTable *table;
Jbig2HuffmanState *hs;
test_stream_t st;
int32_t code;
bool oob;
int j;
st.ws.get_next_wor... | @@ -47,16 +47,16 @@ struct _Jbig2HuffmanState {
is (offset + 4) * 8. */
uint32_t this_word;
uint32_t next_word;
- int offset_bits;
- int offset;
- int offset_limit;
+ uint32_t offset_bits;
+ uint32_t offset;
+ uint32_t offset_limit;
Jbig2WordStream *ws;
Jbig2Ctx *ctx;
};... | CWE-119 | null | null |
14,471 | jbig2_image_clear(Jbig2Ctx *ctx, Jbig2Image *image, int value)
{
const uint8_t fill = value ? 0xFF : 0x00;
memset(image->data, fill, image->stride * image->height);
}
| Overflow | 0 | jbig2_image_clear(Jbig2Ctx *ctx, Jbig2Image *image, int value)
{
const uint8_t fill = value ? 0xFF : 0x00;
memset(image->data, fill, image->stride * image->height);
}
| @@ -32,10 +32,10 @@
/* allocate a Jbig2Image structure and its associated bitmap */
Jbig2Image *
-jbig2_image_new(Jbig2Ctx *ctx, int width, int height)
+jbig2_image_new(Jbig2Ctx *ctx, uint32_t width, uint32_t height)
{
Jbig2Image *image;
- int stride;
+ uint32_t stride;
int64_t check;
image ... | CWE-119 | null | null |
14,472 | jbig2_image_clone(Jbig2Ctx *ctx, Jbig2Image *image)
{
if (image)
image->refcount++;
return image;
}
| Overflow | 0 | jbig2_image_clone(Jbig2Ctx *ctx, Jbig2Image *image)
{
if (image)
image->refcount++;
return image;
}
| @@ -32,10 +32,10 @@
/* allocate a Jbig2Image structure and its associated bitmap */
Jbig2Image *
-jbig2_image_new(Jbig2Ctx *ctx, int width, int height)
+jbig2_image_new(Jbig2Ctx *ctx, uint32_t width, uint32_t height)
{
Jbig2Image *image;
- int stride;
+ uint32_t stride;
int64_t check;
image ... | CWE-119 | null | null |
14,473 | jbig2_image_release(Jbig2Ctx *ctx, Jbig2Image *image)
{
if (image == NULL)
return;
image->refcount--;
if (!image->refcount)
jbig2_image_free(ctx, image);
}
| Overflow | 0 | jbig2_image_release(Jbig2Ctx *ctx, Jbig2Image *image)
{
if (image == NULL)
return;
image->refcount--;
if (!image->refcount)
jbig2_image_free(ctx, image);
}
| @@ -32,10 +32,10 @@
/* allocate a Jbig2Image structure and its associated bitmap */
Jbig2Image *
-jbig2_image_new(Jbig2Ctx *ctx, int width, int height)
+jbig2_image_new(Jbig2Ctx *ctx, uint32_t width, uint32_t height)
{
Jbig2Image *image;
- int stride;
+ uint32_t stride;
int64_t check;
image ... | CWE-119 | null | null |
14,474 | jbig2_image_set_pixel(Jbig2Image *image, int x, int y, bool value)
{
const int w = image->width;
const int h = image->height;
int scratch, mask;
int bit, byte;
if ((x < 0) || (x >= w))
return 0;
if ((y < 0) || (y >= h))
return 0;
byte = (x >> 3) + y * image->stride;
bit... | Overflow | 0 | jbig2_image_set_pixel(Jbig2Image *image, int x, int y, bool value)
{
const int w = image->width;
const int h = image->height;
int scratch, mask;
int bit, byte;
if ((x < 0) || (x >= w))
return 0;
if ((y < 0) || (y >= h))
return 0;
byte = (x >> 3) + y * image->stride;
bit... | @@ -32,10 +32,10 @@
/* allocate a Jbig2Image structure and its associated bitmap */
Jbig2Image *
-jbig2_image_new(Jbig2Ctx *ctx, int width, int height)
+jbig2_image_new(Jbig2Ctx *ctx, uint32_t width, uint32_t height)
{
Jbig2Image *image;
- int stride;
+ uint32_t stride;
int64_t check;
image ... | CWE-119 | null | null |
14,475 | jbig2_decode_mmr_consume(Jbig2MmrCtx *mmr, int n_bits)
{
mmr->word <<= n_bits;
mmr->bit_index += n_bits;
while (mmr->bit_index >= 8) {
mmr->bit_index -= 8;
if (mmr->data_index + 4 < mmr->size)
mmr->word |= (mmr->data[mmr->data_index + 4] << mmr->bit_index);
mmr->data_inde... | Overflow | 0 | jbig2_decode_mmr_consume(Jbig2MmrCtx *mmr, int n_bits)
{
mmr->word <<= n_bits;
mmr->bit_index += n_bits;
while (mmr->bit_index >= 8) {
mmr->bit_index -= 8;
if (mmr->data_index + 4 < mmr->size)
mmr->word |= (mmr->data[mmr->data_index + 4] << mmr->bit_index);
mmr->data_inde... | @@ -38,19 +38,21 @@
#include "jbig2_mmr.h"
typedef struct {
- int width;
- int height;
+ uint32_t width;
+ uint32_t height;
const byte *data;
size_t size;
- int data_index;
- int bit_index;
+ uint32_t data_index;
+ uint32_t bit_index;
uint32_t word;
} Jbig2MmrCtx;
+#define ... | CWE-119 | null | null |
14,476 | dump_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, Jbig2Page *page)
{
if (page->x_resolution == 0) {
jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number, "page %d image is %dx%d (unknown res)", page->number, page->width, page->height);
} else if (page->x_resolution == page->y_resolution) {
j... | Overflow | 0 | dump_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, Jbig2Page *page)
{
if (page->x_resolution == 0) {
jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number, "page %d image is %dx%d (unknown res)", page->number, page->width, page->height);
} else if (page->x_resolution == page->y_resolution) {
j... | @@ -155,9 +155,9 @@ int
jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
Jbig2Page page = ctx->pages[ctx->current_page];
- int end_row;
+ uint32_t end_row;
- end_row = jbig2_get_int32(segment_data);
+ end_row = jbig2_get_uint32(segment_data);
if (end_row... | CWE-119 | null | null |
14,477 | jbig2_complete_page(Jbig2Ctx *ctx)
{
int code = 0;
/* check for unfinished segments */
if (ctx->segment_index != ctx->n_segments) {
Jbig2Segment *segment = ctx->segments[ctx->segment_index];
/* Some versions of Xerox Workcentre generate PDF files
with the segment data length fie... | Overflow | 0 | jbig2_complete_page(Jbig2Ctx *ctx)
{
int code = 0;
/* check for unfinished segments */
if (ctx->segment_index != ctx->n_segments) {
Jbig2Segment *segment = ctx->segments[ctx->segment_index];
/* Some versions of Xerox Workcentre generate PDF files
with the segment data length fie... | @@ -155,9 +155,9 @@ int
jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
Jbig2Page page = ctx->pages[ctx->current_page];
- int end_row;
+ uint32_t end_row;
- end_row = jbig2_get_int32(segment_data);
+ end_row = jbig2_get_uint32(segment_data);
if (end_row... | CWE-119 | null | null |
14,478 | jbig2_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
Jbig2Page *page;
/* a new page info segment implies the previous page is finished */
page = &(ctx->pages[ctx->current_page]);
if ((page->number != 0) && ((page->state == JBIG2_PAGE_NEW) || (page->state == JBIG2_PAGE_FR... | Overflow | 0 | jbig2_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
Jbig2Page *page;
/* a new page info segment implies the previous page is finished */
page = &(ctx->pages[ctx->current_page]);
if ((page->number != 0) && ((page->state == JBIG2_PAGE_NEW) || (page->state == JBIG2_PAGE_FR... | @@ -155,9 +155,9 @@ int
jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
Jbig2Page page = ctx->pages[ctx->current_page];
- int end_row;
+ uint32_t end_row;
- end_row = jbig2_get_int32(segment_data);
+ end_row = jbig2_get_uint32(segment_data);
if (end_row... | CWE-119 | null | null |
14,479 | jbig2_page_out(Jbig2Ctx *ctx)
{
int index;
/* search for a completed page */
for (index = 0; index < ctx->max_page_index; index++) {
if (ctx->pages[index].state == JBIG2_PAGE_COMPLETE) {
Jbig2Image *img = ctx->pages[index].image;
uint32_t page_number = ctx->pages[index].numb... | Overflow | 0 | jbig2_page_out(Jbig2Ctx *ctx)
{
int index;
/* search for a completed page */
for (index = 0; index < ctx->max_page_index; index++) {
if (ctx->pages[index].state == JBIG2_PAGE_COMPLETE) {
Jbig2Image *img = ctx->pages[index].image;
uint32_t page_number = ctx->pages[index].numb... | @@ -155,9 +155,9 @@ int
jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
Jbig2Page page = ctx->pages[ctx->current_page];
- int end_row;
+ uint32_t end_row;
- end_row = jbig2_get_int32(segment_data);
+ end_row = jbig2_get_uint32(segment_data);
if (end_row... | CWE-119 | null | null |
14,480 | jbig2_release_page(Jbig2Ctx *ctx, Jbig2Image *image)
{
int index;
/* find the matching page struct and mark it released */
for (index = 0; index < ctx->max_page_index; index++) {
if (ctx->pages[index].image == image) {
jbig2_image_release(ctx, image);
ctx->pages[index].state... | Overflow | 0 | jbig2_release_page(Jbig2Ctx *ctx, Jbig2Image *image)
{
int index;
/* find the matching page struct and mark it released */
for (index = 0; index < ctx->max_page_index; index++) {
if (ctx->pages[index].image == image) {
jbig2_image_release(ctx, image);
ctx->pages[index].state... | @@ -155,9 +155,9 @@ int
jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
Jbig2Page page = ctx->pages[ctx->current_page];
- int end_row;
+ uint32_t end_row;
- end_row = jbig2_get_int32(segment_data);
+ end_row = jbig2_get_uint32(segment_data);
if (end_row... | CWE-119 | null | null |
14,481 | jbig2_get_region_segment_info(Jbig2RegionSegmentInfo *info, const uint8_t *segment_data)
{
/* 7.4.1 */
info->width = jbig2_get_int32(segment_data);
info->height = jbig2_get_int32(segment_data + 4);
info->x = jbig2_get_int32(segment_data + 8);
info->y = jbig2_get_int32(segment_data + 12);
info->f... | Overflow | 0 | jbig2_get_region_segment_info(Jbig2RegionSegmentInfo *info, const uint8_t *segment_data)
{
/* 7.4.1 */
info->width = jbig2_get_int32(segment_data);
info->height = jbig2_get_int32(segment_data + 4);
info->x = jbig2_get_int32(segment_data + 8);
info->y = jbig2_get_int32(segment_data + 12);
info->f... | @@ -39,10 +39,10 @@ jbig2_parse_segment_header(Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size, size_t
uint8_t rtscarf;
uint32_t rtscarf_long;
uint32_t *referred_to_segments;
- int referred_to_segment_count;
- int referred_to_segment_size;
- int pa_size;
- int offset;
+ uint32_t referred_to_s... | CWE-119 | null | null |
14,482 | jbig2_parse_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
uint32_t type = jbig2_get_uint32(segment_data);
bool reserved = type & 0x20000000;
/* bool dependent = type & 0x40000000; (NYI) */
bool necessary = type & 0x80000000;
if (necessary && !reserved) {
... | Overflow | 0 | jbig2_parse_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
{
uint32_t type = jbig2_get_uint32(segment_data);
bool reserved = type & 0x20000000;
/* bool dependent = type & 0x40000000; (NYI) */
bool necessary = type & 0x80000000;
if (necessary && !reserved) {
... | @@ -39,10 +39,10 @@ jbig2_parse_segment_header(Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size, size_t
uint8_t rtscarf;
uint32_t rtscarf_long;
uint32_t *referred_to_segments;
- int referred_to_segment_count;
- int referred_to_segment_size;
- int pa_size;
- int offset;
+ uint32_t referred_to_s... | CWE-119 | null | null |
14,483 | const ECDSA_METHOD *ECDSA_OpenSSL(void)
{
return &openssl_ecdsa_meth;
}
| null | 0 | const ECDSA_METHOD *ECDSA_OpenSSL(void)
{
return &openssl_ecdsa_meth;
}
| @@ -187,11 +187,37 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
while (BN_is_zero(r));
/* compute the inverse of k */
- if (!BN_mod_inverse(k, k, order, ctx))
- {
- ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_BN_LIB);
- goto err; ... | CWE-320 | null | null |
14,484 | static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
const ECDSA_SIG *sig, EC_KEY *eckey)
{
int ret = -1, i;
BN_CTX *ctx;
BIGNUM *order, *u1, *u2, *m, *X;
EC_POINT *point = NULL;
const EC_GROUP *group;
const EC_POINT *pub_key;
/* check input values */
if (eckey == NULL || (group = EC_KEY_g... | null | 0 | static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
const ECDSA_SIG *sig, EC_KEY *eckey)
{
int ret = -1, i;
BN_CTX *ctx;
BIGNUM *order, *u1, *u2, *m, *X;
EC_POINT *point = NULL;
const EC_GROUP *group;
const EC_POINT *pub_key;
/* check input values */
if (eckey == NULL || (group = EC_KEY_g... | @@ -187,11 +187,37 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
while (BN_is_zero(r));
/* compute the inverse of k */
- if (!BN_mod_inverse(k, k, order, ctx))
- {
- ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_BN_LIB);
- goto err; ... | CWE-320 | null | null |
14,485 | XcursorLibraryLoadImage (const char *file, const char *theme, int size)
{
FILE *f = NULL;
XcursorImage *image = NULL;
if (!file)
return NULL;
if (theme)
f = XcursorScanTheme (theme, file);
if (!f)
f = XcursorScanTheme ("default", file);
if (f == XCURSOR_SCAN_CORE)
return NULL... | DoS Exec Code Overflow | 0 | XcursorLibraryLoadImage (const char *file, const char *theme, int size)
{
FILE *f = NULL;
XcursorImage *image = NULL;
if (!file)
return NULL;
if (theme)
f = XcursorScanTheme (theme, file);
if (!f)
f = XcursorScanTheme ("default", file);
if (f == XCURSOR_SCAN_CORE)
return NULL... | @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,486 | XcursorLibraryLoadImages (const char *file, const char *theme, int size)
{
FILE *f = NULL;
XcursorImages *images = NULL;
if (!file)
return NULL;
if (theme)
f = XcursorScanTheme (theme, file);
if (!f)
f = XcursorScanTheme ("default", file);
if (f == XCURSOR_SCAN_CORE)
return NU... | DoS Exec Code Overflow | 0 | XcursorLibraryLoadImages (const char *file, const char *theme, int size)
{
FILE *f = NULL;
XcursorImages *images = NULL;
if (!file)
return NULL;
if (theme)
f = XcursorScanTheme (theme, file);
if (!f)
f = XcursorScanTheme ("default", file);
if (f == XCURSOR_SCAN_CORE)
return NU... | @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,487 | XcursorLibraryShape (const char *library)
{
int low, high;
int mid;
int c;
low = 0;
high = NUM_STANDARD_NAMES - 1;
while (low < high - 1)
{
mid = (low + high) >> 1;
c = strcmp (library, STANDARD_NAME (mid));
if (c == 0)
return (mid << 1);
if (c > 0)
low = mid;
else
high ... | DoS Exec Code Overflow | 0 | XcursorLibraryShape (const char *library)
{
int low, high;
int mid;
int c;
low = 0;
high = NUM_STANDARD_NAMES - 1;
while (low < high - 1)
{
mid = (low + high) >> 1;
c = strcmp (library, STANDARD_NAME (mid));
if (c == 0)
return (mid << 1);
if (c > 0)
low = mid;
else
high ... | @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,488 | XcursorScanTheme (const char *theme, const char *name)
{
FILE *f = NULL;
char *full;
char *dir;
const char *path;
char *inherits = NULL;
const char *i;
if (!theme || !name)
return NULL;
/*
* XCURSOR_CORE_THEME is a magic name; cursors from the core set
* are never fo... | DoS Exec Code Overflow | 0 | XcursorScanTheme (const char *theme, const char *name)
{
FILE *f = NULL;
char *full;
char *dir;
const char *path;
char *inherits = NULL;
const char *i;
if (!theme || !name)
return NULL;
/*
* XCURSOR_CORE_THEME is a magic name; cursors from the core set
* are never fo... | @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,489 | XcursorShapeLoadCursor (Display *dpy, unsigned int shape)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadCursor (dpy, STANDARD_NAME (id));
else
return 0;
}
| DoS Exec Code Overflow | 0 | XcursorShapeLoadCursor (Display *dpy, unsigned int shape)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadCursor (dpy, STANDARD_NAME (id));
else
return 0;
}
| @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,490 | XcursorShapeLoadCursors (Display *dpy, unsigned int shape)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadCursors (dpy, STANDARD_NAME (id));
else
return NULL;
}
| DoS Exec Code Overflow | 0 | XcursorShapeLoadCursors (Display *dpy, unsigned int shape)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadCursors (dpy, STANDARD_NAME (id));
else
return NULL;
}
| @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,491 | XcursorShapeLoadImage (unsigned int shape, const char *theme, int size)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadImage (STANDARD_NAME (id), theme, size);
else
return NULL;
}
| DoS Exec Code Overflow | 0 | XcursorShapeLoadImage (unsigned int shape, const char *theme, int size)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadImage (STANDARD_NAME (id), theme, size);
else
return NULL;
}
| @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,492 | XcursorShapeLoadImages (unsigned int shape, const char *theme, int size)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadImages (STANDARD_NAME (id), theme, size);
else
return NULL;
}
| DoS Exec Code Overflow | 0 | XcursorShapeLoadImages (unsigned int shape, const char *theme, int size)
{
unsigned int id = shape >> 1;
if (id < NUM_STANDARD_NAMES)
return XcursorLibraryLoadImages (STANDARD_NAME (id), theme, size);
else
return NULL;
}
| @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,493 | _XcursorAddPathElt (char *path, const char *elt, int len)
{
size_t pathlen = strlen (path);
/* append / if the path doesn't currently have one */
if (path[0] == '\0' || path[pathlen - 1] != '/')
{
strcat (path, "/");
pathlen++;
}
if (len == -1)
len = strlen (elt);
/* strip leading sla... | DoS Exec Code Overflow | 0 | _XcursorAddPathElt (char *path, const char *elt, int len)
{
size_t pathlen = strlen (path);
/* append / if the path doesn't currently have one */
if (path[0] == '\0' || path[pathlen - 1] != '/')
{
strcat (path, "/");
pathlen++;
}
if (len == -1)
len = strlen (elt);
/* strip leading sla... | @@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
r = result; | CWE-119 | null | null |
14,494 | static void abort_unzip(STATE_PARAM_ONLY)
{
huft_free_all(PASS_STATE_ONLY);
longjmp(error_jmp, 1);
}
| null | 0 | static void abort_unzip(STATE_PARAM_ONLY)
{
huft_free_all(PASS_STATE_ONLY);
longjmp(error_jmp, 1);
}
| @@ -305,11 +305,12 @@ static int huft_build(const unsigned *b, const unsigned n,
unsigned i; /* counter, current code */
unsigned j; /* counter */
int k; /* number of bits in current code */
- unsigned *p; /* pointer into c[], b[], or v[] */
+ const unsigned *p;... | CWE-476 | null | null |
14,495 | static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current, const unsigned required)
{
while (*current < required) {
if (bytebuffer_offset >= bytebuffer_size) {
unsigned sz = bytebuffer_max - 4;
if (to_read >= 0 && to_read < sz) /* unzip only */
sz = to_read;
/* Leave the first 4 b... | null | 0 | static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current, const unsigned required)
{
while (*current < required) {
if (bytebuffer_offset >= bytebuffer_size) {
unsigned sz = bytebuffer_max - 4;
if (to_read >= 0 && to_read < sz) /* unzip only */
sz = to_read;
/* Leave the first 4 b... | @@ -305,11 +305,12 @@ static int huft_build(const unsigned *b, const unsigned n,
unsigned i; /* counter, current code */
unsigned j; /* counter */
int k; /* number of bits in current code */
- unsigned *p; /* pointer into c[], b[], or v[] */
+ const unsigned *p;... | CWE-476 | null | null |
14,496 | static void huft_free_all(STATE_PARAM_ONLY)
{
huft_free(inflate_codes_tl);
huft_free(inflate_codes_td);
inflate_codes_tl = NULL;
inflate_codes_td = NULL;
}
| null | 0 | static void huft_free_all(STATE_PARAM_ONLY)
{
huft_free(inflate_codes_tl);
huft_free(inflate_codes_td);
inflate_codes_tl = NULL;
inflate_codes_td = NULL;
}
| @@ -305,11 +305,12 @@ static int huft_build(const unsigned *b, const unsigned n,
unsigned i; /* counter, current code */
unsigned j; /* counter */
int k; /* number of bits in current code */
- unsigned *p; /* pointer into c[], b[], or v[] */
+ const unsigned *p;... | CWE-476 | null | null |
14,497 | static int cbk_http_request(void *cls,
struct MHD_Connection *connection,
const char *url,
const char *method,
const char *version,
const char *upload_data,
size_t *upload_data_size,
void **ptr)
{
static int dummy;
struct MHD_Response *response;
int ret;
char *nurl;
... | Dir. Trav. | 0 | static int cbk_http_request(void *cls,
struct MHD_Connection *connection,
const char *url,
const char *method,
const char *version,
const char *upload_data,
size_t *upload_data_size,
void **ptr)
{
static int dummy;
struct MHD_Response *response;
int ret;
char *nurl;
... | @@ -23,6 +23,7 @@
#include <libintl.h>
#define _(str) gettext(str)
+#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -245,15 +246,25 @@ static struct MHD_Response *create_response_file(const char *nurl,
static struct MHD_Response *
create_response(const char *nurl, const char *... | CWE-22 | null | null |
14,498 | create_response_api(const char *nurl, const char *method, unsigned int *rp_code)
{
struct MHD_Response *resp;
struct psensor *s;
char *page = NULL;
if (!strcmp(nurl, URL_BASE_API_1_1_SENSORS)) {
page = sensors_to_json_string(server_data.sensors);
#ifdef HAVE_GTOP
} else if (!strcmp(nurl, URL_API_1_1_SYSINFO)) ... | Dir. Trav. | 0 | create_response_api(const char *nurl, const char *method, unsigned int *rp_code)
{
struct MHD_Response *resp;
struct psensor *s;
char *page = NULL;
if (!strcmp(nurl, URL_BASE_API_1_1_SENSORS)) {
page = sensors_to_json_string(server_data.sensors);
#ifdef HAVE_GTOP
} else if (!strcmp(nurl, URL_API_1_1_SYSINFO)) ... | @@ -23,6 +23,7 @@
#include <libintl.h>
#define _(str) gettext(str)
+#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -245,15 +246,25 @@ static struct MHD_Response *create_response_file(const char *nurl,
static struct MHD_Response *
create_response(const char *nurl, const char *... | CWE-22 | null | null |
14,499 | static char *get_path(const char *url, const char *www_dir)
{
const char *p;
char *res;
if (!strlen(url) || !strcmp(url, ".") || !strcmp(url, "/"))
p = "/index.html";
else
p = url;
res = malloc(strlen(www_dir)+strlen(p)+1);
strcpy(res, www_dir);
strcat(res, p);
return res;
}
| Dir. Trav. | 0 | static char *get_path(const char *url, const char *www_dir)
{
const char *p;
char *res;
if (!strlen(url) || !strcmp(url, ".") || !strcmp(url, "/"))
p = "/index.html";
else
p = url;
res = malloc(strlen(www_dir)+strlen(p)+1);
strcpy(res, www_dir);
strcat(res, p);
return res;
}
| @@ -23,6 +23,7 @@
#include <libintl.h>
#define _(str) gettext(str)
+#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -245,15 +246,25 @@ static struct MHD_Response *create_response_file(const char *nurl,
static struct MHD_Response *
create_response(const char *nurl, const char *... | CWE-22 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.