project
stringclasses
765 values
commit_id
stringlengths
6
81
func
stringlengths
19
482k
vul
int64
0
1
CVE ID
stringlengths
13
16
CWE ID
stringclasses
13 values
CWE Name
stringclasses
13 values
CWE Description
stringclasses
13 values
Potential Mitigation
stringclasses
11 values
__index_level_0__
int64
0
23.9k
Android
04839626ed859623901ebd3a5fd483982186b59d
SeekHead::SeekHead( Segment* pSegment, long long start, long long size_, long long element_start, long long element_size) : m_pSegment(pSegment), m_start(start), m_size(size_), m_element_start(element_start), m_element_size(element_size), m_entries(0), m_entry_count(0), ...
1
CVE-2016-1621
CWE-119
Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages,...
478
openssl
259b664f950c2ba66fbf4b0fe5281327904ead21
static int init_ssl_connection(SSL *con) { int i; const char *str; X509 *peer; long verify_error; MS_STATIC char buf[BUFSIZ]; #ifndef OPENSSL_NO_KRB5 char *client_princ; #endif #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) const unsigned char *next_proto_neg; unsig...
1
CVE-2016-0798
CWE-399
Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
Not Found in CWE Page
4,367
Chrome
d0947db40187f4708c58e64cbd6013faf9eddeed
xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { xmlChar *name; const xmlChar *ptr; xmlChar cur; xmlEntityPtr ent = NULL; if ((str == NULL) || (*str == NULL)) return(NULL); ptr = *str; cur = *ptr; if (cur != '&') return(NULL); ptr++; name = xmlPar...
1
CVE-2013-2877
CWE-119
Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages,...
6,985
openjpeg
d27ccf01c68a31ad62b33d2dc1ba2bb1eeaafe7b
static OPJ_BOOL opj_pi_check_next_level(OPJ_INT32 pos, opj_cp_t *cp, OPJ_UINT32 tileno, OPJ_UINT32 pino, const OPJ_CHAR *prog) { OPJ_INT32 i; opj_tcp_t ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
17,815
linux
3ce424e45411cf5a13105e0386b6ecf6eeb4f66f
static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) { struct vcpu_vmx *vmx = to_vmx(vcpu); struct shared_msr_entry *msr; int ret = 0; u32 msr_index = msr_info->index; u64 data = msr_info->data; switch (msr_index) { case MSR_EFER: ret = kvm_set_msr_common(vcpu, msr_info); break; #ifdef C...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,163
jdk11u-dev
9a62b8af48af6c506d2fc4a3482116de26357f16
LIR_Opr LIRGenerator::syncLockOpr() { return new_register(T_INT); }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
19,001
quagga
cfb1fae25f8c092e0d17073eaf7bd428ce1cd546
rtadv_recv_packet (int sock, u_char *buf, int buflen, struct sockaddr_in6 *from, ifindex_t *ifindex, int *hoplimit) { int ret; struct msghdr msg; struct iovec iov; struct cmsghdr *cmsgptr; struct in6_addr dst; char adata[1024]; /* Fill in message and iovec. */ msg.msg_name = (void *) from; ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
12,858
vim
d88934406c5375d88f8f1b65331c9f0cab68cc6c
append_command(char_u *cmd) { char_u *s = cmd; char_u *d; STRCAT(IObuff, ": "); d = IObuff + STRLEN(IObuff); while (*s != NUL && d - IObuff < IOSIZE - 7) { if (enc_utf8 ? (s[0] == 0xc2 && s[1] == 0xa0) : *s == 0xa0) { s += enc_utf8 ? 2 : 1; STRCPY(d, "<a0>"); d += 4; } else ...
1
CVE-2022-1616
CWE-416
Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory...
Phase: Architecture and Design Strategy: Language Selection Choose a language that provides automatic memory management. Phase: Implementation Strategy: Attack Surface Reduction When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures m...
9,391
ImageMagick6
a78d92dc0f468e79c3d761aae9707042952cdaca
static void FreePictureMemoryList (PictureMemory* head) { PictureMemory* next; while(head != NULL) { next = head->next; if(head->pixel_info != NULL) RelinquishVirtualMemory(head->pixel_info); free(head); head = next; } }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
18,765
Chrome
3b0d77670a0613f409110817455d2137576b485a
void NaClProcessHost::EarlyStartup() { #if defined(OS_LINUX) && !defined(OS_CHROMEOS) NaClBrowser::GetInstance()->EnsureIrtAvailable(); #endif }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
12,475
Chrome
648cbc15a6830523b3a4eb78d674f059bd2a7ce9
NetworkSelectionView* NetworkScreen::AllocateView() { return new NetworkSelectionView(this); }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
17,034
edk2
0a0d5296e448fc350de1594c49b9c0deff7fad60
InitializeExceptionStackSwitchHandlers ( IN OUT VOID *Buffer ) { CPU_EXCEPTION_INIT_DATA *EssData; IA32_DESCRIPTOR Idtr; EFI_STATUS Status; EssData = Buffer; // // We don't plan to replace IDT table with a new one, but we should not assume ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
12,964
savannah
7f2e4f4f553f6836be7683f66226afac3fa979b8
bdf_get_font_property( bdf_font_t* font, const char* name ) { hashnode hn; if ( font == 0 || font->props_size == 0 || name == 0 || *name == 0 ) return 0; hn = hash_lookup( name, (hashtable *)font->internal ); return hn ? ( font->props + hn->data ) : 0; }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
16,950
savannah
94e01571507835ff59dd8ce2a0b56a4b566965a4
main (int argc _GL_UNUSED, char **argv) { struct timespec result; struct timespec result2; struct timespec expected; struct timespec now; const char *p; int i; long gmtoff; time_t ref_time = 1304250918; /* Set the time zone to US Eastern time with the 2012 rules. This should disable any leap se...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
16,946
php-src
7245bff300d3fa8bacbef7897ff080a6f1c23eba?w=1
SPL_METHOD(DirectoryIterator, rewind) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } intern->u.dir.index = 0; if (intern->u.dir.dirp) { php_stream_rewinddir(intern->u.dir.dirp); } spl...
1
CVE-2016-5770
CWE-190
Integer Overflow or Wraparound
The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, ...
Phase: Requirements Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol. Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that mak...
7,920
linux
51aa68e7d57e3217192d88ce90fd5b8ef29ec94f
static int handle_exception(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); struct kvm_run *kvm_run = vcpu->run; u32 intr_info, ex_no, error_code; unsigned long cr2, rip, dr6; u32 vect_info; enum emulation_result er; vect_info = vmx->idt_vectoring_info; intr_info = vmx->exit_intr_info; if (is_m...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,754
exiv2
bd0afe0390439b2c424d881c8c6eb0c5624e31d9
int MemIo::seek(int64 offset, Position pos ) { int64 newIdx = 0; switch (pos) { case BasicIo::cur: newIdx = p_->idx_ + offset; break; case BasicIo::beg: newIdx = offset; break; case BasicIo::end:...
1
CVE-2019-13504
CWE-125
Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.
Phase: Implementation Strategy: Input Validation Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that do...
6,842
php-src
2871c70efaaaa0f102557a17c727fd4d5204dd4b
PHP_FUNCTION(escapeshellarg) { char *argument; size_t argument_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &argument, &argument_len) == FAILURE) { return; } if (argument) { RETVAL_STR(php_escape_shell_arg(argument)); } }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
21,807
Chrome
c391f54a210dd792f140650b886e92480d8eaf9e
float AudioParam::smoothedValue() { return narrowPrecisionToFloat(m_smoothedValue); }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
19,477
tcpdump
86326e880d31b328a151d45348c35220baa9a1ff
bgp_notification_print(netdissect_options *ndo, const u_char *dat, int length) { struct bgp_notification bgpn; const u_char *tptr; ND_TCHECK2(dat[0], BGP_NOTIFICATION_SIZE); memcpy(&bgpn, dat, BGP_NOTIFICATION_SIZE); /* some little sanity checking */ if (length<BGP_NOTIFICAT...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
23,341
php-src
9c673083cd46ee2a954a62156acbe4b6e657c048
static int is_userinfo_valid(const char *str, size_t len) { char *valid = "-._~!$&'()*+,;=:"; char *p = str; while (p - str < len) { if (isalpha(*p) || isdigit(*p) || strchr(valid, *p)) { p++; } else if (*p == '%' && p - str <= len - 3 && isdigit(*(p+1)) && isxdigit(*(p+2))) { p += 3; } else { return ...
1
CVE-2020-7071
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Phase: Architecture and Design Strategy: Attack Surface Reduction Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary b...
7,972
Chrome
d0947db40187f4708c58e64cbd6013faf9eddeed
xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) { xmlParserInputPtr input; xmlBufferPtr buf; int l, c; int count = 0; if ((ctxt == NULL) || (entity == NULL) || ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) && (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) || ...
1
CVE-2013-2877
CWE-119
Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages,...
6,925
vim
143367256836b0f69881dc0c65ff165ae091dbc5
exec_instructions(ectx_T *ectx) { int ret = FAIL; int save_trylevel_at_start = ectx->ec_trylevel_at_start; int dict_stack_len_at_start = dict_stack.ga_len; // Start execution at the first instruction. ectx->ec_iidx = 0; // Only catch exceptions in this instruction list. ectx->ec_tryleve...
1
CVE-2022-0156
CWE-416
Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory...
Phase: Architecture and Design Strategy: Language Selection Choose a language that provides automatic memory management. Phase: Implementation Strategy: Attack Surface Reduction When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures m...
7,265
php-src
ecb7f58a069be0dec4a6131b6351a761f808f22e?w=1
static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); long index; zval *rv, *value = NULL, **tmp; if (check_inherited && intern->fptr_offset_has) { ...
1
CVE-2016-7417
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Phase: Architecture and Design Strategy: Attack Surface Reduction Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary b...
6,522
linux
09ca8e1173bcb12e2a449698c9ae3b86a8a10195
void kvm_vcpu_uninit(struct kvm_vcpu *vcpu) { put_pid(vcpu->pid); kvm_arch_vcpu_uninit(vcpu); free_page((unsigned long)vcpu->run); }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
10,647
nginx
c1be55f97211d38b69ac0c2027e6812ab8b1b94e
ngx_http_send_special_response(ngx_http_request_t *r, ngx_http_core_loc_conf_t *clcf, ngx_uint_t err) { u_char *tail; size_t len; ngx_int_t rc; ngx_buf_t *b; ngx_uint_t msie_padding; ngx_chain_t out[3]; if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
14,852
ImageMagick6
4a8a6274f5e690f9106a998de9b8a8f3929402bc
static int formatIPTCfromBuffer(Image *ofile, char *s, ssize_t len) { char temp[MaxTextExtent]; unsigned int foundiptc, tagsfound; unsigned char recnum, dataset; unsigned char *readable, *str; ssize_t tagindx, taglen; int i, tagcount = (int) (sizeof(tags) / s...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
22,773
linux
6aeb75e6adfaed16e58780309613a578fe1ee90b
static void change_port_settings(struct tty_struct *tty, struct edgeport_port *edge_port, struct ktermios *old_termios) { struct device *dev = &edge_port->port->dev; struct ump_uart_config *config; int baud; unsigned cflag; int status; int port_number = edge_port->port->port_number; config = kmalloc (sizeof (...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
17,292
linux
95389b08d93d5c06ec63ab49bd732b0069b7c35e
int assoc_array_gc(struct assoc_array *array, const struct assoc_array_ops *ops, bool (*iterator)(void *object, void *iterator_data), void *iterator_data) { struct assoc_array_shortcut *shortcut, *new_s; struct assoc_array_node *node, *new_n; struct assoc_array_edit *edit; struct assoc_array_ptr *cur...
1
CVE-2014-3631
CWE-399
Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
Not Found in CWE Page
8,831
ImageMagick
a7bb158b7bedd1449a34432feb3a67c8f1873bfa
MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile) { #define MaxDirectoryStack 16 #define EXIF_DELIMITER "\n" #define EXIF_NUM_FORMATS 12 #define TAG_EXIF_OFFSET 0x8769 #define TAG_INTEROP_OFFSET 0xa005 typedef struct _DirectoryInfo { unsigned char *directory; size_t entr...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,680
poppler
0868c499a9f5f37f8df5c9fef03c37496b40fc8a
Stream *Parser::makeStream(Object &&dict, Guchar *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, int recursion, GBool strict) { BaseStream *baseStr; Stream *str; Goffset length; Goffset pos, endPos; // get stream start position lexer->ski...
1
CVE-2018-21009
CWE-190
Integer Overflow or Wraparound
The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, ...
Phase: Requirements Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol. Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that mak...
4,119
gst-plugins-good
02174790726dd20a5c73ce2002189bf240ad4fe0
gst_matroska_cluster_compare (gint64 * i1, gint64 * i2) { if (*i1 < *i2) return -1; else if (*i1 > *i2) return 1; else return 0; }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,458
systemd
a924f43f30f9c4acaf70618dd2a055f8b0f166be
int dns_packet_append_name( DnsPacket *p, const char *name, bool allow_compression, bool canonical_candidate, size_t *start) { size_t saved_size; int r; assert(p); assert(name); if (p->refuse_compr...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
11,772
Android
04839626ed859623901ebd3a5fd483982186b59d
long Chapters::Atom::ParseDisplay( IMkvReader* pReader, long long pos, long long size) { if (!ExpandDisplaysArray()) return -1; Display& d = m_displays[m_displays_count++]; d.Init(); return d.Parse(pReader, pos, size); }
1
CVE-2016-1621
CWE-119
Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages,...
352
Chrome
6a7063ae61cf031630b48bdcdb09863ffc199962
void OffscreenCanvas::Commit(scoped_refptr<CanvasResource> canvas_resource, const SkIRect& damage_rect) { if (!HasPlaceholderCanvas() || !canvas_resource) return; RecordCanvasSizeToUMA( Size(), CanvasRenderingContextHost::HostType::kOffscreenCanvasHost); base::TimeTicks com...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
17,293
keepalived
17f944144b3d9c5131569b1cc988cc90fd676671
FILE *fopen_safe(const char *path, const char *mode) { int fd; FILE *file; int flags = O_NOFOLLOW | O_CREAT; int sav_errno; if (mode[0] == 'r') return fopen(path, mode); if ((mode[0] != 'a' && mode[0] != 'w') || (mode[1] && (mode[1] != '+' || mode[2]))) { errno = EINVAL; return NULL; } if (m...
1
CVE-2018-19046
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
Phase: Architecture and Design Strategy: Separation of Privilege Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ens...
6,168
linux
cc16eecae687912238ee6efbff71ad31e2bc414e
int jbd2_journal_start_reserved(handle_t *handle, unsigned int type, unsigned int line_no) { journal_t *journal = handle->h_journal; int ret = -EIO; if (WARN_ON(!handle->h_reserved)) { /* Someone passed in normal handle? Just stop it. */ jbd2_journal_stop(handle); return ret; } /* * Usefulness of mixi...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,942
rizin
aa6917772d2f32e5a7daab25a46c72df0b5ea406
static const ut8 *parse_die(const ut8 *buf, const ut8 *buf_end, RzBinDwarfDebugInfo *info, RzBinDwarfAbbrevDecl *abbrev, RzBinDwarfCompUnitHdr *hdr, RzBinDwarfDie *die, const ut8 *debug_str, size_t debug_str_len, bool big_endian) { size_t i; const char *comp_dir = NULL; ut64 line_info_offset = UT64_MAX; for (i = 0...
1
CVE-2021-43814
CWE-787
Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages,...
1,071
linux
e0bccd315db0c2f919e7fcf9cb60db21d9986f52
void rose_link_device_down(struct net_device *dev) { struct rose_neigh *rose_neigh; for (rose_neigh = rose_neigh_list; rose_neigh != NULL; rose_neigh = rose_neigh->next) { if (rose_neigh->dev == dev) { rose_del_route_by_neigh(rose_neigh); rose_kill_by_neigh(rose_neigh); } } }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
11,551
libtiff
9657bbe3cdce4aaa90e07d50c1c70ae52da0ba6a
static int readContigStripsIntoBuffer (TIFF* in, uint8* buf) { uint8* bufp = buf; int32 bytes_read = 0; uint32 strip, nstrips = TIFFNumberOfStrips(in); uint32 stripsize = TIFFStripSize(in); uint32 rows = 0; uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &...
1
CVE-2016-10092
CWE-119
Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages,...
1,096
curl
13c9a9ded3ae744a1e11cbc14e9146d9fa427040
static CURLcode imap_block_statemach(struct connectdata *conn) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; while(imapc->state != IMAP_STOP && !result) result = Curl_pp_statemach(&imapc->pp, TRUE); return result; }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
17,551
libgit2
b5c6a1b407b7f8b952bded2789593b68b1876211
static int gen_request( git_buf *buf, http_stream *s, size_t content_length) { http_subtransport *t = OWNING_SUBTRANSPORT(s); const char *path = t->connection_data.path ? t->connection_data.path : "/"; size_t i; git_buf_printf(buf, "%s %s%s HTTP/1.1\r\n", s->verb, path, s->service_url); git_buf_printf(buf, "U...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
22,909
FFmpeg
5aba5b89d0b1d73164d3b81764828bb8b20ff32a
static av_cold int init_studio_vlcs(Mpeg4DecContext *ctx) { int i, ret; for (i = 0; i < 12; i++) { ret = init_vlc(&ctx->studio_intra_tab[i], STUDIO_INTRA_BITS, 22, &ff_mpeg4_studio_intra[i][0][1], 4, 2, &ff_mpeg4_studio_intra[i][0][0], 4, 2, ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,329
sleuthkit
bc04aa017c0bd297de8a3b7fc40ffc6ddddbb95d
static int hfs_file_read_zlib_attr(TSK_FS_FILE* fs_file, char* buffer, uint32_t attributeLength, uint64_t uncSize) { return hfs_file_read_compressed_attr( fs_file, DECMPFS_TYPE_ZLIB_ATTR, buffer, attributeLength, unc...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
12,977
Android
5a9753fca56f0eeb9f61e342b2fccffc364f9426
int ReturnFrameBuffer(vpx_codec_frame_buffer_t *fb) { EXPECT_TRUE(fb != NULL); ExternalFrameBuffer *const ext_fb = reinterpret_cast<ExternalFrameBuffer*>(fb->priv); EXPECT_TRUE(ext_fb != NULL); EXPECT_EQ(1, ext_fb->in_use); ext_fb->in_use = 0; return 0; }
1
CVE-2016-1621
CWE-119
Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Phase: Requirements Strategy: Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages,...
1,230
Android
cc274e2abe8b2a6698a5c47d8aa4bb45f1f9538d
const Cluster* Segment::GetNext(const Cluster* pCurr) { assert(pCurr); assert(pCurr != &m_eos); assert(m_clusters); long idx = pCurr->m_index; if (idx >= 0) { assert(m_clusterCount > 0); assert(idx < m_clusterCount); assert(pCurr == m_clusters[idx]); ++idx; if (idx >= m_clusterCount) return &...
1
CVE-2016-2464
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Phase: Architecture and Design Strategy: Attack Surface Reduction Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary b...
6,046
systemd
06eeacb6fe029804f296b065b3ce91e796e1cd0e
int symlink_idempotent(const char *from, const char *to) { _cleanup_free_ char *p = NULL; int r; assert(from); assert(to); if (symlink(from, to) < 0) { if (errno != EEXIST) return -errno; r = readlink_malloc(to, &p); ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
18,276
krb5
a7886f0ed1277c69142b14a2c6629175a6331edc
acc_ctx_cont(OM_uint32 *minstat, gss_buffer_t buf, gss_ctx_id_t *ctx, gss_buffer_t *responseToken, gss_buffer_t *mechListMIC, OM_uint32 *negState, send_token_flag *return_token) { OM_uint32 ret, tmpmin; gss_OID supportedMech; spnego_gss_ctx_id_t sc; unsigned int len; unsigned ch...
1
CVE-2014-4344
CWE-476
NULL Pointer Dereference
The product dereferences a pointer that it expects to be valid but is NULL.
Phase: Implementation If all pointers that could have been modified are checked for NULL before use, nearly all NULL pointer dereferences can be prevented. Phase: Requirements Select a programming language that is not susceptible to these issues. Phase: Implementation Check the results of all functions that return a...
7,445
drogon
3c785326c63a34aa1799a639ae185bc9453cb447
DROGON_TEST(HttpFile) { SUBSECTION(Save) { HttpFileImpl file; file.setFileName("test_file_name"); file.setFile("test", 4); auto out = file.save("./test_uploads_dir"); CHECK(out == 0); CHECK(filesystem::exists("./test_uploads_dir/test_file_name")); filesy...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
11,619
curl
9b5e12a5491d2e6b68e0c88ca56f3a9ef9fba400
static CURLcode override_login(struct Curl_easy *data, struct connectdata *conn, char **userp, char **passwdp, char **optionsp) { if(data->set.str[STRING_USERNAME]) { free(*userp); *userp = strdup(data->set.str[STRING_USERNAME]); if(!*userp) ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
16,137
curl
9069838b30fb3b48af0123e39f664cea683254a5
static ssize_t sec_recv(struct connectdata *conn, int sockindex, char *buffer, size_t len, CURLcode *err) { size_t bytes_read; size_t total_read = 0; curl_socket_t fd = conn->sock[sockindex]; *err = CURLE_OK; /* Handle clear text response. */ if(conn->sec_complete == 0 || conn->dat...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
16,632
FFmpeg
6b67d7f05918f7a1ee8fc6ff21355d7e8736aa10
static void put_timestamp(AVIOContext *pb, int64_t ts) { avio_wb24(pb, ts & 0xFFFFFF); avio_w8(pb, (ts >> 24) & 0x7F); }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
19,950
libgsf
95a8351a75758cf10b3bf6abae0b6b461f90d9e5
tar_directory_for_file (GsfInfileTar *dir, const char *name, gboolean last) { const char *s = name; while (1) { const char *s0 = s; char *dirname; /* Find a directory component, if any. */ while (1) { if (*s == 0) { if (last && s != s0) break; else return dir; } /* This is delibe...
1
CVE-2016-9888
CWE-476
NULL Pointer Dereference
The product dereferences a pointer that it expects to be valid but is NULL.
Phase: Implementation If all pointers that could have been modified are checked for NULL before use, nearly all NULL pointer dereferences can be prevented. Phase: Requirements Select a programming language that is not susceptible to these issues. Phase: Implementation Check the results of all functions that return a...
5,662
linux
e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3
static ssize_t ib_ucm_write(struct file *filp, const char __user *buf, size_t len, loff_t *pos) { struct ib_ucm_file *file = filp->private_data; struct ib_ucm_cmd_hdr hdr; ssize_t result; if (len < sizeof(hdr)) return -EINVAL; if (copy_from_user(&hdr, buf, sizeof(hdr))) return -EFAULT; if (hdr...
1
CVE-2016-4565
CWE-264
Permissions, Privileges, and Access Controls
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.
Not Found in CWE Page
8,797
libcomps
e3a5d056633677959ad924a51758876d415e7046
void comps_rtree_unite(COMPS_RTree *rt1, COMPS_RTree *rt2) { COMPS_HSList *tmplist, *tmp_subnodes; COMPS_HSListItem *it; struct Pair { COMPS_HSList * subnodes; char * key; char added; } *pair, *parent_pair; pair = malloc(sizeof(struct Pair)); pair->subnodes = rt2->...
1
CVE-2019-3817
CWE-416
Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory...
Phase: Architecture and Design Strategy: Language Selection Choose a language that provides automatic memory management. Phase: Implementation Strategy: Attack Surface Reduction When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures m...
8,997
FFmpeg
7ba100d3e6e8b1e5d5342feb960a7f081d6e15af
static int read_data(void *opaque, uint8_t *buf, int buf_size) { struct playlist *v = opaque; HLSContext *c = v->parent->priv_data; int ret, i; int just_opened = 0; int reload_count = 0; restart: if (!v->needed) return AVERROR_EOF; if (!v->input) { int64_t reload_interval; ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
17,079
ImageMagick
cfd829bd3581b092e0a267b3deba46fa90b9bc88
static MagickBooleanType WritePALMImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { MagickBooleanType status; MagickOffsetType currentOffset, offset, scene; MagickSizeType cc; PixelInfo transpix; QuantizeInfo *quantize_info; register ssize_t x...
1
CVE-2020-25665
CWE-125
Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.
Phase: Implementation Strategy: Input Validation Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that do...
1,874
linux
48900cb6af4282fa0fb6ff4d72a81aa3dadb5c39
static void virtnet_netpoll(struct net_device *dev) { struct virtnet_info *vi = netdev_priv(dev); int i; for (i = 0; i < vi->curr_queue_pairs; i++) napi_schedule(&vi->rq[i].napi); }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
14,214
ntfs-3g
fb28eef6f1c26170566187c1ab7dc913a13ea43c
static void fuse_lib_unlink(fuse_req_t req, fuse_ino_t parent, const char *name) { struct fuse *f = req_fuse_prepare(req); char *path; int err; err = -ENOENT; pthread_rwlock_wrlock(&f->tree_lock); path = get_path_name(f, parent, name); if (path != NULL) { ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
13,773
php-src
b585a3aed7880a5fa5c18e2b838fc96f40e075bd
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements, int objprops) { while (elements-- > 0) { zval *key, *data, **old_data; ALLOC_INIT_ZVAL(key); if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { zval_dtor(key); FREE_ZVAL(key); return 0; } if (Z_TYPE_...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
23,871
net
85f1bd9a7b5a79d5baa8bf44af19658f7bf77bfa
int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb) { int err; err = __ip_local_out(net, sk, skb); if (likely(err == 1)) err = dst_output(net, sk, skb); return err; }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
10,738
ImageMagick
e88532bd4418e95b70cbc415fe911d22ab27a5fd
static inline Quantum ScaleLongToQuantum(const unsigned int value) { return((Quantum) (4294967297.0*value)); }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
18,898
hhvm
b3679121bb3c7017ff04b4c08402ffff5cf59b13
void append(char c) { assertx(p < end); *p++ = c; }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,257
ghostpdl
961b10cdd71403072fb99401a45f3bef6ce53626
xps_decode_font_char_imp(xps_font_t *font, int code) { byte *table; /* no cmap selected: return identity */ if (font->cmapsubtable <= 0) return code; table = font->data + font->cmapsubtable; switch (u16(table)) { case 0: /* Apple standard 1-to-1 mapping. */ { ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
15,209
Chrome
dcd538eb3daf6c52d3ebef0a7afea758f6c657c8
void Compositor::OnFirstSurfaceActivation( const viz::SurfaceInfo& surface_info) { }
1
CVE-2016-1661
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Phase: Architecture and Design Strategy: Attack Surface Reduction Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary b...
5,389
Chrome
33827275411b33371e7bb750cce20f11de85002d
void SelectionController::SendContextMenuEvent( const MouseEventWithHitTestResults& mev, const LayoutPoint& position) { if (!Selection().IsAvailable()) return; if (Selection().Contains(position) || mev.GetScrollbar() || !(Selection() .ComputeVisibleSelectionInDOMTreeDeprecated() ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
11,149
gpac
96047e0e6166407c40cc19f4e94fb35cd7624391
const GF_FilterRegister *xviddec_register(GF_FilterSession *session) { #if !defined(GPAC_DISABLE_AV_PARSERS) && defined(GPAC_HAS_XVID) return &XVIDRegister; #else return NULL; #endif }
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
21,175
Android
37c88107679d36c419572732b4af6e18bb2f7dce
static int enable(void) { LOG_INFO("%s", __func__); if (!interface_ready()) return BT_STATUS_NOT_READY; stack_manager_get_interface()->start_up_stack_async(); return BT_STATUS_SUCCESS; }
1
CVE-2016-3760
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Phase: Architecture and Design Strategy: Attack Surface Reduction Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary b...
6,524
FFmpeg
c953baa084607dd1d84c3bfcce3cf6a87c3e6e05
static int mov_read_dops(MOVContext *c, AVIOContext *pb, MOVAtom atom) { const int OPUS_SEEK_PREROLL_MS = 80; int ret; AVStream *st; size_t size; uint16_t pre_skip; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; if ((uint64_t)atom.size > (1<<30) ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
11,166
radare2
9d348bcc2c4bbd3805e7eec97b594be9febbdf9a
static int set_reg_profile(RAnal *anal) { const char *p = "=PC pcl\n" "=SP sp\n" "=A0 r25\n" "=A1 r24\n" "=A2 r23\n" "=A3 r22\n" "=R0 r24\n" #if 0 PC: 16- or 22-bit program counter SP: 8- or 16-bit stack pointer SREG: 8-bit status register RAMPX, RAMPY, RAMPZ, RAMPD and EIND: #endif "gpr r0 .8 0 0\n" ...
0
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
NOT_APPLICABLE
14,308