context
large_stringlengths
383
16.5k
cve
large_stringclasses
1 value
cwe
large_stringclasses
13 values
id
large_stringlengths
1
4
label
large_stringclasses
1 value
source
large_stringlengths
48
234k
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2500
true
bool PDFDoc::setup(const GooString *ownerPassword, const GooString *userPassword) { pdfdocLocker(); if (str->getLength() <= 0) { error(errSyntaxError, -1, "Document stream is empty"); return false; } str->setPos(0, -1); if (str->getPos() < 0) { error(errSyntaxError, -1, "Document base stream...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2501
true
static int dex_loadcode(RBinFile *arch, RBinDexObj *bin) { struct r_bin_t *rbin = arch->rbin; int i; int *methods = NULL; int sym_count = 0; // doublecheck?? if (!bin || bin->methods_list) { return false; } bin->code_from = UT64_MAX; bin->code_to = 0; bin->methods_list = r_list_newf ((RListFree)free); if ...
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2502
true
std::shared_ptr<Grammar> perform_core(const char *s, size_t n, const Rules &rules, std::string &start, Log log) { Data data; any dt = &data; auto r = g["Grammar"].parse(s, n, dt); if (!r.ret) { if (log) { if...
{"cwe_details": {"ID": "190", "Name": "Integer Overflow or Wraparound", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-190-Diagram.png", "Description": "The product performs a calculation that can\n produce an integer overflow or wraparound when the logic\n ...
CWE-190
2503
true
static punycode_uint decode_digit(punycode_uint cp) { return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base; }
{"cwe_details": {"ID": "362", "Name": "Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-362-Diagram.png", "Description": "The product contains a concurrent code sequence that requi...
CWE-362
2504
true
int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size) { kuid_t euid; kgid_t egid; int id; int next_id = ids->next_id; if (size > IPCMNI) size = IPCMNI; if (ids->in_use >= size) return -ENOSPC; idr_preload(GFP_KERNEL); spin_lock_init(&new->lock); new->deleted = false; rcu_read_lock()...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2505
true
static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags) { struct sockaddr_llc *uaddr = (struct sockaddr_llc *)msg->msg_name; const int nonblock = flags & MSG_DONTWAIT; struct sk_buff *skb = NULL; struct sock *sk = sock->sk; struct llc_sock *llc = llc_sk(sk...
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2506
true
TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) { TIFFDirectory *td = &tif->tif_dir; char *sep; long l, n; #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) fprintf(fd, "TIFF Directory at offset 0x%I64x (%I64u)\n", (unsigned __int64) tif->tif_diroff, (unsigned __int64) tif->tif_diroff);...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2507
true
adv_error adv_png_read_ihdr( unsigned* pix_width, unsigned* pix_height, unsigned* pix_pixel, unsigned char** dat_ptr, unsigned* dat_size, unsigned char** pix_ptr, unsigned* pix_scanline, unsigned char** pal_ptr, unsigned* pal_size, unsigned char** rns_ptr, unsigned* rns_size, adv_fz* f, const unsigned char* data,...
{"cwe_details": {"ID": "362", "Name": "Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-362-Diagram.png", "Description": "The product contains a concurrent code sequence that requi...
CWE-362
2508
true
static struct rmap_item *scan_get_next_rmap_item(struct page **page) { struct mm_struct *mm; struct mm_slot *slot; struct vm_area_struct *vma; struct rmap_item *rmap_item; if (list_empty(&ksm_mm_head.mm_list)) return NULL; slot = ksm_scan.mm_slot; if (slot == &ksm_mm_head) { /* * A number of pages can h...
{"cwe_details": {"ID": "190", "Name": "Integer Overflow or Wraparound", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-190-Diagram.png", "Description": "The product performs a calculation that can\n produce an integer overflow or wraparound when the logic\n ...
CWE-190
2509
true
static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all) { char *str, *hint_charset = NULL; int str_len, hint_charset_len = 0; size_t new_len; long flags = ENT_COMPAT; char *replaced; zend_bool double_encode = 1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!b", &str, &str_len, &flags, ...
{"cwe_details": {"ID": "415", "Name": "Double Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-415-Diagram.png", "Description": "The product calls free() twice on the same memory address.", "PotentialMitigations": [{"Phase": ["Architecture and Design"], "Descriptio...
CWE-415
2510
true
_zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error) { zip_uint8_t buf[CDENTRYSIZE]; zip_uint16_t dostime, dosdate; zip_uint32_t size, variable_size; zip_uint16_t filename_len, comment_len, ef_len; bool from_buffer = (buffer != NULL); siz...
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2511
true
spell_dump_compl( char_u *pat, // leading part of the word int ic, // ignore case int *dir, // direction for adding matches int dumpflags_arg) // DUMPFLAG_* { langp_T *lp; slang_T *slang; idx_T arridx[MAXWLEN]; int curi[MAXWLEN]; char_u word[MAXWLEN]; int c; ...
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2512
true
void LayerWebKitThread::setNeedsCommit() { if (m_owner) m_owner->notifySyncRequired(); }
{"cwe_details": {"ID": "369", "Name": "Divide By Zero", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Description": "The product divides a value by zero."}, "cve_details": {"project": "tensorflow", "commit_message": "[lite] Add validation check for dilation height/width to be positive integers.\n\nP...
CWE-369
2513
true
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteDepthwiseConvParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); bool has_bias = NumInputs(node) == 3; TF_LITE_ENSURE(context, has_bias || NumInputs(node) == 2); ...
{"cwe_details": {"ID": "401", "Name": "Missing Release of Memory after Effective Lifetime", "Abstraction": "Variant", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-401-Diagram.png", "Description": "The product does not sufficiently track and release allocated memory after it has been used, maki...
CWE-401
2514
true
static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception) { char command[MaxTextExtent]; const char *option; graph_t *graph; Image *image; ImageInfo *read_info; MagickBooleanType status; /* Open image file. */ assert(image_info != (const ImageIn...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2515
true
bool ContentSettingsObserver::AllowScript(bool enabled_per_settings) { if (!enabled_per_settings) return false; if (IsScriptDisabledForPreview(render_frame())) return false; if (is_interstitial_page_) return true; blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); const auto it = cached...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2516
true
AcpiPsCompleteFinalOp ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, ACPI_STATUS Status) { ACPI_STATUS Status2; ACPI_FUNCTION_TRACE_PTR (PsCompleteFinalOp, WalkState); /* * Complete the last Op (if not completed), and clear the scope sta...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2517
true
EbmlElement * EbmlElement::FindNextElement(IOCallback & DataStream, const EbmlSemanticContext & Context, int & UpperLevel, uint64 MaxDataSize, bool AllowDummyElt, unsigned int MaxLowerLevel) { int PossibleID_Length = 0; binary PossibleIdNSize[16]; int PossibleSizeLength;...
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2518
true
bool Extension::InitFromValue(const DictionaryValue& source, int flags, std::string* error) { URLPattern::ParseOption parse_strictness = (flags & STRICT_ERROR_CHECKS ? URLPattern::PARSE_STRICT : URLPattern::PARSE_LENIENT); if (source.HasKey(key...
{"cwe_details": {"ID": "190", "Name": "Integer Overflow or Wraparound", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-190-Diagram.png", "Description": "The product performs a calculation that can\n produce an integer overflow or wraparound when the logic\n ...
CWE-190
2519
true
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...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2520
true
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) { xmlParserCtxtPtr ctxt = NULL; xmlDocPtr ret; /* xmlInitParser(); */ */ ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); if (ctxt) { ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax-...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2521
true
ins_compl_stop(int c, int prev_mode, int retval) { char_u *ptr; int want_cindent; // Get here when we have finished typing a sequence of ^N and // ^P or other completion characters in CTRL-X mode. Free up // memory that was used, and make sure we can redo the insert. if (compl_curr_match != N...
{"cwe_details": {"ID": "415", "Name": "Double Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-415-Diagram.png", "Description": "The product calls free() twice on the same memory address.", "PotentialMitigations": [{"Phase": ["Architecture and Design"], "Descriptio...
CWE-415
2522
true
static int xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, xmlNodeSetPtr set, int contextSize, int minPos, int maxPos, int hasNsNodes) { if (op->ch1 != -1) { xmlXPathCompExprPtr comp = ctxt->comp; if (comp->ste...
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2523
true
int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ Vdbe *v = pParse->pVdbe; /* The VM under construction */ int op; /* The opcode being coded */ int inReg = target; /* Results stored in register inReg */ int regFree1 = 0; /* If non-zero free this temporary regist...
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2524
true
void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { php_url *url; size_t old_len = Z_STRLEN_P(value); if (flags & (FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)) { php_error_docref(NULL, E_DEPRECATED, "explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is dep...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2525
true
void ide_atapi_cmd_reply_end(IDEState *s) { int byte_count_limit, size, ret; while (s->packet_transfer_size > 0) { trace_ide_atapi_cmd_reply_end(s, s->packet_transfer_size, s->elementary_transfer_size, s->io_buffer_index); ...
{"cwe_details": {"ID": "416", "Name": "Use After Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-416-Diagram.png", "Description": "The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and save...
CWE-416
2526
true
static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error TSRMLS_DC) /* {{{ */ { php_stream_statbuf ssb; int len; php_stream *fp; char *fullpath; const char *slash; mode_t mode; cwd_state new_state; char *filename; size_t filename_len; if (entry->is_moun...
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2527
true
void CClient::ProcessServerPacket(CNetChunk *pPacket) { CUnpacker Unpacker; Unpacker.Reset(pPacket->m_pData, pPacket->m_DataSize); // unpack msgid and system flag int Msg = Unpacker.GetInt(); int Sys = Msg&1; Msg >>= 1; if(Unpacker.Error()) return; if(Sys) { // system message if((pPacket->m_Flags&NET_...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2528
true
fd_read_body (const char *downloaded_filename, int fd, FILE *out, wgint toread, wgint startpos, wgint *qtyread, wgint *qtywritten, double *elapsed, int flags, FILE *out2) { int ret = 0; #undef max #define max(a,b) ((a) > (b) ? (a) : (b)) int dlbufsize = max (BUFSIZ, 8 * 1024); char *d...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2529
true
_gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, gcry_mpi_t r_r, gcry_mpi_t s, int hashalgo, gcry_mpi_t pk) { int rc; mpi_ec_t ctx = NULL; int b; unsigned int tmp; unsigned char *digest = NULL; gcry_buffer_t hvec[3]; const void *mbuf; size_t mlen; unsigned char *rawm...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2530
true
static int snd_timer_user_tselect(struct file *file, struct snd_timer_select __user *_tselect) { struct snd_timer_user *tu; struct snd_timer_select tselect; char str[32]; int err = 0; tu = file->private_data; if (tu->timeri) { snd_timer_close(tu->timeri); tu->timeri = NULL; } if (copy_from_user(&tsel...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2531
true
renderCoTable(struct table *tbl, int maxlimit) { struct readbuffer obuf; struct html_feed_environ h_env; struct environment envs[MAX_ENV_LEVEL]; struct table *t; int i, col, row; int indent, maxwidth; for (i = 0; i < tbl->ntable; i++) { t = tbl->tables[i].ptr; col = tbl->tables[i].col; r...
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2532
true
uint64_t hllCount(struct hllhdr *hdr, int *invalid) { double m = HLL_REGISTERS; double E; int j; int reghisto[HLL_Q+2] = {0}; /* Compute register histogram */ if (hdr->encoding == HLL_DENSE) { hllDenseRegHisto(hdr->registers,reghisto); } else if (hdr->encoding == HLL_SPARSE) { ...
{"cwe_details": {"ID": "416", "Name": "Use After Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-416-Diagram.png", "Description": "The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and save...
CWE-416
2533
true
static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long param) { int drive = (long)bdev->bd_disk->private_data; int type = ITYPE(drive_state[drive].fd_device); int i; int ret; int size; union inparam { struct floppy_struct g; /* geometry */ struct format_descr...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2534
true
qtdemux_tag_add_str_full (GstQTDemux * qtdemux, GstTagList * taglist, const char *tag, const char *dummy, GNode * node) { const gchar *env_vars[] = { "GST_QT_TAG_ENCODING", "GST_TAG_ENCODING", NULL }; GNode *data; char *s; int len; guint32 type; int offset; gboolean ret = TRUE; const gchar *charset ...
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2535
true
static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov, unsigned int max_num_sg, bool is_write, hwaddr pa, size_t sz) { unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); while (sz) { hwaddr len = ...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2536
true
utf8_str (const gchar *utf8, gchar *buf) { char_str (g_utf8_get_char (utf8), buf); return buf; }
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2537
true
static int ne2000_buffer_full(NE2000State *s) { int avail, index, boundary; index = s->curpag << 8; boundary = s->boundary << 8; if (index < boundary) return 1; return 0; }
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2538
true
jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr) { jp2_box_t *box; int found; jas_image_t *image; jp2_dec_t *dec; bool samedtype; int dtype; unsigned int i; jp2_cmap_t *cmapd; jp2_pclr_t *pclrd; jp2_cdef_t *cdefd; unsigned int channo; int newcmptno; int_fast32_t *lutents; #if 0 jp2_cdefchan_t...
{"cwe_details": {"ID": "415", "Name": "Double Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-415-Diagram.png", "Description": "The product calls free() twice on the same memory address.", "PotentialMitigations": [{"Phase": ["Architecture and Design"], "Descriptio...
CWE-415
2539
true
get_cdtext_generic (void *p_user_data) { generic_img_private_t *p_env = p_user_data; uint8_t *p_cdtext_data = NULL; size_t len; if (!p_env) return NULL; if (p_env->b_cdtext_error) return NULL; if (NULL == p_env->cdtext) { p_cdtext_data = read_cdtext_generic (p_env); if (NULL != p_cdtext_data) {...
{"cwe_details": {"ID": "190", "Name": "Integer Overflow or Wraparound", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-190-Diagram.png", "Description": "The product performs a calculation that can\n produce an integer overflow or wraparound when the logic\n ...
CWE-190
2540
true
BGD_DECLARE(void) gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality) { uint8_t *argb; int x, y; uint8_t *p; uint8_t *out; size_t out_size; if (im == NULL) { return; } if (!gdImageTrueColor(im)) { gd_error("Paletter image not supported by webp"); return; } if (quality == -1) { quality =...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2541
true
process_demand_active(STREAM s) { uint8 type; uint16 len_src_descriptor, len_combined_caps; /* at this point we need to ensure that we have ui created */ rd_create_ui(); in_uint32_le(s, g_rdp_shareid); in_uint16_le(s, len_src_descriptor); in_uint16_le(s, len_combined_caps); in_uint8s(s, len_src_des...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2542
true
static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode) { php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; iconv_t cd = (iconv_t)(-1), cd_pl = (iconv_t)(-1); const char *p1; size_t str_left; unsigned int scan_stat = 0; c...
{"cwe_details": {"ID": "703", "Name": "Improper Check or Handling of Exceptional Conditions", "Abstraction": "Pillar", "Structure": "Simple", "Status": "Incomplete", "Diagram": "/data/images/CWE-703-Diagram.png", "Description": "The product does not properly anticipate or handle exceptional conditions that rarely occur...
CWE-703
2543
true
void Compute(OpKernelContext* ctx) override { const Tensor& handle = ctx->input(0); const string& name = handle.scalar<tstring>()(); auto session_state = ctx->session_state(); OP_REQUIRES(ctx, session_state != nullptr, errors::FailedPrecondition( "DeleteSessionTenso...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2544
true
int hfsplus_find_cat(struct super_block *sb, u32 cnid, struct hfs_find_data *fd) { hfsplus_cat_entry tmp; int err; u16 type; hfsplus_cat_build_key(sb, fd->search_key, cnid, NULL); err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry)); if (err) return err; type = be16_to_cpu(tmp.type); if (type != ...
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2545
true
unicode_unfold_key(OnigCodePoint code) { static const struct ByUnfoldKey wordlist[] = { {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, ...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2546
true
MagickExport Image *SampleImage(const Image *image,const size_t columns, const size_t rows,ExceptionInfo *exception) { #define SampleImageTag "Sample/Image" CacheView *image_view, *sample_view; Image *sample_image; MagickBooleanType status; MagickOffsetType progress; register ssize...
{"cwe_details": {"ID": "416", "Name": "Use After Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-416-Diagram.png", "Description": "The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and save...
CWE-416
2547
true
DNSResult DNS::GetResult() { /* Fetch dns query response and decide where it belongs */ DNSHeader header; DNSRequest *req; unsigned char buffer[sizeof(DNSHeader)]; irc::sockets::sockaddrs from; memset(&from, 0, sizeof(from)); socklen_t x = sizeof(from); int length = ServerInstance->SE->RecvFrom(this, (char*)bu...
{"cwe_details": {"ID": "415", "Name": "Double Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-415-Diagram.png", "Description": "The product calls free() twice on the same memory address.", "PotentialMitigations": [{"Phase": ["Architecture and Design"], "Descriptio...
CWE-415
2548
true
BGD_DECLARE(void *) gdImageBmpPtr(gdImagePtr im, int *size, int compression) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); if (out == NULL) return NULL; gdImageBmpCtx(im, out, compression); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; }
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2549
true
inline int MatchingDim(const RuntimeShape& shape1, int index1, const RuntimeShape& shape2, int index2) { TFLITE_DCHECK_EQ(shape1.Dims(index1), shape2.Dims(index2)); return shape1.Dims(index1); }
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2550
true
static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile) { register const unsigned char *p; size_t length; unsigned char *datum; unsigned int count, long_sans; unsigned short id, short_sans; length=GetStringInfoLength(bim_profile); if (length < 16) return...
{"cwe_details": {"ID": "703", "Name": "Improper Check or Handling of Exceptional Conditions", "Abstraction": "Pillar", "Structure": "Simple", "Status": "Incomplete", "Diagram": "/data/images/CWE-703-Diagram.png", "Description": "The product does not properly anticipate or handle exceptional conditions that rarely occur...
CWE-703
2551
true
sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { sctp_disposition_t retval; struct sctp_chunk *chunk = arg; struct sctp_association *new_asoc; i...
{"cwe_details": {"ID": "190", "Name": "Integer Overflow or Wraparound", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-190-Diagram.png", "Description": "The product performs a calculation that can\n produce an integer overflow or wraparound when the logic\n ...
CWE-190
2552
true
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) { switch (ps_parsing) { case XML_SUSPENDED: errorCode = XML_ERROR_SUSPENDED; return XML_STATUS_ERROR; case XML_FINISHED: errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; case XML_INITIALIZED: if (parentParser == NULL &...
{"cwe_details": {"ID": "401", "Name": "Missing Release of Memory after Effective Lifetime", "Abstraction": "Variant", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-401-Diagram.png", "Description": "The product does not sufficiently track and release allocated memory after it has been used, maki...
CWE-401
2553
true
static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { const char *value; const StringInfo *profile; DPXInfo dpx; GeometryInfo geometry_info; MagickBooleanType status; MagickOffsetType offset; MagickStatusType flags;...
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2554
true
static bool load_buffer(RBinFile *bf, void **bin_obj, RBuffer *buf, ut64 loadaddr, Sdb *sdb) { RBuffer *fbuf = r_buf_ref (buf); struct MACH0_(opts_t) opts; MACH0_(opts_set_default) (&opts, bf); struct MACH0_(obj_t) *main_mach0 = MACH0_(new_buf) (fbuf, &opts); if (!main_mach0) { return false; } RRebaseInfo *re...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2555
true
static void ctrycatchfinally(JF, js_Ast *trystm, js_Ast *catchvar, js_Ast *catchstm, js_Ast *finallystm) { int L1, L2, L3; L1 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the try block */ L2 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the ca...
{"cwe_details": {"ID": "362", "Name": "Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-362-Diagram.png", "Description": "The product contains a concurrent code sequence that requi...
CWE-362
2556
true
int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) { struct pipe_buffer *bufs; unsigned int head, tail, mask, n; /* * We can shrink the pipe, if arg is greater than the ring occupancy. * Since we don't expect a lot of shrink+grow operations, just free and * allocate again like we would ...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2557
true
getHTTPResponse(int s, int * size) { char buf[2048]; int n; int endofheaders = 0; int chunked = 0; int content_length = -1; unsigned int chunksize = 0; unsigned int bytestocopy = 0; /* buffers : */ char * header_buf; unsigned int header_buf_len = 2048; unsigned int header_buf_used = 0; char * content_buf; ...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2558
true
static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t size, int flags) { struct sock *sk = sock->sk; struct irda_sock *self = irda_sk(sk); struct sk_buff *skb; size_t copied; int err; IRDA_DEBUG(4, "%s()\n", __func__); skb = skb_recv_datagram(sk, flags &...
{"cwe_details": {"ID": "703", "Name": "Improper Check or Handling of Exceptional Conditions", "Abstraction": "Pillar", "Structure": "Simple", "Status": "Incomplete", "Diagram": "/data/images/CWE-703-Diagram.png", "Description": "The product does not properly anticipate or handle exceptional conditions that rarely occur...
CWE-703
2559
true
__acquires(kernel_lock) { char *orig_data = kstrdup(data, GFP_KERNEL); struct buffer_head *bh; struct ext4_super_block *es = NULL; struct ext4_sb_info *sbi; ext4_fsblk_t block; ext4_fsblk_t sb_block = get_sb_block(&data); ext4_fsblk_t logical_sb_block; unsigned long offset = 0; unsigned long journal_devnum...
{"cwe_details": {"ID": "703", "Name": "Improper Check or Handling of Exceptional Conditions", "Abstraction": "Pillar", "Structure": "Simple", "Status": "Incomplete", "Diagram": "/data/images/CWE-703-Diagram.png", "Description": "The product does not properly anticipate or handle exceptional conditions that rarely occur...
CWE-703
2560
true
win_exchange(long Prenum) { frame_T *frp; frame_T *frp2; win_T *wp; win_T *wp2; int temp; if (ERROR_IF_ANY_POPUP_WINDOW) return; if (ONE_WINDOW) // just one window { beep_flush(); return; } #ifdef FEAT_GUI need_mouse_correct = TRUE; #endif /* * find window to ...
{"cwe_details": {"ID": "190", "Name": "Integer Overflow or Wraparound", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-190-Diagram.png", "Description": "The product performs a calculation that can\n produce an integer overflow or wraparound when the logic\n ...
CWE-190
2561
true
static Fixed lsr_translate_coords(GF_LASeRCodec *lsr, u32 val, u32 nb_bits) { #ifdef GPAC_FIXED_POINT if (val >> (nb_bits-1) ) { s32 neg = (s32) val - (1<<nb_bits); if (neg < -FIX_ONE / 2) return 2 * gf_divfix(INT2FIX(neg/2), lsr->res_factor); return gf_divfix(INT2FIX(neg), lsr->res_factor); } else { if (v...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2562
true
parse_elements(netdissect_options *ndo, struct mgmt_body_t *pbody, const u_char *p, int offset, u_int length) { u_int elementlen; struct ssid_t ssid; struct challenge_t challenge; struct rates_t rates; struct ds_t ds; struct cf_t cf; struct tim_t tim; /* * We haven't seen any el...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2563
true
static int DecodeGifImg(struct ngiflib_img * i) { struct ngiflib_decode_context context; long npix; u8 * stackp; u8 * stack_top; u16 clr; u16 eof; u16 free; u16 act_code = 0; u16 old_code = 0; u16 read_byt; u16 ab_prfx[4096]; u8 ab_suffx[4096]; u8 ab_stack[4096]; u8 flags; u8 casspecial = 0; if(!i) ret...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2564
true
static int load_script(struct linux_binprm *bprm) { const char *i_arg, *i_name; char *cp; struct file *file; char interp[BINPRM_BUF_SIZE]; int retval; if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) return -ENOEXEC; /* * This section does the #! interpretation. * Sorta complicated, but hopefully it wi...
{"cwe_details": {"ID": "416", "Name": "Use After Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-416-Diagram.png", "Description": "The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and save...
CWE-416
2565
true
static int ep_loop_check_proc(void *priv, void *cookie, int call_nests) { int error = 0; struct file *file = priv; struct eventpoll *ep = file->private_data; struct eventpoll *ep_tovisit; struct rb_node *rbp; struct epitem *epi; mutex_lock_nested(&ep->mtx, call_nests + 1); ep->visited = 1; list_add(&ep->visit...
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2566
true
PHP_FUNCTION(imagetruecolortopalette) { zval *IM; zend_bool dither; zend_long ncolors; gdImagePtr im; if (zend_parse_parameters(ZEND_NUM_ARGS(), "rbl", &IM, &dither, &ncolors) == FAILURE) { return; } if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(IM), "Image", le_gd)) == NULL) { RETURN_FALSE; } if (...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2567
true
void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc, void *outputStream, GooString *name, GBool needVerticalMetrics, int *maxUsedGlyph) { Guchar headData[54]; TrueTypeLoca *locaTable; Guchar *locaData; TrueTypeTable newTables[nT42Tables]; Guchar tableDir[12 + nT42Ta...
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2568
true
rsock_init_unixsock(VALUE sock, VALUE path, int server) { struct sockaddr_un sockaddr; socklen_t sockaddrlen; int fd, status; rb_io_t *fptr; SafeStringValue(path); INIT_SOCKADDR_UN(&sockaddr, sizeof(struct sockaddr_un)); if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) { ...
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2569
true
int ssl3_send_client_key_exchange(SSL *s) { unsigned char *p,*d; int n; unsigned long l; #ifndef OPENSSL_NO_RSA unsigned char *q; EVP_PKEY *pkey=NULL; #endif #ifndef OPENSSL_NO_KRB5 KSSL_ERR kssl_err; #endif /* OPENSSL_NO_KRB5 */ #ifndef OPENSSL_NO_ECDH EC_KEY *clnt_ecdh = NULL; const EC_POINT *srvr_ecpoint = ...
{"cwe_details": {"ID": "401", "Name": "Missing Release of Memory after Effective Lifetime", "Abstraction": "Variant", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-401-Diagram.png", "Description": "The product does not sufficiently track and release allocated memory after it has been used, maki...
CWE-401
2570
true
ReadNextCell( mat_t *mat, matvar_t *matvar ) { size_t bytesread = 0, i; int err; matvar_t **cells = NULL; size_t nelems = 1; err = SafeMulDims(matvar, &nelems); if ( err ) { Mat_Critical("Integer multiplication overflow"); return bytesread; } matvar->data_size = sizeof(m...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2571
true
png_set_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp palette, int num_palette) { png_debug1(1, "in %s storage function", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH) { if (info_ptr->color_type =...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2572
true
static void WriteProfile(j_compress_ptr jpeg_info,Image *image) { const char *name; const StringInfo *profile; MagickBooleanType iptc; register ssize_t i; size_t length, tag_length; StringInfo *custom_profile; /* Save image profile as a APP marker. */ iptc=MagickF...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2573
true
static int decode_bit_string(const u8 * inbuf, size_t inlen, void *outbuf, size_t outlen, int invert) { const u8 *in = inbuf; u8 *out = (u8 *) outbuf; int zero_bits = *in & 0x07; size_t octets_left = inlen - 1; int i, count = 0; memset(outbuf, 0, outlen); in++; if (outlen < octets_left) return...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2574
true
iakerb_gss_export_sec_context(OM_uint32 *minor_status, gss_ctx_id_t *context_handle, gss_buffer_t interprocess_token) { OM_uint32 maj; iakerb_ctx_id_t ctx = (iakerb_ctx_id_t)context_handle; /* We don't currently support exporting partially es...
{"cwe_details": {"ID": "362", "Name": "Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-362-Diagram.png", "Description": "The product contains a concurrent code sequence that requi...
CWE-362
2575
true
static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file) { int err = 0; unsigned int saved_f_flags; struct snd_pcm_substream *substream; struct snd_pcm_runtime *runtime; snd_pcm_format_t format; unsigned long width; size_t size; substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; if (subst...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2576
true
static TEE_Result set_rmem_param(const struct optee_msg_param_rmem *rmem, struct param_mem *mem) { uint64_t shm_ref = READ_ONCE(rmem->shm_ref); mem->mobj = mobj_reg_shm_get_by_cookie(shm_ref); if (!mem->mobj) return TEE_ERROR_BAD_PARAMETERS; mem->offs = READ_ONCE(rmem->offs); mem->size = READ_ONCE...
{"cwe_details": {"ID": "416", "Name": "Use After Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-416-Diagram.png", "Description": "The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and save...
CWE-416
2577
true
int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, struct rq_map_data *map_data, const struct iov_iter *iter, gfp_t gfp_mask) { bool copy = false; unsigned long align = q->dma_pad_mask | queue_dma_alignment(q); struct bio *bio = NULL; struct iov_iter i; int ret; if (map_data) copy ...
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2578
true
struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, int *peeked, int *off, int *err) { struct sk_buff *skb; long timeo; /* * Caller is allowed not to check sk->sk_err before skb_recv_datagram() */ int error = sock_error(sk); if (error) goto no_packet; timeo = sock_rcvtimeo(sk,...
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2579
true
static INLINE BOOL ensure_capacity(const BYTE* start, const BYTE* end, size_t size, size_t base) { const size_t available = (uintptr_t)end - (uintptr_t)start; const BOOL rc = available >= size * base; return rc; }
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2580
true
do_conversion (const char *tocode, const char *fromcode, char const *in_org, size_t inlen, char **out) { iconv_t cd; /* sXXXav : hummm hard to guess... */ size_t len, done, outlen; int invalid = 0, tooshort = 0; char *s, *in, *in_save; cd = iconv_open (tocode, fromcode); if (cd == (iconv_t)(-1)) { ...
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2581
true
static void do_client_disconnect(void) { if (client_connected) { udscs_server_write_all(server, VDAGENTD_CLIENT_DISCONNECTED, 0, 0, NULL, 0); client_connected = false; } }
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2582
true
*/ PHPAPI void php_print_info(int flag TSRMLS_DC) { char **env, *tmp1, *tmp2; char *php_uname; if (!sapi_module.phpinfo_as_text) { php_print_info_htmlhead(TSRMLS_C); } else { php_info_print("phpinfo()\n"); } if (flag & PHP_INFO_GENERAL) { char *zend_version = get_zend_version(); char temp_api[10]; p...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2583
true
gen_assignment(codegen_scope *s, node *tree, node *rhs, int sp, int val) { int idx; int type = nint(tree->car); switch (type) { case NODE_GVAR: case NODE_ARG: case NODE_LVAR: case NODE_IVAR: case NODE_CVAR: case NODE_CONST: case NODE_NIL: case NODE_MASGN: if (rhs) { codegen(s, rhs, VAL)...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2584
true
tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){ uint16 edge=0; tsize_t written=0; unsigned char* buffer=NULL; tsize_t bufferoffset=0; unsigned char* samplebuffer=NULL; tsize_t samplebufferoffset=0; tsize_t read=0; uint16 i=0; ttile_t tilecount=0; /* tsize_t tilesize=0...
{"cwe_details": {"ID": "190", "Name": "Integer Overflow or Wraparound", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-190-Diagram.png", "Description": "The product performs a calculation that can\n produce an integer overflow or wraparound when the logic\n ...
CWE-190
2585
true
int URI_FUNC(ComposeQueryEngine)(URI_CHAR * dest, const URI_TYPE(QueryList) * queryList, int maxChars, int * charsWritten, int * charsRequired, UriBool spaceToPlus, UriBool normalizeBreaks) { UriBool firstItem = URI_TRUE; int ampersandLen = 0; /* increased to 1 from second item on */ URI_CHAR * write = dest; ...
{"cwe_details": {"ID": "787", "Name": "Out-of-bounds Write", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-787-Diagram.png", "Description": "The product writes data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Requi...
CWE-787
2586
true
tt_size_reset( TT_Size size, FT_Bool only_height ) { TT_Face face; FT_Size_Metrics* metrics; size->ttmetrics.valid = FALSE; face = (TT_Face)size->root.face; metrics = &size->metrics; /* copy the result from base layer */ /* This bit flag, if set...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2587
true
static Token *tokenize(char *line) { char c, *p = line; enum pp_token_type type; Token *list = NULL; Token *t, **tail = &list; while (*line) { p = line; if (*p == '%') { p++; if (*p == '+' && !nasm_isdigit(p[1])) { p++; type = ...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2588
true
int wasm_dis(WasmOp *op, const unsigned char *buf, int buf_len) { op->len = 1; op->op = buf[0]; if (op->op > 0xbf) { return 1; } // add support for extension opcodes (SIMD + atomics) WasmOpDef *opdef = &opcodes[op->op]; switch (op->op) { case WASM_OP_TRAP: case WASM_OP_NOP: case WASM_OP_ELSE: case WASM_OP_...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2589
true
static int date_from_ISO8601 (const char *text, time_t * value) { struct tm tm; * Begin Time Functions * ***********************/ static int date_from_ISO8601 (const char *text, time_t * value) { struct tm tm; int n; int i; char buf[18]; if (strchr (text, '-')) { cha...
{"cwe_details": {"ID": "119", "Name": "Improper Restriction of Operations within the Bounds of a Memory Buffer", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-119-Diagram.png", "Description": "The product performs operations on a memory buffer, but it reads from or writ...
CWE-119
2590
true
logger_get_mask_expanded (struct t_gui_buffer *buffer, const char *mask) { char *mask2, *mask_decoded, *mask_decoded2, *mask_decoded3, *mask_decoded4; char *mask_decoded5; const char *dir_separator; int length; time_t seconds; struct tm *date_tmp; mask2 = NULL; mask_decoded = NU...
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2591
true
*/ static int xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) { int total = 0; int equal, ret; xmlXPathCompExprPtr comp; xmlXPathObjectPtr arg1, arg2; CHECK_ERROR0; comp = ctxt->comp; switch (op->op) { case XPATH_OP_END: return (0); case ...
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2592
true
int handle(int s, unsigned char* data, int len, struct sockaddr_in *s_in) { char buf[2048]; unsigned short *cmd = (unsigned short *)buf; int plen; struct in_addr *addr = &s_in->sin_addr; unsigned short *pid = (unsigned short*) data; /* inet check */ if (len == S_HELLO_LEN && memcmp(data, "sorbo", 5) == 0) { u...
{"cwe_details": {"ID": "416", "Name": "Use After Free", "Abstraction": "Variant", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-416-Diagram.png", "Description": "The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and save...
CWE-416
2593
true
static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags) { unsigned nbuf; unsigned idx; struct pipe_buffer *bufs; struct fuse_copy_state cs; struct fuse_dev *fud; size_t rem; ssize_t ret; fud = fuse_get_dev(out); if (!...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2594
true
void FoFiType1C::convertToType0(char *psName, int *codeMap, int nCodes, FoFiOutputFunc outputFunc, void *outputStream) { int *cidMap; Type1CIndex subrIdx; Type1CIndexVal val; int nCIDs; GooString *buf; Type1CEexecBuf eb; GBool ok; int fd, i, j, k; // compute the CID count and build the CID-to...
{"cwe_details": {"ID": "369", "Name": "Divide By Zero", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Description": "The product divides a value by zero."}, "cve_details": {"project": "ImageMagick6", "commit_message": "https://github.com/ImageMagick/ImageMagick/issues/3296", "cve": "CVE-2021-20309",...
CWE-369
2595
true
MagickExport Image *WaveImage(const Image *image,const double amplitude, const double wave_length,ExceptionInfo *exception) { #define WaveImageTag "Wave/Image" CacheView *image_view, *wave_view; float *sine_map; Image *wave_image; MagickBooleanType status; MagickOffsetType prog...
{"cwe_details": {"ID": "476", "Name": "NULL Pointer Dereference", "Abstraction": "Base", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-476-Diagram.png", "Description": "The product dereferences a pointer that it expects to be valid but is NULL.", "PotentialMitigations": [{"Phase": ["Implementa...
CWE-476
2596
true
int av_reallocp_array(void *ptr, size_t nmemb, size_t size) { void **ptrptr = ptr; *ptrptr = av_realloc_f(*ptrptr, nmemb, size); if (!*ptrptr && !(nmemb && size)) return AVERROR(ENOMEM); return 0; }
{"cwe_details": {"ID": "20", "Name": "Improper Input Validation", "Abstraction": "Class", "Structure": "Simple", "Status": "Stable", "Diagram": "/data/images/CWE-20-Diagram.png", "Description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n ...
CWE-20
2597
true
ModuleExport size_t RegisterMPCImage(void) { MagickInfo *entry; entry=SetMagickInfo("CACHE"); entry->description=ConstantString("Magick Persistent Cache image format"); entry->module=ConstantString("MPC"); entry->seekable_stream=MagickTrue; entry->stealth=MagickTrue; (void) RegisterMagickInfo(en...
{"cwe_details": {"ID": "125", "Name": "Out-of-bounds Read", "Abstraction": "Base", "Structure": "Simple", "Status": "Draft", "Diagram": "/data/images/CWE-125-Diagram.png", "Description": "The product reads data past the end, or before the beginning, of the intended buffer.", "PotentialMitigations": [{"Phase": ["Impleme...
CWE-125
2598
true
matchCurrentInput( const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) return 0; return 1; }
{"cwe_details": {"ID": "200", "Name": "Exposure of Sensitive Information to an Unauthorized Actor", "Abstraction": "Class", "Structure": "Simple", "Status": "Draft", "Description": "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", "PotentialMi...
CWE-200
2599
true
set_umask(const char *optarg) { long umask_long; mode_t umask_val; char *endptr; umask_long = strtoll(optarg, &endptr, 0); if (*endptr || umask_long < 0 || umask_long & ~0777L) { fprintf(stderr, "Invalid --umask option %s", optarg); return; } umask_val = umask_long & 0777; umask(umask_val); umask...