idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
7,400
void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len) { virtqueue_fill(vq, elem, len, 0); virtqueue_flush(vq, 1); }
DoS
0
void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len) { virtqueue_fill(vq, elem, len, 0); virtqueue_flush(vq, 1); }
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,401
static unsigned virtqueue_read_next_desc(VirtIODevice *vdev, VRingDesc *desc, hwaddr desc_pa, unsigned int max) { unsigned int next; /* If this descriptor says it doesn't chain, we're done. */ if (!(desc->flags & VRING_DESC_F_NEXT)) { return max; } ...
DoS
0
static unsigned virtqueue_read_next_desc(VirtIODevice *vdev, VRingDesc *desc, hwaddr desc_pa, unsigned int max) { unsigned int next; /* If this descriptor says it doesn't chain, we're done. */ if (!(desc->flags & VRING_DESC_F_NEXT)) { return max; } ...
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,402
static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len) { unsigned int offset; int i; offset = 0; for (i = 0; i < elem->in_num; i++) { size_t size = MIN(len - offset, elem->in_sg[i].iov_len); cpu_physical_memory_unmap...
DoS
0
static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len) { unsigned int offset; int i; offset = 0; for (i = 0; i < elem->in_num; i++) { size_t size = MIN(len - offset, elem->in_sg[i].iov_len); cpu_physical_memory_unmap...
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,403
static inline uint16_t vring_avail_flags(VirtQueue *vq) { hwaddr pa; pa = vq->vring.avail + offsetof(VRingAvail, flags); return virtio_lduw_phys(vq->vdev, pa); }
DoS
0
static inline uint16_t vring_avail_flags(VirtQueue *vq) { hwaddr pa; pa = vq->vring.avail + offsetof(VRingAvail, flags); return virtio_lduw_phys(vq->vdev, pa); }
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,404
static inline uint16_t vring_avail_ring(VirtQueue *vq, int i) { hwaddr pa; pa = vq->vring.avail + offsetof(VRingAvail, ring[i]); return virtio_lduw_phys(vq->vdev, pa); }
DoS
0
static inline uint16_t vring_avail_ring(VirtQueue *vq, int i) { hwaddr pa; pa = vq->vring.avail + offsetof(VRingAvail, ring[i]); return virtio_lduw_phys(vq->vdev, pa); }
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,405
static void vring_desc_read(VirtIODevice *vdev, VRingDesc *desc, hwaddr desc_pa, int i) { address_space_read(&address_space_memory, desc_pa + i * sizeof(VRingDesc), MEMTXATTRS_UNSPECIFIED, (void *)desc, sizeof(VRingDesc)); virtio_tswap64s(vdev, &desc->addr); ...
DoS
0
static void vring_desc_read(VirtIODevice *vdev, VRingDesc *desc, hwaddr desc_pa, int i) { address_space_read(&address_space_memory, desc_pa + i * sizeof(VRingDesc), MEMTXATTRS_UNSPECIFIED, (void *)desc, sizeof(VRingDesc)); virtio_tswap64s(vdev, &desc->addr); ...
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,406
static inline void vring_used_flags_set_bit(VirtQueue *vq, int mask) { VirtIODevice *vdev = vq->vdev; hwaddr pa; pa = vq->vring.used + offsetof(VRingUsed, flags); virtio_stw_phys(vdev, pa, virtio_lduw_phys(vdev, pa) | mask); }
DoS
0
static inline void vring_used_flags_set_bit(VirtQueue *vq, int mask) { VirtIODevice *vdev = vq->vdev; hwaddr pa; pa = vq->vring.used + offsetof(VRingUsed, flags); virtio_stw_phys(vdev, pa, virtio_lduw_phys(vdev, pa) | mask); }
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,407
static inline void vring_used_flags_unset_bit(VirtQueue *vq, int mask) { VirtIODevice *vdev = vq->vdev; hwaddr pa; pa = vq->vring.used + offsetof(VRingUsed, flags); virtio_stw_phys(vdev, pa, virtio_lduw_phys(vdev, pa) & ~mask); }
DoS
0
static inline void vring_used_flags_unset_bit(VirtQueue *vq, int mask) { VirtIODevice *vdev = vq->vdev; hwaddr pa; pa = vq->vring.used + offsetof(VRingUsed, flags); virtio_stw_phys(vdev, pa, virtio_lduw_phys(vdev, pa) & ~mask); }
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,408
static inline void vring_used_write(VirtQueue *vq, VRingUsedElem *uelem, int i) { hwaddr pa; virtio_tswap32s(vq->vdev, &uelem->id); virtio_tswap32s(vq->vdev, &uelem->len); pa = vq->vring.used + offsetof(VRingUsed, ring[i]); address_space_write(&address_space_memor...
DoS
0
static inline void vring_used_write(VirtQueue *vq, VRingUsedElem *uelem, int i) { hwaddr pa; virtio_tswap32s(vq->vdev, &uelem->id); virtio_tswap32s(vq->vdev, &uelem->len); pa = vq->vring.used + offsetof(VRingUsed, ring[i]); address_space_write(&address_space_memor...
@@ -458,6 +458,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); + if (!sz) { + error_report("virtio: zero sized buffers are not allowed"); + exit(1); + } + while (sz) { hwaddr l...
CWE-20
null
null
7,409
void vrend_renderer_context_destroy(uint32_t handle) { struct vrend_decode_ctx *ctx; bool ret; if (handle >= VREND_MAX_CTX) return; ctx = dec_ctx[handle]; if (!ctx) return; dec_ctx[handle] = NULL; ret = vrend_destroy_context(ctx->grctx); free(ctx); /* switch to ctx 0 */ if (r...
DoS
0
void vrend_renderer_context_destroy(uint32_t handle) { struct vrend_decode_ctx *ctx; bool ret; if (handle >= VREND_MAX_CTX) return; ctx = dec_ctx[handle]; if (!ctx) return; dec_ctx[handle] = NULL; ret = vrend_destroy_context(ctx->grctx); free(ctx); /* switch to ctx 0 */ if (r...
@@ -612,6 +612,10 @@ static int vrend_decode_create_ve(struct vrend_decode_ctx *ctx, uint32_t handle, ve[i].src_offset = get_buf_entry(ctx, VIRGL_OBJ_VERTEX_ELEMENTS_V0_SRC_OFFSET(i)); ve[i].instance_divisor = get_buf_entry(ctx, VIRGL_OBJ_VERTEX_ELEMENTS_V0_INSTANCE_DIVISOR(i)); ve[i].vert...
CWE-125
null
null
7,410
bash_push_line () { if (push_to_readline) { rl_insert_text (push_to_readline); free (push_to_readline); push_to_readline = (char *)NULL; rl_startup_hook = old_rl_startup_hook; } return 0; }
+Priv
0
bash_push_line () { if (push_to_readline) { rl_insert_text (push_to_readline); free (push_to_readline); push_to_readline = (char *)NULL; rl_startup_hook = old_rl_startup_hook; } return 0; }
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int)); static rl_icppfunc_t *save_directory_hook __P((void)); static void restore_directory_hook __P((rl_icppfunc_t)); -static int directory_exists __P((const char *)); +static int directory_exists __P((const char *, int)); static void clean...
CWE-20
null
null
7,411
bashline_reset_event_hook () { rl_signal_event_hook = 0; }
+Priv
0
bashline_reset_event_hook () { rl_signal_event_hook = 0; }
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int)); static rl_icppfunc_t *save_directory_hook __P((void)); static void restore_directory_hook __P((rl_icppfunc_t)); -static int directory_exists __P((const char *)); +static int directory_exists __P((const char *, int)); static void clean...
CWE-20
null
null
7,412
cleanup_expansion_error () { char *to_free; #if defined (BANG_HISTORY) int old_verify; old_verify = hist_verify; hist_verify = 0; #endif fprintf (rl_outstream, "\r\n"); to_free = pre_process_line (rl_line_buffer, 1, 0); #if defined (BANG_HISTORY) hist_verify = old_verify; #endif if (to_free != rl_line...
+Priv
0
cleanup_expansion_error () { char *to_free; #if defined (BANG_HISTORY) int old_verify; old_verify = hist_verify; hist_verify = 0; #endif fprintf (rl_outstream, "\r\n"); to_free = pre_process_line (rl_line_buffer, 1, 0); #if defined (BANG_HISTORY) hist_verify = old_verify; #endif if (to_free != rl_line...
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int)); static rl_icppfunc_t *save_directory_hook __P((void)); static void restore_directory_hook __P((rl_icppfunc_t)); -static int directory_exists __P((const char *)); +static int directory_exists __P((const char *, int)); static void clean...
CWE-20
null
null
7,413
get_hostname_list () { if (hostname_list_initialized == 0) initialize_hostname_list (); return (hostname_list); }
+Priv
0
get_hostname_list () { if (hostname_list_initialized == 0) initialize_hostname_list (); return (hostname_list); }
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int)); static rl_icppfunc_t *save_directory_hook __P((void)); static void restore_directory_hook __P((rl_icppfunc_t)); -static int directory_exists __P((const char *)); +static int directory_exists __P((const char *, int)); static void clean...
CWE-20
null
null
7,414
initialize_readline () { rl_command_func_t *func; char kseq[2]; if (bash_readline_initialized) return; rl_terminal_name = get_string_value ("TERM"); rl_instream = stdin; rl_outstream = stderr; /* Allow conditional parsing of the ~/.inputrc file. */ rl_readline_name = "Bash"; /* Add bindable na...
+Priv
0
initialize_readline () { rl_command_func_t *func; char kseq[2]; if (bash_readline_initialized) return; rl_terminal_name = get_string_value ("TERM"); rl_instream = stdin; rl_outstream = stderr; /* Allow conditional parsing of the ~/.inputrc file. */ rl_readline_name = "Bash"; /* Add bindable na...
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int)); static rl_icppfunc_t *save_directory_hook __P((void)); static void restore_directory_hook __P((rl_icppfunc_t)); -static int directory_exists __P((const char *)); +static int directory_exists __P((const char *, int)); static void clean...
CWE-20
null
null
7,415
reset_completer_word_break_chars () { rl_completer_word_break_characters = perform_hostname_completion ? savestring (bash_completer_word_break_characters) : savestring (bash_nohostname_word_break_characters); }
+Priv
0
reset_completer_word_break_chars () { rl_completer_word_break_characters = perform_hostname_completion ? savestring (bash_completer_word_break_characters) : savestring (bash_nohostname_word_break_characters); }
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int)); static rl_icppfunc_t *save_directory_hook __P((void)); static void restore_directory_hook __P((rl_icppfunc_t)); -static int directory_exists __P((const char *)); +static int directory_exists __P((const char *, int)); static void clean...
CWE-20
null
null
7,416
save_directory_hook () { rl_icppfunc_t *ret; if (dircomplete_expand) { ret = rl_directory_completion_hook; rl_directory_completion_hook = (rl_icppfunc_t *)NULL; } else { ret = rl_directory_rewrite_hook; rl_directory_rewrite_hook = (rl_icppfunc_t *)NULL; } return ret; }
+Priv
0
save_directory_hook () { rl_icppfunc_t *ret; if (dircomplete_expand) { ret = rl_directory_completion_hook; rl_directory_completion_hook = (rl_icppfunc_t *)NULL; } else { ret = rl_directory_rewrite_hook; rl_directory_rewrite_hook = (rl_icppfunc_t *)NULL; } return ret; }
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int)); static rl_icppfunc_t *save_directory_hook __P((void)); static void restore_directory_hook __P((rl_icppfunc_t)); -static int directory_exists __P((const char *)); +static int directory_exists __P((const char *, int)); static void clean...
CWE-20
null
null
7,417
clear_fifo_list () { }
+Priv
0
clear_fifo_list () { }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,418
fifos_pending () { return nfifo; }
+Priv
0
fifos_pending () { return nfifo; }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,419
fifos_pending () { return 0; /* used for cleanup; not needed with /dev/fd */ }
+Priv
0
fifos_pending () { return 0; /* used for cleanup; not needed with /dev/fd */ }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,420
getifs () { return ifs_value; }
+Priv
0
getifs () { return ifs_value; }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,421
invalidate_cached_quoted_dollar_at () { dispose_words (cached_quoted_dollar_at); cached_quoted_dollar_at = 0; }
+Priv
0
invalidate_cached_quoted_dollar_at () { dispose_words (cached_quoted_dollar_at); cached_quoted_dollar_at = 0; }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,422
list_rest_of_args () { register WORD_LIST *list, *args; int i; /* Break out of the loop as soon as one of the dollar variables is null. */ for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) list = make_word_list (make_bare_word (dollar_vars[i]), list); for (args = rest_of_args; args; a...
+Priv
0
list_rest_of_args () { register WORD_LIST *list, *args; int i; /* Break out of the loop as soon as one of the dollar variables is null. */ for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) list = make_word_list (make_bare_word (dollar_vars[i]), list); for (args = rest_of_args; args; a...
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,423
make_named_pipe () { char *tname; tname = sh_mktmpname ("sh-np", MT_USERANDOM|MT_USETMPDIR); if (mkfifo (tname, 0600) < 0) { free (tname); return ((char *)NULL); } add_fifo_list (tname); return (tname); }
+Priv
0
make_named_pipe () { char *tname; tname = sh_mktmpname ("sh-np", MT_USERANDOM|MT_USETMPDIR); if (mkfifo (tname, 0600) < 0) { free (tname); return ((char *)NULL); } add_fifo_list (tname); return (tname); }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,424
num_fifos () { return nfds; }
+Priv
0
num_fifos () { return nfds; }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,425
number_of_args () { register WORD_LIST *list; int n; for (n = 0; n < 9 && dollar_vars[n+1]; n++) ; for (list = rest_of_args; list; list = list->next) n++; return n; }
+Priv
0
number_of_args () { register WORD_LIST *list; int n; for (n = 0; n < 9 && dollar_vars[n+1]; n++) ; for (list = rest_of_args; list; list = list->next) n++; return n; }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,426
print_dev_fd_list () { register int i; fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); fflush (stderr); for (i = 0; i < totfds; i++) { if (dev_fd_list[i]) fprintf (stderr, " %d", i); } fprintf (stderr, "\n"); }
+Priv
0
print_dev_fd_list () { register int i; fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); fflush (stderr); for (i = 0; i < totfds; i++) { if (dev_fd_list[i]) fprintf (stderr, " %d", i); } fprintf (stderr, "\n"); }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,427
unlink_fifo_list () { register int i; if (nfds == 0) return; for (i = 0; nfds && i < totfds; i++) unlink_fifo (i); nfds = 0; }
+Priv
0
unlink_fifo_list () { register int i; if (nfds == 0) return; for (i = 0; nfds && i < totfds; i++) unlink_fifo (i); nfds = 0; }
@@ -9458,6 +9458,10 @@ add_twochars: tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */ if (word->flags & W_COMPLETE) tword->flags |= W_COMPLETE; /* for command substitutions */ + if (word->flags & W_NOCOMSUB) + tword->flags |= W_NOCOMSUB; + if (word->flags & W_NOPROCSU...
CWE-20
null
null
7,428
static int appendenv(const char *opt, const char *new) { char buf[1024]; char *old = getenv(opt); buf[1023] = 0; if (old) snprintf(buf, 1023, "%s %s", old, new); else snprintf(buf, 1023, "%s", new); return setenv(opt, buf, 1); }
DoS Overflow
0
static int appendenv(const char *opt, const char *new) { char buf[1024]; char *old = getenv(opt); buf[1023] = 0; if (old) snprintf(buf, 1023, "%s %s", old, new); else snprintf(buf, 1023, "%s", new); return setenv(opt, buf, 1); }
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,429
static int link_proto(int unit_nr, const char *devname, uint64_t flags) { int ip_fd, mux_id, tun2_fd; struct lifreq ifr; tun2_fd = open("/dev/tun", O_RDWR); if (tun2_fd < 0) { perror(_("Could not /dev/tun for plumbing")); return -EIO; } if (ioctl(tun2_fd, I_PUSH, "ip") < 0) { perror(_("Can't push IP")); ...
DoS Overflow
0
static int link_proto(int unit_nr, const char *devname, uint64_t flags) { int ip_fd, mux_id, tun2_fd; struct lifreq ifr; tun2_fd = open("/dev/tun", O_RDWR); if (tun2_fd < 0) { perror(_("Could not /dev/tun for plumbing")); return -EIO; } if (ioctl(tun2_fd, I_PUSH, "ip") < 0) { perror(_("Can't push IP")); ...
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,430
static int os_setup_tun(struct openconnect_info *vpninfo) { int tun_fd; #ifdef IFF_TUN /* Linux */ struct ifreq ifr; int tunerr; tun_fd = open("/dev/net/tun", O_RDWR); if (tun_fd < 0) { /* Android has /dev/tun instead of /dev/net/tun Since other systems might have too, just try it as a fallback inste...
DoS Overflow
0
static int os_setup_tun(struct openconnect_info *vpninfo) { int tun_fd; #ifdef IFF_TUN /* Linux */ struct ifreq ifr; int tunerr; tun_fd = open("/dev/net/tun", O_RDWR); if (tun_fd < 0) { /* Android has /dev/tun instead of /dev/net/tun Since other systems might have too, just try it as a fallback inste...
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,431
int script_config_tun(struct openconnect_info *vpninfo, const char *reason) { if (!vpninfo->vpnc_script) return 0; setenv("reason", reason, 1); if (system(vpninfo->vpnc_script)) { int e = errno; vpn_progress(vpninfo, PRG_ERR, _("Failed to spawn script '%s' for %s: %s\n"), vpninfo->vpnc_script,...
DoS Overflow
0
int script_config_tun(struct openconnect_info *vpninfo, const char *reason) { if (!vpninfo->vpnc_script) return 0; setenv("reason", reason, 1); if (system(vpninfo->vpnc_script)) { int e = errno; vpn_progress(vpninfo, PRG_ERR, _("Failed to spawn script '%s' for %s: %s\n"), vpninfo->vpnc_script,...
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,432
static void setenv_cstp_opts(struct openconnect_info *vpninfo) { char *env_buf; int buflen = 0; int bufofs = 0; struct vpn_option *opt; for (opt = vpninfo->cstp_options; opt; opt = opt->next) buflen += 2 + strlen(opt->option) + strlen(opt->value); env_buf = malloc(buflen + 1); if (!env_buf) return; env_b...
DoS Overflow
0
static void setenv_cstp_opts(struct openconnect_info *vpninfo) { char *env_buf; int buflen = 0; int bufofs = 0; struct vpn_option *opt; for (opt = vpninfo->cstp_options; opt; opt = opt->next) buflen += 2 + strlen(opt->option) + strlen(opt->value); env_buf = malloc(buflen + 1); if (!env_buf) return; env_b...
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,433
static int setenv_int(const char *opt, int value) { char buf[16]; sprintf(buf, "%d", value); return setenv(opt, buf, 1); }
DoS Overflow
0
static int setenv_int(const char *opt, int value) { char buf[16]; sprintf(buf, "%d", value); return setenv(opt, buf, 1); }
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,434
int setup_tun(struct openconnect_info *vpninfo) { int tun_fd; set_script_env(vpninfo); if (vpninfo->script_tun) { pid_t child; int fds[2]; if (socketpair(AF_UNIX, SOCK_DGRAM, 0, fds)) { perror(_("socketpair")); exit(1); } tun_fd = fds[0]; child = fork(); if (child < 0) { perror(_("fork")); ...
DoS Overflow
0
int setup_tun(struct openconnect_info *vpninfo) { int tun_fd; set_script_env(vpninfo); if (vpninfo->script_tun) { pid_t child; int fds[2]; if (socketpair(AF_UNIX, SOCK_DGRAM, 0, fds)) { perror(_("socketpair")); exit(1); } tun_fd = fds[0]; child = fork(); if (child < 0) { perror(_("fork")); ...
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,435
void shutdown_tun(struct openconnect_info *vpninfo) { if (vpninfo->script_tun) { kill(vpninfo->script_tun, SIGHUP); } else { script_config_tun(vpninfo, "disconnect"); #ifdef __sun__ close(vpninfo->ip_fd); vpninfo->ip_fd = -1; if (vpninfo->ip6_fd != -1) { close(vpninfo->ip6_fd); vpninfo->ip6_fd = -1; ...
DoS Overflow
0
void shutdown_tun(struct openconnect_info *vpninfo) { if (vpninfo->script_tun) { kill(vpninfo->script_tun, SIGHUP); } else { script_config_tun(vpninfo, "disconnect"); #ifdef __sun__ close(vpninfo->ip_fd); vpninfo->ip_fd = -1; if (vpninfo->ip6_fd != -1) { close(vpninfo->ip6_fd); vpninfo->ip6_fd = -1; ...
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,436
int tun_mainloop(struct openconnect_info *vpninfo, int *timeout) { int work_done = 0; int prefix_size = 0; #ifdef TUN_HAS_AF_PREFIX if (!vpninfo->script_tun) prefix_size = sizeof(int); #endif if (FD_ISSET(vpninfo->tun_fd, &vpninfo->select_rfds)) { while (1) { int len = vpninfo->mtu; if (!out_pkt) { ...
DoS Overflow
0
int tun_mainloop(struct openconnect_info *vpninfo, int *timeout) { int work_done = 0; int prefix_size = 0; #ifdef TUN_HAS_AF_PREFIX if (!vpninfo->script_tun) prefix_size = sizeof(int); #endif if (FD_ISSET(vpninfo->tun_fd, &vpninfo->select_rfds)) { while (1) { int len = vpninfo->mtu; if (!out_pkt) { ...
@@ -224,7 +224,7 @@ static void set_banner(struct openconnect_info *vpninfo) char *banner, *q; const char *p; - if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)))) { + if (!vpninfo->banner || !(banner = malloc(strlen(vpninfo->banner)+1))) { unsetenv("CISCO_...
CWE-119
null
null
7,437
static void do_busid_cmd(ESPState *s, uint8_t *buf, uint8_t busid) { int32_t datalen; int lun; SCSIDevice *current_lun; trace_esp_do_busid_cmd(busid); lun = busid & 7; current_lun = scsi_device_find(&s->bus, 0, s->current_dev->id, lun); s->current_req = scsi_req_new(current_lun, 0, lun, buf...
DoS Exec Code
0
static void do_busid_cmd(ESPState *s, uint8_t *buf, uint8_t busid) { int32_t datalen; int lun; SCSIDevice *current_lun; trace_esp_do_busid_cmd(busid); lun = busid & 7; current_lun = scsi_device_find(&s->bus, 0, s->current_dev->id, lun); s->current_req = scsi_req_new(current_lun, 0, lun, buf...
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,438
static void do_cmd(ESPState *s, uint8_t *buf) { uint8_t busid = buf[0]; do_busid_cmd(s, &buf[1], busid); }
DoS Exec Code
0
static void do_cmd(ESPState *s, uint8_t *buf) { uint8_t busid = buf[0]; do_busid_cmd(s, &buf[1], busid); }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,439
static void esp_dma_done(ESPState *s) { s->rregs[ESP_RSTAT] |= STAT_TC; s->rregs[ESP_RINTR] = INTR_BS; s->rregs[ESP_RSEQ] = 0; s->rregs[ESP_RFLAGS] = 0; s->rregs[ESP_TCLO] = 0; s->rregs[ESP_TCMID] = 0; s->rregs[ESP_TCHI] = 0; esp_raise_irq(s); }
DoS Exec Code
0
static void esp_dma_done(ESPState *s) { s->rregs[ESP_RSTAT] |= STAT_TC; s->rregs[ESP_RINTR] = INTR_BS; s->rregs[ESP_RSEQ] = 0; s->rregs[ESP_RFLAGS] = 0; s->rregs[ESP_TCLO] = 0; s->rregs[ESP_TCMID] = 0; s->rregs[ESP_TCHI] = 0; esp_raise_irq(s); }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,440
void esp_dma_enable(ESPState *s, int irq, int level) { if (level) { s->dma_enabled = 1; trace_esp_dma_enable(); if (s->dma_cb) { s->dma_cb(s); s->dma_cb = NULL; } } else { trace_esp_dma_disable(); s->dma_enabled = 0; } }
DoS Exec Code
0
void esp_dma_enable(ESPState *s, int irq, int level) { if (level) { s->dma_enabled = 1; trace_esp_dma_enable(); if (s->dma_cb) { s->dma_cb(s); s->dma_cb = NULL; } } else { trace_esp_dma_disable(); s->dma_enabled = 0; } }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,441
static void esp_lower_irq(ESPState *s) { if (s->rregs[ESP_RSTAT] & STAT_INT) { s->rregs[ESP_RSTAT] &= ~STAT_INT; qemu_irq_lower(s->irq); trace_esp_lower_irq(); } }
DoS Exec Code
0
static void esp_lower_irq(ESPState *s) { if (s->rregs[ESP_RSTAT] & STAT_INT) { s->rregs[ESP_RSTAT] &= ~STAT_INT; qemu_irq_lower(s->irq); trace_esp_lower_irq(); } }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,442
static void esp_raise_irq(ESPState *s) { if (!(s->rregs[ESP_RSTAT] & STAT_INT)) { s->rregs[ESP_RSTAT] |= STAT_INT; qemu_irq_raise(s->irq); trace_esp_raise_irq(); } }
DoS Exec Code
0
static void esp_raise_irq(ESPState *s) { if (!(s->rregs[ESP_RSTAT] & STAT_INT)) { s->rregs[ESP_RSTAT] |= STAT_INT; qemu_irq_raise(s->irq); trace_esp_raise_irq(); } }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,443
void esp_request_cancelled(SCSIRequest *req) { ESPState *s = req->hba_private; if (req == s->current_req) { scsi_req_unref(s->current_req); s->current_req = NULL; s->current_dev = NULL; } }
DoS Exec Code
0
void esp_request_cancelled(SCSIRequest *req) { ESPState *s = req->hba_private; if (req == s->current_req) { scsi_req_unref(s->current_req); s->current_req = NULL; s->current_dev = NULL; } }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,444
static void handle_s_without_atn(ESPState *s) { uint8_t buf[32]; int len; if (s->dma && !s->dma_enabled) { s->dma_cb = handle_s_without_atn; return; } len = get_cmd(s, buf, sizeof(buf)); if (len) { do_busid_cmd(s, buf, 0); } }
DoS Exec Code
0
static void handle_s_without_atn(ESPState *s) { uint8_t buf[32]; int len; if (s->dma && !s->dma_enabled) { s->dma_cb = handle_s_without_atn; return; } len = get_cmd(s, buf, sizeof(buf)); if (len) { do_busid_cmd(s, buf, 0); } }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,445
static void handle_satn(ESPState *s) { uint8_t buf[32]; int len; if (s->dma && !s->dma_enabled) { s->dma_cb = handle_satn; return; } len = get_cmd(s, buf, sizeof(buf)); if (len) do_cmd(s, buf); }
DoS Exec Code
0
static void handle_satn(ESPState *s) { uint8_t buf[32]; int len; if (s->dma && !s->dma_enabled) { s->dma_cb = handle_satn; return; } len = get_cmd(s, buf, sizeof(buf)); if (len) do_cmd(s, buf); }
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,446
static void handle_satn_stop(ESPState *s) { if (s->dma && !s->dma_enabled) { s->dma_cb = handle_satn_stop; return; } s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf)); if (s->cmdlen) { trace_esp_handle_satn_stop(s->cmdlen); s->do_cmd = 1; s->rregs[ESP_RSTAT] = ...
DoS Exec Code
0
static void handle_satn_stop(ESPState *s) { if (s->dma && !s->dma_enabled) { s->dma_cb = handle_satn_stop; return; } s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf)); if (s->cmdlen) { trace_esp_handle_satn_stop(s->cmdlen); s->do_cmd = 1; s->rregs[ESP_RSTAT] = ...
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,447
static void write_response(ESPState *s) { trace_esp_write_response(s->status); s->ti_buf[0] = s->status; s->ti_buf[1] = 0; if (s->dma) { s->dma_memory_write(s->dma_opaque, s->ti_buf, 2); s->rregs[ESP_RSTAT] = STAT_TC | STAT_ST; s->rregs[ESP_RINTR] = INTR_BS | INTR_FC; s->...
DoS Exec Code
0
static void write_response(ESPState *s) { trace_esp_write_response(s->status); s->ti_buf[0] = s->status; s->ti_buf[1] = 0; if (s->dma) { s->dma_memory_write(s->dma_opaque, s->ti_buf, 2); s->rregs[ESP_RSTAT] = STAT_TC | STAT_ST; s->rregs[ESP_RINTR] = INTR_BS | INTR_FC; s->...
@@ -248,6 +248,8 @@ static void esp_do_dma(ESPState *s) len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); + assert (s->cmdlen <= sizeof(s->cmdbuf) && + len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], le...
CWE-787
null
null
7,448
void esp_command_complete(SCSIRequest *req, uint32_t status, size_t resid) { ESPState *s = req->hba_private; trace_esp_command_complete(); if (s->ti_size != 0) { trace_esp_command_complete_unexpected(); } s->ti_size = 0; s->dma_left = 0; s->async_len...
DoS Exec Code
0
void esp_command_complete(SCSIRequest *req, uint32_t status, size_t resid) { ESPState *s = req->hba_private; trace_esp_command_complete(); if (s->ti_size != 0) { trace_esp_command_complete_unexpected(); } s->ti_size = 0; s->dma_left = 0; s->async_len...
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,449
static void esp_do_dma(ESPState *s) { uint32_t len; int to_device; len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); assert (s->cmdlen <= sizeof(s->cmdbuf) && len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[...
DoS Exec Code
0
static void esp_do_dma(ESPState *s) { uint32_t len; int to_device; len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); assert (s->cmdlen <= sizeof(s->cmdbuf) && len <= sizeof(s->cmdbuf) - s->cmdlen); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[...
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,450
void esp_hard_reset(ESPState *s) { memset(s->rregs, 0, ESP_REGS); memset(s->wregs, 0, ESP_REGS); s->tchi_written = 0; s->ti_size = 0; s->ti_rptr = 0; s->ti_wptr = 0; s->dma = 0; s->do_cmd = 0; s->dma_cb = NULL; s->rregs[ESP_CFG1] = 7; }
DoS Exec Code
0
void esp_hard_reset(ESPState *s) { memset(s->rregs, 0, ESP_REGS); memset(s->wregs, 0, ESP_REGS); s->tchi_written = 0; s->ti_size = 0; s->ti_rptr = 0; s->ti_wptr = 0; s->dma = 0; s->do_cmd = 0; s->dma_cb = NULL; s->rregs[ESP_CFG1] = 7; }
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,451
void esp_init(hwaddr espaddr, int it_shift, ESPDMAMemoryReadWriteFunc dma_memory_read, ESPDMAMemoryReadWriteFunc dma_memory_write, void *dma_opaque, qemu_irq irq, qemu_irq *reset, qemu_irq *dma_enable) { DeviceState *dev; SysBusDevice *s; SysBusESPStat...
DoS Exec Code
0
void esp_init(hwaddr espaddr, int it_shift, ESPDMAMemoryReadWriteFunc dma_memory_read, ESPDMAMemoryReadWriteFunc dma_memory_write, void *dma_opaque, qemu_irq irq, qemu_irq *reset, qemu_irq *dma_enable) { DeviceState *dev; SysBusDevice *s; SysBusESPStat...
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,452
static bool esp_mem_accepts(void *opaque, hwaddr addr, unsigned size, bool is_write) { return (size == 1) || (is_write && size == 4); }
DoS Exec Code
0
static bool esp_mem_accepts(void *opaque, hwaddr addr, unsigned size, bool is_write) { return (size == 1) || (is_write && size == 4); }
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,453
void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val) { trace_esp_mem_writeb(saddr, s->wregs[saddr], val); switch (saddr) { case ESP_TCHI: s->tchi_written = true; /* fall through */ case ESP_TCLO: case ESP_TCMID: s->rregs[ESP_RSTAT] &= ~STAT_TC; break; cas...
DoS Exec Code
0
void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val) { trace_esp_mem_writeb(saddr, s->wregs[saddr], val); switch (saddr) { case ESP_TCHI: s->tchi_written = true; /* fall through */ case ESP_TCLO: case ESP_TCMID: s->rregs[ESP_RSTAT] &= ~STAT_TC; break; cas...
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,454
static void esp_register_types(void) { type_register_static(&sysbus_esp_info); }
DoS Exec Code
0
static void esp_register_types(void) { type_register_static(&sysbus_esp_info); }
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,455
static void esp_soft_reset(ESPState *s) { qemu_irq_lower(s->irq); esp_hard_reset(s); }
DoS Exec Code
0
static void esp_soft_reset(ESPState *s) { qemu_irq_lower(s->irq); esp_hard_reset(s); }
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,456
static void sysbus_esp_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = sysbus_esp_realize; dc->reset = sysbus_esp_hard_reset; dc->vmsd = &vmstate_sysbus_esp_scsi; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); }
DoS Exec Code
0
static void sysbus_esp_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = sysbus_esp_realize; dc->reset = sysbus_esp_hard_reset; dc->vmsd = &vmstate_sysbus_esp_scsi; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); }
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,457
static void sysbus_esp_gpio_demux(void *opaque, int irq, int level) { SysBusESPState *sysbus = ESP(opaque); ESPState *s = &sysbus->esp; switch (irq) { case 0: parent_esp_reset(s, irq, level); break; case 1: esp_dma_enable(opaque, irq, level); break; } }
DoS Exec Code
0
static void sysbus_esp_gpio_demux(void *opaque, int irq, int level) { SysBusESPState *sysbus = ESP(opaque); ESPState *s = &sysbus->esp; switch (irq) { case 0: parent_esp_reset(s, irq, level); break; case 1: esp_dma_enable(opaque, irq, level); break; } }
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,458
static uint64_t sysbus_esp_mem_read(void *opaque, hwaddr addr, unsigned int size) { SysBusESPState *sysbus = opaque; uint32_t saddr; saddr = addr >> sysbus->it_shift; return esp_reg_read(&sysbus->esp, saddr); }
DoS Exec Code
0
static uint64_t sysbus_esp_mem_read(void *opaque, hwaddr addr, unsigned int size) { SysBusESPState *sysbus = opaque; uint32_t saddr; saddr = addr >> sysbus->it_shift; return esp_reg_read(&sysbus->esp, saddr); }
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr, const VMStateDescription vmstate_esp = { .name ="esp", - .version_id = 3, + .version_id = 4, .minimum_version_id = 3, .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), @@ -585,7 +585,8 @@ const VMStat...
CWE-787
null
null
7,459
apply_nonancestor_delayed_set_stat (char const *file_name, bool after_links) { size_t file_name_len = strlen (file_name); bool check_for_renamed_directories = 0; while (delayed_set_stat_head) { struct delayed_set_stat *data = delayed_set_stat_head; bool skip_this_one = 0; struct stat st; ...
Dir. Trav. Bypass
0
apply_nonancestor_delayed_set_stat (char const *file_name, bool after_links) { size_t file_name_len = strlen (file_name); bool check_for_renamed_directories = 0; while (delayed_set_stat_head) { struct delayed_set_stat *data = delayed_set_stat_head; bool skip_this_one = 0; struct stat st; ...
@@ -1629,12 +1629,20 @@ extract_archive (void) { char typeflag; tar_extractor_t fun; + bool skip_dotdot_name; fatal_exit_hook = extract_finish; set_next_block_after (current_header); + skip_dotdot_name = (!absolute_names_option + && contains_dot_dot (current_stat_info.orig_file_name)); + if...
CWE-22
null
null
7,460
extr_init (void) { we_are_root = geteuid () == ROOT_UID; same_permissions_option += we_are_root; same_owner_option += we_are_root; /* Option -p clears the kernel umask, so it does not affect proper restoration of file permissions. New intermediate directories will comply with umask at start of progr...
Dir. Trav. Bypass
0
extr_init (void) { we_are_root = geteuid () == ROOT_UID; same_permissions_option += we_are_root; same_owner_option += we_are_root; /* Option -p clears the kernel umask, so it does not affect proper restoration of file permissions. New intermediate directories will comply with umask at start of progr...
@@ -1629,12 +1629,20 @@ extract_archive (void) { char typeflag; tar_extractor_t fun; + bool skip_dotdot_name; fatal_exit_hook = extract_finish; set_next_block_after (current_header); + skip_dotdot_name = (!absolute_names_option + && contains_dot_dot (current_stat_info.orig_file_name)); + if...
CWE-22
null
null
7,461
int SSL_in_init(SSL *s) { return s->statem.in_init; }
DoS Exec Code
0
int SSL_in_init(SSL *s) { return s->statem.in_init; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,462
int SSL_is_init_finished(SSL *s) { return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK); }
DoS Exec Code
0
int SSL_is_init_finished(SSL *s) { return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK); }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,463
static info_cb get_callback(SSL *s) { if (s->info_callback != NULL) return s->info_callback; else if (s->ctx->info_callback != NULL) return s->ctx->info_callback; return NULL; }
DoS Exec Code
0
static info_cb get_callback(SSL *s) { if (s->info_callback != NULL) return s->info_callback; else if (s->ctx->info_callback != NULL) return s->ctx->info_callback; return NULL; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,464
static void init_read_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; st->read_state = READ_STATE_HEADER; }
DoS Exec Code
0
static void init_read_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; st->read_state = READ_STATE_HEADER; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,465
int ossl_statem_accept(SSL *s) { return state_machine(s, 1); }
DoS Exec Code
0
int ossl_statem_accept(SSL *s) { return state_machine(s, 1); }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,466
void ossl_statem_clear(SSL *s) { s->statem.state = MSG_FLOW_UNINITED; s->statem.hand_state = TLS_ST_BEFORE; s->statem.in_init = 1; s->statem.no_cert_verify = 0; }
DoS Exec Code
0
void ossl_statem_clear(SSL *s) { s->statem.state = MSG_FLOW_UNINITED; s->statem.hand_state = TLS_ST_BEFORE; s->statem.in_init = 1; s->statem.no_cert_verify = 0; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,467
int ossl_statem_get_in_handshake(SSL *s) { return s->statem.in_handshake; }
DoS Exec Code
0
int ossl_statem_get_in_handshake(SSL *s) { return s->statem.in_handshake; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,468
int ossl_statem_in_error(const SSL *s) { if (s->statem.state == MSG_FLOW_ERROR) return 1; return 0; }
DoS Exec Code
0
int ossl_statem_in_error(const SSL *s) { if (s->statem.state == MSG_FLOW_ERROR) return 1; return 0; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,469
int ossl_statem_in_sctp_read_sock(SSL *s) { return s->statem.in_sctp_read_sock; }
DoS Exec Code
0
int ossl_statem_in_sctp_read_sock(SSL *s) { return s->statem.in_sctp_read_sock; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,470
void ossl_statem_set_hello_verify_done(SSL *s) { s->statem.state = MSG_FLOW_UNINITED; s->statem.in_init = 1; /* * This will get reset (briefly) back to TLS_ST_BEFORE when we enter * state_machine() because |state| is MSG_FLOW_UNINITED, but until then any * calls to SSL_in_before() will return...
DoS Exec Code
0
void ossl_statem_set_hello_verify_done(SSL *s) { s->statem.state = MSG_FLOW_UNINITED; s->statem.in_init = 1; /* * This will get reset (briefly) back to TLS_ST_BEFORE when we enter * state_machine() because |state| is MSG_FLOW_UNINITED, but until then any * calls to SSL_in_before() will return...
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,471
void ossl_statem_set_in_handshake(SSL *s, int inhand) { if (inhand) s->statem.in_handshake++; else s->statem.in_handshake--; }
DoS Exec Code
0
void ossl_statem_set_in_handshake(SSL *s, int inhand) { if (inhand) s->statem.in_handshake++; else s->statem.in_handshake--; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,472
void ossl_statem_set_in_init(SSL *s, int init) { s->statem.in_init = init; }
DoS Exec Code
0
void ossl_statem_set_in_init(SSL *s, int init) { s->statem.in_init = init; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,473
void ossl_statem_set_renegotiate(SSL *s) { s->statem.state = MSG_FLOW_RENEGOTIATE; s->statem.in_init = 1; }
DoS Exec Code
0
void ossl_statem_set_renegotiate(SSL *s) { s->statem.state = MSG_FLOW_RENEGOTIATE; s->statem.in_init = 1; }
@@ -445,6 +445,21 @@ static void init_read_state_machine(SSL *s) st->read_state = READ_STATE_HEADER; } +static int grow_init_buf(SSL *s, size_t size) { + + size_t msg_offset = (char *)s->init_msg - s->init_buf->data; + + if (!BUF_MEM_grow_clean(s->init_buf, (int)size)) + return 0; + + if (size <...
CWE-416
null
null
7,474
int dtls1_buffer_message(SSL *s, int is_ccs) { pitem *item; hm_fragment *frag; unsigned char seq64be[8]; /* * this function is called immediately after a message has been * serialized */ OPENSSL_assert(s->init_off == 0); frag = dtls1_hm_fragment_new(s->init_num, 0); if (frag...
DoS
0
int dtls1_buffer_message(SSL *s, int is_ccs) { pitem *item; hm_fragment *frag; unsigned char seq64be[8]; /* * this function is called immediately after a message has been * serialized */ OPENSSL_assert(s->init_off == 0); frag = dtls1_hm_fragment_new(s->init_num, 0); if (frag...
@@ -388,6 +388,20 @@ int dtls_get_message(SSL *s, int *mt, unsigned long *len) return 1; } +/* + * dtls1_max_handshake_message_len returns the maximum number of bytes + * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but + * may be greater if the maximum certificate list size requires it. ...
CWE-399
null
null
7,475
int dtls1_do_write(SSL *s, int type) { int ret; unsigned int curr_mtu; int retry = 1; unsigned int len, frag_off, mac_size, blocksize, used_len; if (!dtls1_query_mtu(s)) return -1; if (s->d1->mtu < dtls1_min_mtu(s)) /* should have something reasonable now */ return -1; ...
DoS
0
int dtls1_do_write(SSL *s, int type) { int ret; unsigned int curr_mtu; int retry = 1; unsigned int len, frag_off, mac_size, blocksize, used_len; if (!dtls1_query_mtu(s)) return -1; if (s->d1->mtu < dtls1_min_mtu(s)) /* should have something reasonable now */ return -1; ...
@@ -388,6 +388,20 @@ int dtls_get_message(SSL *s, int *mt, unsigned long *len) return 1; } +/* + * dtls1_max_handshake_message_len returns the maximum number of bytes + * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but + * may be greater if the maximum certificate list size requires it. ...
CWE-399
null
null
7,476
dtls1_fix_message_header(SSL *s, unsigned long frag_off, unsigned long frag_len) { struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr; msg_hdr->frag_off = frag_off; msg_hdr->frag_len = frag_len; }
DoS
0
dtls1_fix_message_header(SSL *s, unsigned long frag_off, unsigned long frag_len) { struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr; msg_hdr->frag_off = frag_off; msg_hdr->frag_len = frag_len; }
@@ -388,6 +388,20 @@ int dtls_get_message(SSL *s, int *mt, unsigned long *len) return 1; } +/* + * dtls1_max_handshake_message_len returns the maximum number of bytes + * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but + * may be greater if the maximum certificate list size requires it. ...
CWE-399
null
null
7,477
void dtls1_get_message_header(unsigned char *data, struct hm_header_st *msg_hdr) { memset(msg_hdr, 0, sizeof(*msg_hdr)); msg_hdr->type = *(data++); n2l3(data, msg_hdr->msg_len); n2s(data, msg_hdr->seq); n2l3(data, msg_hdr->frag_off); n2l3(data, msg_hdr->frag_len); }
DoS
0
void dtls1_get_message_header(unsigned char *data, struct hm_header_st *msg_hdr) { memset(msg_hdr, 0, sizeof(*msg_hdr)); msg_hdr->type = *(data++); n2l3(data, msg_hdr->msg_len); n2s(data, msg_hdr->seq); n2l3(data, msg_hdr->frag_off); n2l3(data, msg_hdr->frag_len); }
@@ -388,6 +388,20 @@ int dtls_get_message(SSL *s, int *mt, unsigned long *len) return 1; } +/* + * dtls1_max_handshake_message_len returns the maximum number of bytes + * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but + * may be greater if the maximum certificate list size requires it. ...
CWE-399
null
null
7,478
void dtls1_hm_fragment_free(hm_fragment *frag) { if (!frag) return; if (frag->msg_header.is_ccs) { EVP_CIPHER_CTX_free(frag->msg_header. saved_retransmit_state.enc_write_ctx); EVP_MD_CTX_free(frag->msg_header.saved_retransmit_state.write_hash); } OPENS...
DoS
0
void dtls1_hm_fragment_free(hm_fragment *frag) { if (!frag) return; if (frag->msg_header.is_ccs) { EVP_CIPHER_CTX_free(frag->msg_header. saved_retransmit_state.enc_write_ctx); EVP_MD_CTX_free(frag->msg_header.saved_retransmit_state.write_hash); } OPENS...
@@ -388,6 +388,20 @@ int dtls_get_message(SSL *s, int *mt, unsigned long *len) return 1; } +/* + * dtls1_max_handshake_message_len returns the maximum number of bytes + * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but + * may be greater if the maximum certificate list size requires it. ...
CWE-399
null
null
7,479
static hm_fragment *dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) { hm_fragment *frag = NULL; unsigned char *buf = NULL; unsigned char *bitmask = NULL; frag = OPENSSL_malloc(sizeof(*frag)); if (frag == NULL) return NULL; if (fra...
DoS
0
static hm_fragment *dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) { hm_fragment *frag = NULL; unsigned char *buf = NULL; unsigned char *bitmask = NULL; frag = OPENSSL_malloc(sizeof(*frag)); if (frag == NULL) return NULL; if (fra...
@@ -388,6 +388,20 @@ int dtls_get_message(SSL *s, int *mt, unsigned long *len) return 1; } +/* + * dtls1_max_handshake_message_len returns the maximum number of bytes + * permitted in a DTLS handshake message for |s|. The minimum is 16KB, but + * may be greater if the maximum certificate list size requires it. ...
CWE-399
null
null
7,480
static void init_read_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; st->read_state = READ_STATE_HEADER; }
DoS
0
static void init_read_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; st->read_state = READ_STATE_HEADER; }
@@ -542,6 +542,17 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) return SUB_STATE_ERROR; } + /* dtls_get_message already did this */ + if (!SSL_IS_DTLS(s) + && s->s3->tmp.message_size > 0 + && !BUF_MEM_grow_clean(s->init_...
CWE-400
null
null
7,481
static void init_write_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; st->write_state = WRITE_STATE_TRANSITION; }
DoS
0
static void init_write_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; st->write_state = WRITE_STATE_TRANSITION; }
@@ -542,6 +542,17 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) return SUB_STATE_ERROR; } + /* dtls_get_message already did this */ + if (!SSL_IS_DTLS(s) + && s->s3->tmp.message_size > 0 + && !BUF_MEM_grow_clean(s->init_...
CWE-400
null
null
7,482
void ossl_statem_set_sctp_read_sock(SSL *s, int read_sock) { s->statem.in_sctp_read_sock = read_sock; }
DoS
0
void ossl_statem_set_sctp_read_sock(SSL *s, int read_sock) { s->statem.in_sctp_read_sock = read_sock; }
@@ -542,6 +542,17 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) return SUB_STATE_ERROR; } + /* dtls_get_message already did this */ + if (!SSL_IS_DTLS(s) + && s->s3->tmp.message_size > 0 + && !BUF_MEM_grow_clean(s->init_...
CWE-400
null
null
7,483
static int state_machine(SSL *s, int server) { BUF_MEM *buf = NULL; unsigned long Time = (unsigned long)time(NULL); void (*cb) (const SSL *ssl, int type, int val) = NULL; OSSL_STATEM *st = &s->statem; int ret = -1; int ssret; if (st->state == MSG_FLOW_ERROR) { /* Shouldn't have been...
DoS
0
static int state_machine(SSL *s, int server) { BUF_MEM *buf = NULL; unsigned long Time = (unsigned long)time(NULL); void (*cb) (const SSL *ssl, int type, int val) = NULL; OSSL_STATEM *st = &s->statem; int ret = -1; int ssret; if (st->state == MSG_FLOW_ERROR) { /* Shouldn't have been...
@@ -542,6 +542,17 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) return SUB_STATE_ERROR; } + /* dtls_get_message already did this */ + if (!SSL_IS_DTLS(s) + && s->s3->tmp.message_size > 0 + && !BUF_MEM_grow_clean(s->init_...
CWE-400
null
null
7,484
static int statem_do_write(SSL *s) { OSSL_STATEM *st = &s->statem; if (st->hand_state == TLS_ST_CW_CHANGE || st->hand_state == TLS_ST_SW_CHANGE) { if (SSL_IS_DTLS(s)) return dtls1_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC); else return ssl3_do_write(s, SSL3_RT_CHANG...
DoS
0
static int statem_do_write(SSL *s) { OSSL_STATEM *st = &s->statem; if (st->hand_state == TLS_ST_CW_CHANGE || st->hand_state == TLS_ST_SW_CHANGE) { if (SSL_IS_DTLS(s)) return dtls1_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC); else return ssl3_do_write(s, SSL3_RT_CHANG...
@@ -542,6 +542,17 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) return SUB_STATE_ERROR; } + /* dtls_get_message already did this */ + if (!SSL_IS_DTLS(s) + && s->s3->tmp.message_size > 0 + && !BUF_MEM_grow_clean(s->init_...
CWE-400
null
null
7,485
static SUB_STATE_RETURN write_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; int ret; WRITE_TRAN(*transition) (SSL *s); WORK_STATE(*pre_work) (SSL *s, WORK_STATE wst); WORK_STATE(*post_work) (SSL *s, WORK_STATE wst); int (*construct_message) (SSL *s); void (*cb) (const SSL *ssl, int t...
DoS
0
static SUB_STATE_RETURN write_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; int ret; WRITE_TRAN(*transition) (SSL *s); WORK_STATE(*pre_work) (SSL *s, WORK_STATE wst); WORK_STATE(*post_work) (SSL *s, WORK_STATE wst); int (*construct_message) (SSL *s); void (*cb) (const SSL *ssl, int t...
@@ -542,6 +542,17 @@ static SUB_STATE_RETURN read_state_machine(SSL *s) return SUB_STATE_ERROR; } + /* dtls_get_message already did this */ + if (!SSL_IS_DTLS(s) + && s->s3->tmp.message_size > 0 + && !BUF_MEM_grow_clean(s->init_...
CWE-400
null
null
7,486
int ssl3_do_write(SSL *s, int type) { int ret; ret = ssl3_write_bytes(s, type, &s->init_buf->data[s->init_off], s->init_num); if (ret < 0) return (-1); if (type == SSL3_RT_HANDSHAKE) /* * should not be done for 'Hello Request's, but in that case we'll...
DoS
0
int ssl3_do_write(SSL *s, int type) { int ret; ret = ssl3_write_bytes(s, type, &s->init_buf->data[s->init_off], s->init_num); if (ret < 0) return (-1); if (type == SSL3_RT_HANDSHAKE) /* * should not be done for 'Hello Request's, but in that case we'll...
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,487
unsigned long ssl3_output_cert_chain(SSL *s, CERT_PKEY *cpk) { unsigned char *p; unsigned long l = 3 + SSL_HM_HEADER_LENGTH(s); if (!ssl_add_cert_chain(s, cpk, &l)) return 0; l -= 3 + SSL_HM_HEADER_LENGTH(s); p = ssl_handshake_start(s); l2n3(l, p); l += 3; if (!ssl_set_handsha...
DoS
0
unsigned long ssl3_output_cert_chain(SSL *s, CERT_PKEY *cpk) { unsigned char *p; unsigned long l = 3 + SSL_HM_HEADER_LENGTH(s); if (!ssl_add_cert_chain(s, cpk, &l)) return 0; l -= 3 + SSL_HM_HEADER_LENGTH(s); p = ssl_handshake_start(s); l2n3(l, p); l += 3; if (!ssl_set_handsha...
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,488
static void ssl3_take_mac(SSL *s) { const char *sender; int slen; /* * If no new cipher setup return immediately: other functions will set * the appropriate error. */ if (s->s3->tmp.new_cipher == NULL) return; if (!s->server) { sender = s->method->ssl3_enc->server_fini...
DoS
0
static void ssl3_take_mac(SSL *s) { const char *sender; int slen; /* * If no new cipher setup return immediately: other functions will set * the appropriate error. */ if (s->s3->tmp.new_cipher == NULL) return; if (!s->server) { sender = s->method->ssl3_enc->server_fini...
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,489
int tls_construct_change_cipher_spec(SSL *s) { unsigned char *p; p = (unsigned char *)s->init_buf->data; *p = SSL3_MT_CCS; s->init_num = 1; s->init_off = 0; return 1; }
DoS
0
int tls_construct_change_cipher_spec(SSL *s) { unsigned char *p; p = (unsigned char *)s->init_buf->data; *p = SSL3_MT_CCS; s->init_num = 1; s->init_off = 0; return 1; }
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,490
int tls_construct_finished(SSL *s, const char *sender, int slen) { unsigned char *p; int i; unsigned long l; p = ssl_handshake_start(s); i = s->method->ssl3_enc->final_finish_mac(s, sender, slen, s->s3->tmp...
DoS
0
int tls_construct_finished(SSL *s, const char *sender, int slen) { unsigned char *p; int i; unsigned long l; p = ssl_handshake_start(s); i = s->method->ssl3_enc->final_finish_mac(s, sender, slen, s->s3->tmp...
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,491
WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst) { void (*cb) (const SSL *ssl, int type, int val) = NULL; #ifndef OPENSSL_NO_SCTP if (SSL_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(s))) { WORK_STATE ret; ret = dtls_wait_for_dry(s); if (ret != WORK_FINISHED_CONTINUE) ...
DoS
0
WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst) { void (*cb) (const SSL *ssl, int type, int val) = NULL; #ifndef OPENSSL_NO_SCTP if (SSL_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(s))) { WORK_STATE ret; ret = dtls_wait_for_dry(s); if (ret != WORK_FINISHED_CONTINUE) ...
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,492
MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt) { int al; long remain; remain = PACKET_remaining(pkt); /* * 'Change Cipher Spec' is just a single byte, which should already have * been consumed by ssl_get_message() so there should be no bytes left, * unless we're u...
DoS
0
MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt) { int al; long remain; remain = PACKET_remaining(pkt); /* * 'Change Cipher Spec' is just a single byte, which should already have * been consumed by ssl_get_message() so there should be no bytes left, * unless we're u...
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,493
MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt) { int al, i; /* If this occurs, we have missed a message */ if (!s->s3->change_cipher_spec) { al = SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_TLS_PROCESS_FINISHED, SSL_R_GOT_A_FIN_BEFORE_A_CCS); goto f_err; } s->s3->c...
DoS
0
MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt) { int al, i; /* If this occurs, we have missed a message */ if (!s->s3->change_cipher_spec) { al = SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_TLS_PROCESS_FINISHED, SSL_R_GOT_A_FIN_BEFORE_A_CCS); goto f_err; } s->s3->c...
@@ -414,10 +414,6 @@ int tls_get_message_header(SSL *s, int *mt) */ l = RECORD_LAYER_get_rrec_length(&s->rlayer) + SSL3_HM_HEADER_LENGTH; - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l)) { - SSLerr(SSL_F_TLS_GET_MESSAGE_HEADER, ERR_R_BUF_LIB); - goto err;...
CWE-400
null
null
7,494
int ssl3_get_cert_status(SSL *s) { int ok, al; unsigned long resplen, n; const unsigned char *p; n = s->method->ssl_get_message(s, SSL3_ST_CR_CERT_STATUS_A, SSL3_ST_CR_CERT_STATUS_B, -1, 16384, &ok)...
DoS
0
int ssl3_get_cert_status(SSL *s) { int ok, al; unsigned long resplen, n; const unsigned char *p; n = s->method->ssl_get_message(s, SSL3_ST_CR_CERT_STATUS_A, SSL3_ST_CR_CERT_STATUS_B, -1, 16384, &ok)...
@@ -1143,6 +1143,12 @@ int ssl3_get_server_certificate(SSL *s) goto f_err; } for (nc = 0; nc < llen;) { + if (nc + 3 > llen) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, + SSL_R_CERT_LENGTH_MISMATCH); + goto f_err;...
CWE-125
null
null
7,495
int ssl3_check_client_hello(SSL *s) { int ok; long n; /* * this function is called when we really expect a Certificate message, * so permit appropriate message length */ n = s->method->ssl_get_message(s, SSL3_ST_SR_CERT_A, ...
DoS
0
int ssl3_check_client_hello(SSL *s) { int ok; long n; /* * this function is called when we really expect a Certificate message, * so permit appropriate message length */ n = s->method->ssl_get_message(s, SSL3_ST_SR_CERT_A, ...
@@ -3234,6 +3234,12 @@ int ssl3_get_client_certificate(SSL *s) goto f_err; } for (nc = 0; nc < llen;) { + if (nc + 3 > llen) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, + SSL_R_CERT_LENGTH_MISMATCH); + goto f_err;...
CWE-125
null
null
7,496
int ssl3_get_cert_verify(SSL *s) { EVP_PKEY *pkey = NULL; unsigned char *p; int al, ok, ret = 0; long n; int type = 0, i, j; X509 *peer; const EVP_MD *md = NULL; EVP_MD_CTX mctx; EVP_MD_CTX_init(&mctx); /* * We should only process a CertificateVerify message if we have rece...
DoS
0
int ssl3_get_cert_verify(SSL *s) { EVP_PKEY *pkey = NULL; unsigned char *p; int al, ok, ret = 0; long n; int type = 0, i, j; X509 *peer; const EVP_MD *md = NULL; EVP_MD_CTX mctx; EVP_MD_CTX_init(&mctx); /* * We should only process a CertificateVerify message if we have rece...
@@ -3234,6 +3234,12 @@ int ssl3_get_client_certificate(SSL *s) goto f_err; } for (nc = 0; nc < llen;) { + if (nc + 3 > llen) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, + SSL_R_CERT_LENGTH_MISMATCH); + goto f_err;...
CWE-125
null
null
7,497
unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit) { int extdatalen = 0; unsigned char *orig = buf; unsigned char *ret = buf; /* don't add extensions for SSLv3 unless doing secure renegotiation */ if (s->client_versi...
DoS
0
unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit) { int extdatalen = 0; unsigned char *orig = buf; unsigned char *ret = buf; /* don't add extensions for SSLv3 unless doing secure renegotiation */ if (s->client_versi...
@@ -1284,6 +1284,23 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, size -= 2; if (dsize > size) goto err; + + /* + * We remove any OCSP_RESPIDs from a previous handshake + * to prevent unbounded memory ...
CWE-399
null
null
7,498
int ssl_check_clienthello_tlsext_late(SSL *s) { int ret = SSL_TLSEXT_ERR_OK; int al; /* * If status request then ask callback what to do. Note: this must be * called after servername callbacks in case the certificate has * changed, and must be called after the cipher has been chosen because ...
DoS
0
int ssl_check_clienthello_tlsext_late(SSL *s) { int ret = SSL_TLSEXT_ERR_OK; int al; /* * If status request then ask callback what to do. Note: this must be * called after servername callbacks in case the certificate has * changed, and must be called after the cipher has been chosen because ...
@@ -1284,6 +1284,23 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, size -= 2; if (dsize > size) goto err; + + /* + * We remove any OCSP_RESPIDs from a previous handshake + * to prevent unbounded memory ...
CWE-399
null
null
7,499
static void ssl_check_for_safari(SSL *s, const unsigned char *data, const unsigned char *limit) { unsigned short type, size; static const unsigned char kSafariExtensionsBlock[] = { 0x00, 0x0a, /* elliptic_curves extension */ 0x00, 0x08, /*...
DoS
0
static void ssl_check_for_safari(SSL *s, const unsigned char *data, const unsigned char *limit) { unsigned short type, size; static const unsigned char kSafariExtensionsBlock[] = { 0x00, 0x0a, /* elliptic_curves extension */ 0x00, 0x08, /*...
@@ -1284,6 +1284,23 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, size -= 2; if (dsize > size) goto err; + + /* + * We remove any OCSP_RESPIDs from a previous handshake + * to prevent unbounded memory ...
CWE-399
null
null