func
string
target
int64
cwe
list
project
string
commit_id
string
hash
float64
size
int64
message
string
Assignment_Obj Parser::parse_assignment() { std::string name(Util::normalize_underscores(lexed)); ParserState var_source_position = pstate; if (!lex< exactly<':'> >()) error("expected ':' after " + name + " in assignment statement"); if (peek_css< alternatives < exactly<';'>, end_of_file > >()) { ...
0
[ "CWE-125" ]
libsass
eb15533b07773c30dc03c9d742865604f47120ef
335,156,340,217,271,700,000,000,000,000,000,000,000
23
Fix memory leak in `parse_ie_keyword_arg` `kwd_arg` would never get freed when there was a parse error in `parse_ie_keyword_arg`. Closes #2656
static void serialize_plist(node_t* node, void* data) { uint64_t *index_val = NULL; struct serialize_s *ser = (struct serialize_s *) data; uint64_t current_index = ser->objects->len; //first check that node is not yet in objects void* val = hash_table_lookup(ser->ref_table, node); if (val) ...
0
[ "CWE-20", "CWE-119", "CWE-415", "CWE-787" ]
libplist
32ee5213fe64f1e10ec76c1ee861ee6f233120dd
173,421,952,678,979,160,000,000,000,000,000,000,000
32
bplist: Fix data range check for string/data/dict/array nodes Passing a size of 0xFFFFFFFFFFFFFFFF to parse_string_node() might result in a memcpy with a size of -1, leading to undefined behavior. This commit makes sure that the actual node data (which depends on the size) is in the range start_of_object..start_of_obj...
move_job(cupsd_client_t *con, /* I - Client connection */ ipp_attribute_t *uri) /* I - Job URI */ { http_status_t status; /* Policy status */ ipp_attribute_t *attr; /* Current attribute */ int jobid; /* Job ID */ cupsd_job_t *job; /* Current job */ const char *src; /* Source printer/class */ ...
0
[ "CWE-20" ]
cups
49fa4983f25b64ec29d548ffa3b9782426007df3
24,613,102,721,113,200,000,000,000,000,000,000,000
250
DBUS notifications could crash the scheduler (Issue #5143) - scheduler/ipp.c: Make sure requesting-user-name string is valid UTF-8.
static void *single_start(struct seq_file *p, loff_t *pos) { return NULL + (*pos == 0); }
0
[ "CWE-120", "CWE-787" ]
linux
8cae8cd89f05f6de223d63e6d15e31c8ba9cf53b
86,161,996,450,103,330,000,000,000,000,000,000,000
4
seq_file: disallow extremely large seq buffer allocations There is no reasonable need for a buffer larger than this, and it avoids int overflow pitfalls. Fixes: 058504edd026 ("fs/seq_file: fallback to vmalloc allocation") Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Reported-by: Qualys Security Advisory <qsa@qualy...
int wakeup_sysfs_add(struct device *dev) { int ret = sysfs_merge_group(&dev->kobj, &pm_wakeup_attr_group); if (!ret) kobject_uevent(&dev->kobj, KOBJ_CHANGE); return ret; }
0
[ "CWE-787" ]
linux
aa838896d87af561a33ecefea1caa4c15a68bc47
151,044,435,440,761,000,000,000,000,000,000,000,000
9
drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions Convert the various sprintf fmaily calls in sysfs device show functions to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety. Done with: $ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 . And cocci script: $ cat s...
MagickPrivate void XBestPixel(Display *display,const Colormap colormap, XColor *colors,unsigned int number_colors,XColor *color) { MagickBooleanType query_server; PixelInfo pixel; double min_distance; register double distance; register int i, j; Status status; /* Fi...
0
[]
ImageMagick
f391a5f4554fe47eb56d6277ac32d1f698572f0e
3,723,632,789,624,365,000,000,000,000,000,000,000
75
https://github.com/ImageMagick/ImageMagick/issues/1531
tuple_to_conn_key(const struct ct_dpif_tuple *tuple, uint16_t zone, struct conn_key *key) { if (tuple->l3_type == AF_INET) { key->dl_type = htons(ETH_TYPE_IP); } else if (tuple->l3_type == AF_INET6) { key->dl_type = htons(ETH_TYPE_IPV6); } key->nw_proto = tuple->ip_prot...
0
[ "CWE-400" ]
ovs
79349cbab0b2a755140eedb91833ad2760520a83
158,656,419,944,899,500,000,000,000,000,000,000,000
27
flow: Support extra padding length. Although not required, padding can be optionally added until the packet length is MTU bytes. A packet with extra padding currently fails sanity checks. Vulnerability: CVE-2020-35498 Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.") Reported-by: Joakim Hind...
ModuleExport size_t RegisterPANGOImage(void) { char version[MaxTextExtent]; MagickInfo *entry; *version='\0'; #if defined(PANGO_VERSION_STRING) (void) FormatLocaleString(version,MaxTextExtent,"Pangocairo %s", PANGO_VERSION_STRING); #endif entry=SetMagickInfo("PANGO"); #if defined(MAGICKCORE_PANG...
0
[ "CWE-476" ]
ImageMagick6
b4391bdd60df0a77e97a6ef1674f2ffef0e19e24
319,880,492,557,002,080,000,000,000,000,000,000,000
26
https://github.com/ImageMagick/ImageMagick/issues/1515
*/ void netdev_update_features(struct net_device *dev) { if (__netdev_update_features(dev)) netdev_features_change(dev);
0
[ "CWE-400", "CWE-703" ]
linux
fac8e0f579695a3ecbc4d3cac369139d7f819971
138,618,996,425,878,190,000,000,000,000,000,000,000
5
tunnels: Don't apply GRO to multiple layers of encapsulation. When drivers express support for TSO of encapsulated packets, they only mean that they can do it for one layer of encapsulation. Supporting additional levels would mean updating, at a minimum, more IP length fields and they are unaware of this. No encapsul...
mysql_drop_db(MYSQL *mysql, const char *db) { DBUG_ENTER("mysql_drop_db"); DBUG_PRINT("enter",("db: %s",db)); DBUG_RETURN(simple_command(mysql,COM_DROP_DB,db,(ulong) strlen(db),0)); }
0
[]
mysql-server
3d8134d2c9b74bc8883ffe2ef59c168361223837
260,170,967,164,364,700,000,000,000,000,000,000,000
6
Bug#25988681: USE-AFTER-FREE IN MYSQL_STMT_CLOSE() Description: If mysql_stmt_close() encountered error, it recorded error in prepared statement but then frees memory assigned to prepared statement. If mysql_stmt_error() is used to get error information, it will resu...
int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, unsigned int cond, snd_pcm_hw_param_t var, unsigned long step) { return snd_pcm_hw_rule_add(runtime, cond, var, snd_pcm_hw_rule_step, (void *) step, var, -1); }
0
[ "CWE-416", "CWE-362" ]
linux
3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4
109,889,835,972,712,310,000,000,000,000,000,000,000
9
ALSA: pcm : Call kill_fasync() in stream lock Currently kill_fasync() is called outside the stream lock in snd_pcm_period_elapsed(). This is potentially racy, since the stream may get released even during the irq handler is running. Although snd_pcm_release_substream() calls snd_pcm_drop(), this doesn't guarantee th...
void Statement::Work_Reset(napi_env e, void* data) { STATEMENT_INIT(Baton); sqlite3_reset(stmt->_handle); stmt->status = SQLITE_OK; }
0
[]
node-sqlite3
593c9d498be2510d286349134537e3bf89401c4a
224,867,373,258,865,850,000,000,000,000,000,000,000
6
bug: fix segfault of invalid toString() object (#1450) * bug: verify toString() returns valid data * test: faulty toString test
NCR_ModifyMinpoll(NCR_Instance inst, int new_minpoll) { if (new_minpoll < MIN_POLL || new_minpoll > MAX_POLL) return; inst->minpoll = new_minpoll; LOG(LOGS_INFO, LOGF_NtpCore, "Source %s new minpoll %d", UTI_IPToString(&inst->remote_addr.ip_addr), new_minpoll); if (inst->maxpoll < inst->minpoll) NCR_Mod...
0
[]
chrony
a78bf9725a7b481ebff0e0c321294ba767f2c1d8
128,635,471,254,155,850,000,000,000,000,000,000,000
9
ntp: restrict authentication of server/peer to specified key When a server/peer was specified with a key number to enable authentication with a symmetric key, packets received from the server/peer were accepted if they were authenticated with any of the keys contained in the key file and not just the specified key. T...
nat_packet(struct dp_packet *pkt, const struct conn *conn, bool related) { if (conn->nat_info->nat_action & NAT_ACTION_SRC) { pkt->md.ct_state |= CS_SRC_NAT; if (conn->key.dl_type == htons(ETH_TYPE_IP)) { struct ip_header *nh = dp_packet_l3(pkt); packet_set_ipv4_addr(pkt, &nh...
0
[ "CWE-400" ]
ovs
79349cbab0b2a755140eedb91833ad2760520a83
302,116,850,411,965,020,000,000,000,000,000,000,000
34
flow: Support extra padding length. Although not required, padding can be optionally added until the packet length is MTU bytes. A packet with extra padding currently fails sanity checks. Vulnerability: CVE-2020-35498 Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.") Reported-by: Joakim Hind...
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) { struct page *page; struct kvm *kvm; int r; BUG_ON(vcpu->kvm == NULL); kvm = vcpu->kvm; vcpu->arch.mmu.root_hpa = INVALID_PAGE; if (!irqchip_in_kernel(kvm) || vcpu->vcpu_id == 0) vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; else vcpu->arch.mp_state = KVM_MP_S...
0
[ "CWE-476" ]
linux-2.6
59839dfff5eabca01cc4e20b45797a60a80af8cb
240,883,564,531,655,600,000,000,000,000,000,000,000
41
KVM: x86: check for cr3 validity in ioctl_set_sregs Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity checking for the new cr3 value: "Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to the kernel. This will trigger a NULL pointer access in gfn_to_rmap() when userspace next tries...
static void temac_dma_out32_le(struct temac_local *lp, int reg, u32 value) { iowrite32(value, lp->sdma_regs + (reg << 2)); }
0
[ "CWE-120", "CWE-787" ]
linux
c364df2489b8ef2f5e3159b1dff1ff1fdb16040d
156,415,469,572,849,330,000,000,000,000,000,000,000
4
net: ll_temac: Fix TX BD buffer overwrite Just as the initial check, we need to ensure num_frag+1 buffers available, as that is the number of buffers we are going to use. This fixes a buffer overflow, which might be seen during heavy network load. Complete lockup of TEMAC was reproducible within about 10 minutes of a...
CharArray(char* str) : buf(str) {} // note: assumes ownership
0
[ "CWE-20", "CWE-787" ]
tigervnc
0943c006c7d900dfc0281639e992791d6c567438
258,802,923,095,157,280,000,000,000,000,000,000,000
1
Use size_t for lengths in stream objects Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
static void update_V(const uECC_HashContext *hash_context, uint8_t *K, uint8_t *V) { HMAC_init(hash_context, K); HMAC_update(hash_context, V, hash_context->result_size); HMAC_finish(hash_context, K, V); }
0
[ "CWE-415" ]
micro-ecc
1b5f5cea5145c96dd8791b9b2c41424fc74c2172
95,992,190,768,440,860,000,000,000,000,000,000,000
5
Fix for #168
static bcon_token_t bcon_token(char *s) { if (s == 0) return Token_EOD; switch (s[0]) { case ':': if (s[1] != '\0' && s[2] != '\0' && s[3] != '\0' && s[4] == '\0' && s[3] == ':' && (s[1] == '_' || s[1] == 'P' || s[1] == 'R')) return Token_Typespec; break; case '{': if (...
0
[ "CWE-190" ]
mongo-c-driver-legacy
1a1f5e26a4309480d88598913f9eebf9e9cba8ca
323,296,539,299,412,140,000,000,000,000,000,000,000
14
don't mix up int and size_t (first pass to fix that)
static bool nfs4_same_verifier(nfs4_verifier *v1, nfs4_verifier *v2) { return memcmp(v1->data, v2->data, sizeof(v1->data)) == 0; }
0
[ "CWE-703" ]
linux
dd99e9f98fbf423ff6d365b37a98e8879170f17c
255,171,284,720,990,000,000,000,000,000,000,000,000
4
NFSv4: Initialise connection to the server in nfs4_alloc_client() Set up the connection to the NFSv4 server in nfs4_alloc_client(), before we've added the struct nfs_client to the net-namespace's nfs_client_list so that a downed server won't cause other mounts to hang in the trunking detection code. Reported-by: Mich...
static void vnc_dpy_setdata(DisplayState *ds) { VncDisplay *vd = ds->opaque; *(vd->guest.ds) = *(ds->surface); vnc_dpy_update(ds, 0, 0, ds_get_width(ds), ds_get_height(ds)); }
1
[ "CWE-125" ]
qemu
9f64916da20eea67121d544698676295bbb105a7
260,733,572,100,862,370,000,000,000,000,000,000,000
7
pixman/vnc: use pixman images in vnc. The vnc code uses *three* DisplaySurfaces: First is the surface of the actual QemuConsole, usually the guest screen, but could also be a text console (monitor/serial reachable via Ctrl-Alt-<nr> keys). This is left as-is. Second is the current server's view of the screen content...
void OPENSSL_LH_flush(OPENSSL_LHASH *lh) { unsigned int i; OPENSSL_LH_NODE *n, *nn; if (lh == NULL) return; for (i = 0; i < lh->num_nodes; i++) { n = lh->b[i]; while (n != NULL) { nn = n->next; OPENSSL_free(n); n = nn; } lh->b...
1
[ "CWE-404" ]
openssl
64c85430f95200b6b51fe9475bd5203f7c19daf1
50,283,539,431,069,190,000,000,000,000,000,000,000
18
Fix bug in OPENSSL_LH_flush Fixes #18139. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18141) (cherry picked from commit e5da68183410c06f7b350a0721bc2bd6057e438e)
int btrfs_add_link(struct btrfs_trans_handle *trans, struct inode *parent_inode, struct inode *inode, const char *name, int name_len, int add_backref, u64 index) { int ret = 0; struct btrfs_key key; struct btrfs_root *root = BTRFS_I(parent_inode)->root; u64 ino = btrfs_ino(inode); u64 parent_ino = btrfs_...
0
[ "CWE-200" ]
linux
0305cd5f7fca85dae392b9ba85b116896eb7c1c7
320,377,086,882,652,300,000,000,000,000,000,000,000
67
Btrfs: fix truncation of compressed and inlined extents When truncating a file to a smaller size which consists of an inline extent that is compressed, we did not discard (or made unusable) the data between the new file size and the old file size, wasting metadata space and allowing for the truncated data to be leaked...
ins_compl_long_shown_match(void) { return (int)STRLEN(compl_shown_match->cp_str) > curwin->w_cursor.col - compl_col; }
0
[ "CWE-125" ]
vim
f12129f1714f7d2301935bb21d896609bdac221c
284,259,278,409,171,900,000,000,000,000,000,000,000
5
patch 9.0.0020: with some completion reading past end of string Problem: With some completion reading past end of string. Solution: Check the length of the string.
void nl80211_send_beacon_hint_event(struct wiphy *wiphy, struct ieee80211_channel *channel_before, struct ieee80211_channel *channel_after) { struct sk_buff *msg; void *hdr; struct nlattr *nl_freq; msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); if (!msg) return; hdr = nl80211hdr_put(msg, 0, ...
0
[ "CWE-120" ]
linux
f88eb7c0d002a67ef31aeb7850b42ff69abc46dc
58,580,713,779,547,720,000,000,000,000,000,000,000
55
nl80211: validate beacon head We currently don't validate the beacon head, i.e. the header, fixed part and elements that are to go in front of the TIM element. This means that the variable elements there can be malformed, e.g. have a length exceeding the buffer size, but most downstream code from this assumes that thi...
int ssl_set_client_disabled(SSL *s) { s->s3.tmp.mask_a = 0; s->s3.tmp.mask_k = 0; ssl_set_sig_mask(&s->s3.tmp.mask_a, s, SSL_SECOP_SIGALG_MASK); if (ssl_get_min_max_version(s, &s->s3.tmp.min_ver, &s->s3.tmp.max_ver, NULL) != 0) return 0; #ifndef OPENSSL_NO_PSK ...
0
[ "CWE-476" ]
openssl
5235ef44b93306a14d0b6c695b13c64b16e1fdec
88,392,237,399,702,380,000,000,000,000,000,000,000
23
Fix SSL_check_chain() The function SSL_check_chain() can be used by applications to check that a cert and chain is compatible with the negotiated parameters. This could be useful (for example) from the certificate callback. Unfortunately this function was applying TLSv1.2 sig algs rules and did not work correctly if T...
static int __vcpu_run(struct kvm_vcpu *vcpu) { int r; struct kvm *kvm = vcpu->kvm; if (unlikely(vcpu->arch.mp_state == KVM_MP_STATE_SIPI_RECEIVED)) { pr_debug("vcpu %d received sipi with vector # %x\n", vcpu->vcpu_id, vcpu->arch.sipi_vector); kvm_lapic_reset(vcpu); r = kvm_arch_vcpu_reset(vcpu); if (r) ...
0
[]
linux
6d1068b3a98519247d8ba4ec85cd40ac136dbdf9
298,749,890,985,390,550,000,000,000,000,000,000,000
81
KVM: x86: invalid opcode oops on SET_SREGS with OSXSAVE bit set (CVE-2012-4461) On hosts without the XSAVE support unprivileged local user can trigger oops similar to the one below by setting X86_CR4_OSXSAVE bit in guest cr4 register using KVM_SET_SREGS ioctl and later issuing KVM_RUN ioctl. invalid opcode: 0000 [#2]...
c_find_ldom(int y, int m, double sg, int *rjd, int *ns) { int i, rm, rd; for (i = 0; i < 30; i++) if (c_valid_civil_p(y, m, 31 - i, sg, &rm, &rd, rjd, ns)) return 1; return 0; }
0
[]
date
3959accef8da5c128f8a8e2fd54e932a4fb253b0
326,406,337,037,824,400,000,000,000,000,000,000,000
9
Add length limit option for methods that parses date strings `Date.parse` now raises an ArgumentError when a given date string is longer than 128. You can configure the limit by giving `limit` keyword arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`, the limit is disabled. Not only `Date.parse`...
GF_Err trik_box_read(GF_Box *s,GF_BitStream *bs) { u32 i; GF_TrickPlayBox *ptr = (GF_TrickPlayBox *) s; ptr->entry_count = (u32) ptr->size; if ((u64)ptr->entry_count > (u64)SIZE_MAX/sizeof(GF_TrickPlayBoxEntry)) { GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Invalid size %llu in trik\n", ptr->size)); ret...
0
[ "CWE-787" ]
gpac
77510778516803b7f7402d7423c6d6bef50254c3
308,061,162,296,445,850,000,000,000,000,000,000,000
18
fixed #2255
SMBC_get_auth_data(const char *server, const char *share, char *workgroup_buf, int workgroup_buf_len, char *username_buf, int username_buf_len, char *password_buf, int password_buf_len) { /* Default function just uses provided data. Nothing to do. */ }
0
[ "CWE-20" ]
samba
1ba49b8f389eda3414b14410c7fbcb4041ca06b1
130,996,410,557,459,610,000,000,000,000,000,000,000
7
CVE-2015-5296: s3:libsmb: force signing when requiring encryption in SMBC_server_internal() BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
static int exif_process_string(char **result, char *value, size_t byte_count) { /* we cannot use strlcpy - here the problem is that we cannot use strlen to * determin length of string and we cannot use strlcpy with len=byte_count+1 * because then we might get into an EXCEPTION if we exceed an allocated * memory ...
0
[ "CWE-416" ]
php-src
3fdde65617e9f954e2c964768aac8831005497e5
290,525,546,128,785,050,000,000,000,000,000,000,000
14
Fix #76409: heap use after free in _php_stream_free We must not close the stream in exif_read_from_impl(), since it is the responsibility of the (caller's) caller to do so, if it actually opened the stream. We simplify the reproduce script, which is actually about supplying a path to a directory (opposed to a regular...
static int qd_get(struct gfs2_sbd *sdp, int user, u32 id, struct gfs2_quota_data **qdp) { struct gfs2_quota_data *qd = NULL, *new_qd = NULL; int error, found; *qdp = NULL; for (;;) { found = 0; spin_lock(&qd_lru_lock); list_for_each_entry(qd, &sdp->sd_quota_list, qd_list) { if (qd->qd_id == id && ...
0
[ "CWE-399" ]
linux-2.6
7e619bc3e6252dc746f64ac3b486e784822e9533
187,584,560,189,405,330,000,000,000,000,000,000,000
52
GFS2: Fix writing to non-page aligned gfs2_quota structures This is the upstream fix for this bug. This patch differs from the RHEL5 fix (Red Hat bz #555754) which simply writes to the 8-byte value field of the quota. In upstream quota code, we're required to write the entire quota (88 bytes) which can be split across...
static av_cold int truemotion1_decode_end(AVCodecContext *avctx) { TrueMotion1Context *s = avctx->priv_data; av_frame_free(&s->frame); av_free(s->vert_pred); return 0; }
0
[ "CWE-703" ]
FFmpeg
2240e2078d53d3cfce8ff1dda64e58fa72038602
64,527,486,150,481,670,000,000,000,000,000,000,000
9
truemotion1: check the header size Fixes invalid reads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
TEST(QueryProjectionTest, MakeSingleFieldInclusion) { Projection proj(createProjection("{}", "{a: 1}")); ASSERT_FALSE(proj.requiresDocument()); const auto& fields = proj.getRequiredFields(); ASSERT_EQUALS(fields.size(), 2U); ASSERT_EQUALS(fields[0], "_id"); ASSERT_EQUALS(fields[1], "a"); }
0
[ "CWE-732" ]
mongo
cd583b6c4d8aa2364f255992708b9bb54e110cf4
174,910,640,529,259,660,000,000,000,000,000,000,000
8
SERVER-53929 Add stricter parser checks around positional projection
static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC) { if (prev_options != NULL) { *prev_options = MBREX(regex_default_options); } if (prev_syntax != NULL) { *prev_syntax = MBREX(regex_default_syntax); } MBR...
1
[ "CWE-415" ]
php-src
5b597a2e5b28e2d5a52fc1be13f425f08f47cb62
80,663,807,891,815,465,000,000,000,000,000,000,000
11
Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
Value *LReference::emitLoad() { auto &builder = getBuilder(); IRBuilder::ScopedLocationChange slc(builder, loadLoc_); switch (kind_) { case Kind::Empty: assert(false && "empty cannot be loaded"); return builder.getLiteralUndefined(); case Kind::Member: return builder.createLoadPropertyI...
0
[ "CWE-125", "CWE-787" ]
hermes
091835377369c8fd5917d9b87acffa721ad2a168
103,809,888,407,462,410,000,000,000,000,000,000,000
21
Correctly restore whether or not a function is an inner generator Summary: If a generator was large enough to be lazily compiled, we would lose that information when reconstituting the function's context. This meant the function was generated as a regular function instead of a generator. #utd-hermes-ignore-android R...
static void vnc_connect(VncDisplay *vd, int csock, int skipauth) { VncState *vs = g_malloc0(sizeof(VncState)); int i; vs->csock = csock; if (skipauth) { vs->auth = VNC_AUTH_NONE; #ifdef CONFIG_VNC_TLS vs->subauth = VNC_AUTH_INVALID; #endif } else { vs->auth = vd->auth; #ifdef CONFIG_VNC_TLS vs...
0
[ "CWE-125" ]
qemu
9f64916da20eea67121d544698676295bbb105a7
321,506,266,060,035,140,000,000,000,000,000,000,000
64
pixman/vnc: use pixman images in vnc. The vnc code uses *three* DisplaySurfaces: First is the surface of the actual QemuConsole, usually the guest screen, but could also be a text console (monitor/serial reachable via Ctrl-Alt-<nr> keys). This is left as-is. Second is the current server's view of the screen content...
bool dwgReader18::readDwgHeader(DRW_Header& hdr){ DRW_DBG("dwgReader18::readDwgHeader\n"); dwgSectionInfo si = sections[secEnum::HEADER]; if (si.Id<0)//not found, ends return false; bool ret = parseDataPage(si/*, objData*/); //global store for uncompressed data of all pages uncompSize=si...
0
[ "CWE-191" ]
libdxfrw
ba3fa95648bef948e008dfbdd31a4d21badd71f0
35,465,276,584,854,166,000,000,000,000,000,000,000
23
fixed out-of-bounds write vulnerability CVE-2021-21898 as reported in TALOS-2021-1349 / CVE-2021-21898, dwgCompressor::decompress18() could be abused with a malformed DWG file to force out-of-bounds write and possibly lead to malicious code execution.
CImg<T>& _load_analyze(std::FILE *const file, const char *const filename, float *const voxel_size=0) { if (!file && !filename) throw CImgArgumentException(_cimg_instance "load_analyze(): Specified filename is (null).", cimg_instan...
0
[ "CWE-770" ]
cimg
619cb58dd90b4e03ac68286c70ed98acbefd1c90
188,643,034,341,405,400,000,000,000,000,000,000,000
127
CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size.
static void vmx_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_ctrl(vmx)); if (cpu_has_secondary_exec_ctrls()) { if (kvm_vcpu_apicv_active(vcpu)) vmcs_set_bits(SECONDARY_VM_EXEC_CONTROL, SECONDARY_EXEC_A...
0
[ "CWE-20", "CWE-617" ]
linux
3a8b0677fc6180a467e26cc32ce6b0c09a32f9bb
263,303,218,144,585,200,000,000,000,000,000,000,000
19
KVM: VMX: Do not BUG() on out-of-bounds guest IRQ The value of the guest_irq argument to vmx_update_pi_irte() is ultimately coming from a KVM_IRQFD API call. Do not BUG() in vmx_update_pi_irte() if the value is out-of bounds. (Especially, since KVM as a whole seems to hang after that.) Instead, print a message only o...
perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) { if (current_is_64bit()) perf_callchain_user_64(entry, regs); else perf_callchain_user_32(entry, regs); }
0
[ "CWE-399" ]
linux
9a5cbce421a283e6aea3c4007f141735bf9da8c3
112,185,162,508,658,750,000,000,000,000,000,000,000
7
powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH We cap 32bit userspace backtraces to PERF_MAX_STACK_DEPTH (currently 127), but we forgot to do the same for 64bit backtraces. Cc: stable@vger.kernel.org Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.i...
void Gfx::opEndMarkedContent(Object args[], int numArgs) { // pop the stack if (mcStack) popMarkedContent(); out->endMarkedContent(state); }
0
[]
poppler
abf167af8b15e5f3b510275ce619e6fdb42edd40
171,435,376,378,364,660,000,000,000,000,000,000,000
6
Implement tiling/patterns in SplashOutputDev Fixes bug 13518
htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { int ret = 0; htmlParserInputPtr in; int avail = 0; xmlChar cur, next; htmlParserNodeInfo node_info; #ifdef DEBUG_PUSH switch (ctxt->instate) { case XML_PARSER_EOF: xmlGenericError(xmlGenericErrorContext, "HPP: try EOF\n"...
0
[ "CWE-119" ]
libxml2
8fb4a770075628d6441fb17a1e435100e2f3b1a2
192,479,774,996,971,630,000,000,000,000,000,000,000
767
CVE-2015-8242 Buffer overead with HTML parser in push mode For https://bugzilla.gnome.org/show_bug.cgi?id=756372 Error in the code pointing to the codepoint in the stack for the current char value instead of the pointer in the input that the SAX callback expects Reported and fixed by Hugh Davenport
init_mrt_bgp_data(struct bgp_conn *conn, struct mrt_bgp_data *d) { struct bgp_proto *p = conn->bgp; int p_ok = conn->state >= BS_OPENCONFIRM; memset(d, 0, sizeof(struct mrt_bgp_data)); d->peer_as = p->remote_as; d->local_as = p->local_as; d->index = (p->neigh && p->neigh->iface) ? p->neigh->iface->index : ...
0
[ "CWE-787" ]
bird
8388f5a7e14108a1458fea35bfbb5a453e2c563c
202,868,060,970,408,050,000,000,000,000,000,000,000
14
BGP: Fix bugs in handling of shutdown messages There is an improper check for valid message size, which may lead to stack overflow and buffer leaks to log when a large message is received. Thanks to Daniel McCarney for bugreport and analysis.
query (void) { static const GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run-mode", "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw-filename", "The name entered" } }; st...
0
[ "CWE-190" ]
gimp
a9671395f6573e90316a9d748588c5435216f6ce
81,324,497,573,127,170,000,000,000,000,000,000,000
56
PCX: Avoid allocation overflows. Multiplying gint values may overflow unless cast into a larger type.
static int cma_accept_iw(struct rdma_id_private *id_priv, struct rdma_conn_param *conn_param) { struct iw_cm_conn_param iw_param; int ret; if (!conn_param) return -EINVAL; ret = cma_modify_qp_rtr(id_priv, conn_param); if (ret) return ret; iw_param.ord = conn_param->initiator_depth; iw_param.ird = conn...
0
[ "CWE-416" ]
linux
bc0bdc5afaa740d782fbf936aaeebd65e5c2921d
105,484,090,080,866,560,000,000,000,000,000,000,000
24
RDMA/cma: Do not change route.addr.src_addr.ss_family If the state is not idle then rdma_bind_addr() will immediately fail and no change to global state should happen. For instance if the state is already RDMA_CM_LISTEN then this will corrupt the src_addr and would cause the test in cma_cancel_operation(): if (cma...
static int readOHDRHeaderMessageDataLayout(struct READER *reader, struct DATAOBJECT *data) { int i, err; unsigned size; uint8_t dimensionality, layout_class; uint32_t dataset_element_size; uint64_t data_address, store, data_size; UNUSED(dataset_element_size); ...
0
[ "CWE-787" ]
libmysofa
890400ebd092c574707d0c132124f8ff047e20e1
190,997,085,945,808,660,000,000,000,000,000,000,000
112
Fix for issue 163
void br_multicast_init(struct net_bridge *br) { br->hash_elasticity = 4; br->hash_max = 512; br->multicast_router = 1; br->multicast_querier = 0; br->multicast_query_use_ifaddr = 0; br->multicast_last_member_count = 2; br->multicast_startup_query_count = 2; br->multicast_last_member_interval = HZ; br->multic...
0
[ "CWE-20" ]
linux
c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1
82,703,835,166,943,790,000,000,000,000,000,000,000
26
bridge: fix some kernel warning in multicast timer Several people reported the warning: "kernel BUG at kernel/timer.c:729!" and the stack trace is: #7 [ffff880214d25c10] mod_timer+501 at ffffffff8106d905 #8 [ffff880214d25c50] br_multicast_del_pg.isra.20+261 at ffffffffa0731d25 [bridge] #9 [ffff880214d25c80] br_mul...
static ssize_t queue_wb_lat_show(struct request_queue *q, char *page) { if (!wbt_rq_qos(q)) return -EINVAL; return sprintf(page, "%llu\n", div_u64(wbt_get_min_lat(q), 1000)); }
0
[ "CWE-416" ]
linux
c3e2219216c92919a6bd1711f340f5faa98695e6
211,014,598,813,911,370,000,000,000,000,000,000,000
7
block: free sched's request pool in blk_cleanup_queue In theory, IO scheduler belongs to request queue, and the request pool of sched tags belongs to the request queue too. However, the current tags allocation interfaces are re-used for both driver tags and sched tags, and driver tags is definitely host wide, and doe...
dissect_kafka_list_partition_reassignments_request_partition(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, kafka_api_version_t api_version _U_) { proto_tree_add_item(tree, hf_kafka_partition_id, tvb, offset, 4, ENC_BIG_ENDIAN); ...
0
[ "CWE-401" ]
wireshark
f4374967bbf9c12746b8ec3cd54dddada9dd353e
93,576,327,094,673,500,000,000,000,000,000,000,000
8
Kafka: Limit our decompression size. Don't assume that the Internet has our best interests at heart when it gives us the size of our decompression buffer. Assign an arbitrary limit of 50 MB. This fixes #16739 in that it takes care of ** (process:17681): WARNING **: 20:03:07.440: Dissector bug, protocol Kafka, in pac...
int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p) { struct video_device *vdev = video_devdata(file); if (vb2_queue_is_busy(vdev, file)) return -EBUSY; return vb2_dqbuf(vdev->queue, p, file->f_flags & O_NONBLOCK); }
0
[ "CWE-119", "CWE-787" ]
linux
2c1f6951a8a82e6de0d82b1158b5e493fc6c54ab
66,758,901,927,256,410,000,000,000,000,000,000,000
8
[media] videobuf2-v4l2: Verify planes array in buffer dequeueing When a buffer is being dequeued using VIDIOC_DQBUF IOCTL, the exact buffer which will be dequeued is not known until the buffer has been removed from the queue. The number of planes is specific to a buffer, not to the queue. This does lead to the situat...
cockpit_web_response_get_url_root (CockpitWebResponse *self) { return self->url_root; }
0
[ "CWE-1021" ]
cockpit
8d9bc10d8128aae03dfde62fd00075fe492ead10
30,530,778,267,316,916,000,000,000,000,000,000,000
3
common: Restrict frame embedding to same origin Declare `X-Frame-Options: sameorigin` [1] so that cockpit frames can only be embedded into pages coming from the same origin. This is similar to setting CORP in commit 2b38b8de92f9a (which applies to `<script>`, `<img>`, etc.). The main use case for embedding is to run ...
static void ehci_flush_qh(EHCIQueue *q) { uint32_t *qh = (uint32_t *) &q->qh; uint32_t dwords = sizeof(EHCIqh) >> 2; uint32_t addr = NLPTR_GET(q->qhaddr); put_dwords(q->ehci, addr + 3 * sizeof(uint32_t), qh + 3, dwords - 3); }
0
[]
qemu
791f97758e223de3290592d169f8e6339c281714
10,611,113,923,573,765,000,000,000,000,000,000,000
8
usb: ehci: fix memory leak in ehci_init_transfer In ehci_init_transfer function, if the 'cpage' is bigger than 4, it doesn't free the 'p->sgl' once allocated previously thus leading a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Message-id: 5821c0f4.091c6b0a.e0c92.e811@mx.goog...
static bool scsi_cd_is_medium_locked(void *opaque) { return ((SCSIDiskState *)opaque)->tray_locked; }
0
[ "CWE-119", "CWE-787" ]
qemu
103b40f51e4012b3b0ad20f615562a1806d7f49a
25,751,450,332,574,213,000,000,000,000,000,000,000
4
scsi-disk: commonize iovec creation between reads and writes Also, consistently use qiov.size instead of iov.iov_len. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
PJ_DEF(pj_xml_node*) pj_xml_find_node_rec(const pj_xml_node *parent, const pj_str_t *name) { const pj_xml_node *node = parent->node_head.next; PJ_CHECK_STACK(); while (node != (void*)&parent->node_head) { pj_xml_node *found; if (pj_stricmp(&node->name, name) == 0) return (pj_xml_node*)node;...
0
[ "CWE-703", "CWE-835" ]
pjproject
856f87c2e97a27b256482dbe0d748b1194355a21
240,957,694,536,295,000,000,000,000,000,000,000,000
18
Merge pull request from GHSA-5x45-qp78-g4p4 * Prevent infinite loop in scanning xml content * Simplify scanning method * Optimization
static inline void em28xx_set_xclk_i2c_speed(struct em28xx *dev) { const struct em28xx_board *board = &em28xx_boards[dev->model]; u8 xclk = board->xclk, i2c_speed = board->i2c_speed; /* * Those are the default values for the majority of boards * Use those values if not specified otherwise at boards entry */ ...
0
[ "CWE-416" ]
linux
c08eadca1bdfa099e20a32f8fa4b52b2f672236d
107,449,784,172,694,850,000,000,000,000,000,000,000
25
media: em28xx: initialize refcount before kref_get The commit 47677e51e2a4("[media] em28xx: Only deallocate struct em28xx after finishing all extensions") adds kref_get to many init functions (e.g., em28xx_audio_init). However, kref_init is called too late in em28xx_usb_probe, since em28xx_init_dev before will invoke ...
static void sit_route_add(struct net_device *dev) { struct in6_rtmsg rtmsg; memset(&rtmsg, 0, sizeof(rtmsg)); rtmsg.rtmsg_type = RTMSG_NEWROUTE; rtmsg.rtmsg_metric = IP6_RT_PRIO_ADDRCONF; /* prefix length - 96 bits "::d.d.d.d" */ rtmsg.rtmsg_dst_len = 96; rtmsg.rtmsg_flags = RTF_UP|RTF_NONEXTHOP; rtmsg.rtmsg...
0
[ "CWE-200" ]
linux-2.6
8a47077a0b5aa2649751c46e7a27884e6686ccbf
256,270,647,839,703,130,000,000,000,000,000,000,000
16
[NETLINK]: Missing padding fields in dumped structures Plug holes with padding fields and initialized them to zero. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
dir_server_t * trusted_dir_server_new(const char *nickname, const char *address, uint16_t dir_port, uint16_t or_port, const tor_addr_port_t *ipv6_addrport, const char *digest, const char *v3_auth_digest, dirinfo_type_t type, dou...
0
[]
tor
1afc2ed956a35b40dfd1d207652af5b50c295da7
81,275,109,797,540,630,000,000,000,000,000,000,000
40
Fix policies.c instance of the "if (r=(a-b)) return r" pattern I think this one probably can't underflow, since the input ranges are small. But let's not tempt fate. This patch also replaces the "cmp" functions here with just "eq" functions, since nothing actually checked for anything besides 0 and nonzero. Related...
Item_direct_view_ref::derived_grouping_field_transformer_for_where(THD *thd, uchar *arg) { if ((*ref)->marker & SUBSTITUTION_FL) { this->marker|= SUBSTITUTION_FL; return this; } if (!item_equal) return this; st_select_lex *sel= (st...
0
[ "CWE-416" ]
server
c02ebf3510850ba78a106be9974c94c3b97d8585
332,458,714,289,055,720,000,000,000,000,000,000,000
14
MDEV-24176 Preparations 1. moved fix_vcol_exprs() call to open_table() mysql_alter_table() doesn't do lock_tables() so it cannot win from fix_vcol_exprs() from there. Tests affected: main.default_session 2. Vanilla cleanups and comments.
CImg<ulongT> get_histogram(const unsigned int nb_levels, const T& min_value, const T& max_value) const { if (!nb_levels || is_empty()) return CImg<ulongT>(); const double vmin = (double)(min_value<max_value?min_value:max_value), vmax = (double)(min_value<max_value?max_value:min_value); ...
0
[ "CWE-770" ]
cimg
619cb58dd90b4e03ac68286c70ed98acbefd1c90
73,122,210,655,419,160,000,000,000,000,000,000,000
12
CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size.
static inline unsigned dx_node_limit(struct inode *dir) { unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(0); if (ext4_has_metadata_csum(dir->i_sb)) entry_space -= sizeof(struct dx_tail); return entry_space / sizeof(struct dx_entry); }
0
[ "CWE-125" ]
linux
5872331b3d91820e14716632ebb56b1399b34fe1
29,474,440,205,492,490,000,000,000,000,000,000,000
8
ext4: fix potential negative array index in do_split() If for any reason a directory passed to do_split() does not have enough active entries to exceed half the size of the block, we can end up iterating over all "count" entries without finding a split point. In this case, count == move, and split will be zero, and w...
static int parse_strtoul(const char *buf, unsigned long max, unsigned long *value) { char *endp; *value = simple_strtoul(skip_spaces(buf), &endp, 0); endp = skip_spaces(endp); if (*endp || *value > max) return -EINVAL; return 0; }
0
[ "CWE-703" ]
linux
744692dc059845b2a3022119871846e74d4f6e11
47,795,312,774,981,750,000,000,000,000,000,000,000
12
ext4: use ext4_get_block_write in buffer write Allocate uninitialized extent before ext4 buffer write and convert the extent to initialized after io completes. The purpose is to make sure an extent can only be marked initialized after it has been written with new data so we can safely drop the i_mutex lock in ext4 DIO...
MagickExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler handler) { FatalErrorHandler previous_handler; previous_handler=fatal_error_handler; fatal_error_handler=handler; return(previous_handler); }
0
[ "CWE-120", "CWE-787" ]
ImageMagick
e45e48b881038487d0bc94d92a16c1537616cc0a
172,510,490,717,054,870,000,000,000,000,000,000,000
9
Suspend exception processing if too many exceptions
static struct nft_rule **nf_tables_chain_alloc_rules(const struct nft_chain *chain, unsigned int alloc) { if (alloc > INT_MAX) return NULL; alloc += 1; /* NULL, ends rules */ if (sizeof(struct nft_rule *) > INT_MAX / alloc) return NULL; alloc *= sizeof(struct nft_rule *); alloc += sizeof(struct nf...
0
[ "CWE-665" ]
linux
ad9f151e560b016b6ad3280b48e42fa11e1a5440
170,194,615,561,717,000,000,000,000,000,000,000,000
15
netfilter: nf_tables: initialize set before expression setup nft_set_elem_expr_alloc() needs an initialized set if expression sets on the NFT_EXPR_GC flag. Move set fields initialization before expression setup. [4512935.019450] ================================================================== [4512935.019456] BUG: ...
gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream, GstBuffer * buf, GstClockTime dts, GstClockTime pts, GstClockTime duration, gboolean keyframe, GstClockTime position, guint64 byte_position) { GstFlowReturn ret = GST_FLOW_OK; /* offset the timestamps according to the e...
0
[ "CWE-125" ]
gst-plugins-good
d0949baf3dadea6021d54abef6802fed5a06af75
301,537,987,120,341,480,000,000,000,000,000,000,000
172
qtdemux: Fix out of bounds read in tag parsing code We can't simply assume that the length of the tag value as given inside the stream is correct but should also check against the amount of data we have actually available. https://bugzilla.gnome.org/show_bug.cgi?id=775451
shift_block(oparg_T *oap, int amount) { int left = (oap->op_type == OP_LSHIFT); int oldstate = State; int total; char_u *newp, *oldp; int oldcol = curwin->w_cursor.col; int sw_val = (int)get_sw_value_indent(curbuf); int ts_val = (int)curbuf->b_p_ts; struct block_def bd; ...
0
[ "CWE-122" ]
vim
c249913edc35c0e666d783bfc21595cf9f7d9e0d
28,120,712,346,503,260,000,000,000,000,000,000,000
210
patch 9.0.0483: illegal memory access when replacing in virtualedit mode Problem: Illegal memory access when replacing in virtualedit mode. Solution: Check for replacing NUL after Tab.
TEST(ArrayOpsTest, BroadcastGradientArgs_ShapeFn) { ShapeInferenceTestOp op("BroadcastGradientArgs"); // Output is always two unknown vectors. INFER_OK(op, "?;?", "[?];[?]"); INFER_OK(op, "[123];[456]", "[?];[?]"); // Rank checks INFER_ERROR("Shape must be rank 1 but is rank 0", op, "[];?"); INFER_ERROR(...
0
[ "CWE-125" ]
tensorflow
7cf73a2274732c9d82af51c2bc2cf90d13cd7e6d
1,019,672,432,291,540,400,000,000,000,000,000,000
10
Address QuantizeAndDequantizeV* heap oob. Added additional checks for the 'axis' attribute. PiperOrigin-RevId: 402446942 Change-Id: Id2f6b82e4e740d0550329be02621c46466b5a5b9
static void php_zip_free_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC) { zip_read_rsrc *zr_rsrc = (zip_read_rsrc *) rsrc->ptr; if (zr_rsrc) { if (zr_rsrc->zf) { if (zr_rsrc->zf->za) { zip_fclose(zr_rsrc->zf); } else { if (zr_rsrc->zf->src) zip_source_free(zr_rsrc->zf->src); free(zr_rsrc->zf); ...
0
[ "CWE-22" ]
php-src
f9c2bf73adb2ede0a486b0db466c264f2b27e0bb
243,668,874,177,534,500,000,000,000,000,000,000,000
19
Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
Py_SymtableStringObject(const char *str, PyObject *filename, int start) { struct symtable *st; mod_ty mod; PyCompilerFlags flags; PyArena *arena; arena = PyArena_New(); if (arena == NULL) return NULL; flags.cf_flags = 0; mod = PyParser_ASTFromStringObject(str, filename, start, ...
0
[ "CWE-125" ]
cpython
dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c
190,509,526,127,276,700,000,000,000,000,000,000,000
21
bpo-35766: Merge typed_ast back into CPython (GH-11645)
nat_select_range_tuple(struct conntrack *ct, const struct conn *conn, struct conn *nat_conn) { enum { MIN_NAT_EPHEMERAL_PORT = 1024, MAX_NAT_EPHEMERAL_PORT = 65535 }; uint16_t min_port; uint16_t max_port; uint16_t first_port; uint32_t hash = nat_range_hash(conn, ct...
0
[ "CWE-400" ]
ovs
79349cbab0b2a755140eedb91833ad2760520a83
75,403,208,288,561,910,000,000,000,000,000,000,000
124
flow: Support extra padding length. Although not required, padding can be optionally added until the packet length is MTU bytes. A packet with extra padding currently fails sanity checks. Vulnerability: CVE-2020-35498 Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.") Reported-by: Joakim Hind...
static void blk_aio_attached(AioContext *ctx, void *opaque) { NBDExport *exp = opaque; NBDClient *client; TRACE("Export %s: Attaching clients to AIO context %p\n", exp->name, ctx); exp->ctx = ctx; QTAILQ_FOREACH(client, &exp->clients, next) { qio_channel_attach_aio_context(client->ioc, ct...
0
[ "CWE-20" ]
qemu
2b0bbc4f8809c972bad134bc1a2570dbb01dea0b
270,379,237,744,734,800,000,000,000,000,000,000,000
19
nbd/server: get rid of nbd_negotiate_read and friends Functions nbd_negotiate_{read,write,drop_sync} were introduced in 1a6245a5b, when nbd_rwv (was nbd_wr_sync) was working through qemu_co_sendv_recvv (the path is nbd_wr_sync -> qemu_co_{recv/send} -> qemu_co_send_recv -> qemu_co_sendv_recvv), which just yields, with...
StatementCancelHandler(SIGNAL_ARGS) { int save_errno = errno; /* * Don't joggle the elbow of proc_exit */ if (!proc_exit_inprogress) { InterruptPending = true; QueryCancelPending = true; /* * If it's safe to interrupt, and we're waiting for input or a lock, * service the interrupt immediately ...
1
[ "CWE-89" ]
postgres
2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b
271,833,847,094,514,720,000,000,000,000,000,000,000
35
Be more careful to not lose sync in the FE/BE protocol. If any error occurred while we were in the middle of reading a protocol message from the client, we could lose sync, and incorrectly try to interpret a part of another message as a new protocol message. That will usually lead to an "invalid frontend message" erro...
int iwch_create_listen(struct iw_cm_id *cm_id, int backlog) { int err = 0; struct iwch_dev *h = to_iwch_dev(cm_id->device); struct iwch_listen_ep *ep; might_sleep(); if (cm_id->local_addr.ss_family != PF_INET) { err = -ENOSYS; goto fail1; } ep = alloc_ep(sizeof(*ep), GFP_KERNEL); if (!ep) { printk(KER...
0
[ "CWE-703" ]
linux
67f1aee6f45059fd6b0f5b0ecb2c97ad0451f6b3
45,460,038,380,882,700,000,000,000,000,000,000,000
59
iw_cxgb3: Fix incorrectly returning error on success The cxgb3_*_send() functions return NET_XMIT_ values, which are positive integers values. So don't treat positive return values as an error. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off...
//! Convert pixel values from sRGB to RGB color spaces. CImg<T>& sRGBtoRGB() { if (is_empty()) return *this; cimg_pragma_openmp(parallel for cimg_openmp_if(size()>=32)) cimg_rof(*this,ptr,T) { const Tfloat sval = (Tfloat)*ptr/255, val = (Tfloat)(sval<=0.04045f?sval/...
0
[ "CWE-125" ]
CImg
10af1e8c1ad2a58a0a3342a856bae63e8f257abb
31,080,176,149,371,886,000,000,000,000,000,000,000
11
Fix other issues in 'CImg<T>::load_bmp()'.
f_getbufvar(typval_T *argvars, typval_T *rettv) { buf_T *buf; buf_T *save_curbuf; char_u *varname; dictitem_T *v; int done = FALSE; (void)tv_get_number(&argvars[0]); /* issue errmsg if type error */ varname = tv_get_string_chk(&argvars[1]); ++emsg_off; buf = tv_get_buf(&argvars...
0
[ "CWE-78" ]
vim
8c62a08faf89663e5633dc5036cd8695c80f1075
308,950,478,648,360,540,000,000,000,000,000,000,000
62
patch 8.1.0881: can execute shell commands in rvim through interfaces Problem: Can execute shell commands in rvim through interfaces. Solution: Disable using interfaces in restricted mode. Allow for writing file with writefile(), histadd() and a few others.
static inline void fr_log_dlci_active(pvc_device *pvc) { netdev_info(pvc->frad, "DLCI %d [%s%s%s]%s %s\n", pvc->dlci, pvc->main ? pvc->main->name : "", pvc->main && pvc->ether ? " " : "", pvc->ether ? pvc->ether->name : "", pvc->state.new ? " new" : "", !pvc->state.exist ? "deleted"...
0
[ "CWE-703", "CWE-264" ]
linux
550fd08c2cebad61c548def135f67aba284c6162
280,620,273,355,412,660,000,000,000,000,000,000,000
11
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There...
void html_fileperm(unsigned short mode) { htmlf("%c%c%c", (mode & 4 ? 'r' : '-'), (mode & 2 ? 'w' : '-'), (mode & 1 ? 'x' : '-')); }
0
[]
cgit
513b3863d999f91b47d7e9f26710390db55f9463
338,081,384,517,873,800,000,000,000,000,000,000,000
5
ui-shared: prevent malicious filename from injecting headers
static int sit_init_net(struct net *net) { int err; struct sit_net *sitn; err = -ENOMEM; sitn = kzalloc(sizeof(struct sit_net), GFP_KERNEL); if (sitn == NULL) goto err_alloc; err = net_assign_generic(net, sit_net_id, sitn); if (err < 0) goto err_assign; sitn->tunnels[0] = sitn->tunnels_wc; sitn->tunnels...
0
[ "CWE-399" ]
linux-2.6
36ca34cc3b8335eb1fe8bd9a1d0a2592980c3f02
151,070,208,260,796,560,000,000,000,000,000,000,000
43
sit: Add missing kfree_skb() on pskb_may_pull() failure. Noticed by Paul Marks <paul@pmarks.net>. Signed-off-by: David S. Miller <davem@davemloft.net>
static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, const MagickSizeType number_pixels,const unsigned char *magick_restrict p, Quantum *magick_restrict q,ExceptionInfo *exception) { QuantumAny range; register ssize_t x; unsigned int pixel; if (image->colorspace != CMY...
0
[ "CWE-125" ]
ImageMagick
430403b0029b37decf216d57f810899cab2317dd
206,290,204,739,962,140,000,000,000,000,000,000,000
180
https://github.com/ImageMagick/ImageMagick/issues/126
TEST_F(QueryPlannerTest, ContainedOrMultikeyCannotCombineTrailingFields) { const bool multikey = true; addIndex(BSON("b" << 1 << "a" << 1), multikey); addIndex(BSON("c" << 1)); runQuery( fromjson("{$and: [{a: {$gte: 0}}, {$or: [{$and: [{a: {$lte: 10}}, {b: 6}]}, {c: 7}]}]}")); assertNumSolu...
0
[]
mongo
ee97c0699fd55b498310996ee002328e533681a3
234,746,786,509,050,300,000,000,000,000,000,000,000
24
SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr.
control_pcsc_direct (int slot, pcsc_dword_t ioctl_code, const unsigned char *cntlbuf, size_t len, unsigned char *buffer, pcsc_dword_t *buflen) { long err; err = pcsc_control (reader_table[slot].pcsc.card, ioctl_code, cntlbuf, len, buffer, *buflen, buf...
0
[ "CWE-20" ]
gnupg
2183683bd633818dd031b090b5530951de76f392
49,623,484,570,375,960,000,000,000,000,000,000,000
17
Use inline functions to convert buffer data to scalars. * common/host2net.h (buf16_to_ulong, buf16_to_uint): New. (buf16_to_ushort, buf16_to_u16): New. (buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New. -- Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to avoid all sign extension on ...
static int fionbio(struct file *file, int __user *p) { int nonblock; if (get_user(nonblock, p)) return -EFAULT; spin_lock(&file->f_lock); if (nonblock) file->f_flags |= O_NONBLOCK; else file->f_flags &= ~O_NONBLOCK; spin_unlock(&file->f_lock); return 0; }
0
[ "CWE-200", "CWE-362" ]
linux
5c17c861a357e9458001f021a7afa7aab9937439
246,682,700,849,484,920,000,000,000,000,000,000,000
15
tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) ioctl(TIOCGETD) retrieves the line discipline id directly from the ldisc because the line discipline id (c_line) in termios is untrustworthy; userspace may have set termios via ioctl(TCSETS*) without actually changing the line discipline via ioctl(TIOCSETD). However...
static int fuse_write_end(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata) { struct inode *inode = mapping->host; int res = 0; if (copied) res = fuse_buffered_write(file, inode, pos, copied, page); unlock_page(page); page_cache_...
0
[]
linux-2.6
0bd87182d3ab18a32a8e9175d3f68754c58e3432
136,190,564,248,775,300,000,000,000,000,000,000,000
14
fuse: fix kunmap in fuse_ioctl_copy_user Looks like another victim of the confusing kmap() vs kmap_atomic() API differences. Reported-by: Todor Gyumyushev <yodor1@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Tejun Heo <tj@kernel.org> Cc: stable@kern...
void show_regs(struct pt_regs *regs) { bool all = true; show_regs_print_info(KERN_DEFAULT); if (IS_ENABLED(CONFIG_X86_32)) all = !user_mode(regs); __show_regs(regs, all); /* * When in-kernel, we also print out the stack at the time of the fault.. */ if (!user_mode(regs)) show_trace_log_lvl(current, re...
0
[ "CWE-20" ]
linux
342db04ae71273322f0011384a9ed414df8bdae4
56,296,978,823,797,580,000,000,000,000,000,000,000
17
x86/dumpstack: Don't dump kernel memory based on usermode RIP show_opcodes() is used both for dumping kernel instructions and for dumping user instructions. If userspace causes #PF by jumping to a kernel address, show_opcodes() can be reached with regs->ip controlled by the user, pointing to kernel code. Make sure th...
static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) { struct inode *inode = file->f_path.dentry->d_inode; struct fuse_conn *fc = get_fuse_conn(inode); int err; if (cmd == F_CANCELLK) { err = 0; } else if (cmd == F_GETLK) { if (fc->no_lock) { posix_test_lock(file, fl); err = 0; ...
0
[]
linux-2.6
0bd87182d3ab18a32a8e9175d3f68754c58e3432
144,307,515,341,746,400,000,000,000,000,000,000,000
22
fuse: fix kunmap in fuse_ioctl_copy_user Looks like another victim of the confusing kmap() vs kmap_atomic() API differences. Reported-by: Todor Gyumyushev <yodor1@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Tejun Heo <tj@kernel.org> Cc: stable@kern...
static void fuse_readpages_end(struct fuse_mount *fm, struct fuse_args *args, int err) { int i; struct fuse_io_args *ia = container_of(args, typeof(*ia), ap.args); struct fuse_args_pages *ap = &ia->ap; size_t count = ia->read.in.size; size_t num_read = args->out_args[0].size; struct address_space *mappi...
0
[ "CWE-459" ]
linux
5d069dbe8aaf2a197142558b6fb2978189ba3454
117,201,947,098,606,190,000,000,000,000,000,000,000
40
fuse: fix bad inode Jan Kara's analysis of the syzbot report (edited): The reproducer opens a directory on FUSE filesystem, it then attaches dnotify mark to the open directory. After that a fuse_do_getattr() call finds that attributes returned by the server are inconsistent, and calls make_bad_inode() which,...
int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct cgroup_fs_context *ctx = cgroup_fc2context(fc); struct cgroup_subsys *ss; struct fs_parse_result result; int opt, i; opt = fs_parse(fc, cgroup1_fs_parameters, param, &result); if (opt == -ENOPARAM) { if (strcmp(param->key, "sou...
0
[ "CWE-416" ]
linux
3b0462726e7ef281c35a7a4ae33e93ee2bc9975b
314,697,375,930,791,380,000,000,000,000,000,000,000
86
cgroup: verify that source is a string The following sequence can be used to trigger a UAF: int fscontext_fd = fsopen("cgroup"); int fd_null = open("/dev/null, O_RDONLY); int fsconfig(fscontext_fd, FSCONFIG_SET_FD, "source", fd_null); close_range(3, ~0U, 0); The cgroup v1 specific fs parser expects a...
static inline struct sk_buff *ath6kl_wmi_get_new_buf(u32 size) { struct sk_buff *skb; skb = ath6kl_buf_alloc(size); if (!skb) return NULL; skb_put(skb, size); if (size) memset(skb->data, 0, size); return skb; }
0
[ "CWE-125" ]
linux
5d6751eaff672ea77642e74e92e6c0ac7f9709ab
122,084,402,596,805,970,000,000,000,000,000,000,000
14
ath6kl: add some bounds checking The "ev->traffic_class" and "reply->ac" variables come from the network and they're used as an offset into the wmi->stream_exist_for_ac[] array. Those variables are u8 so they can be 0-255 but the stream_exist_for_ac[] array only has WMM_NUM_AC (4) elements. We need to add a couple bo...
int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, struct vm_area_struct *vma) { struct page *src_page; pmd_t pmd; pgtable_t pgtable; int ret; ret = -ENOMEM; pgtable = pte_alloc_one(dst_mm, addr); if (unlikely(!pgtable)) goto out; ...
0
[ "CWE-399" ]
linux
78f11a255749d09025f54d4e2df4fbcb031530e2
154,106,493,261,843,760,000,000,000,000,000,000,000
50
mm: thp: fix /dev/zero MAP_PRIVATE and vm_flags cleanups The huge_memory.c THP page fault was allowed to run if vm_ops was null (which would succeed for /dev/zero MAP_PRIVATE, as the f_op->mmap wouldn't setup a special vma->vm_ops and it would fallback to regular anonymous memory) but other THP logics weren't fully ac...
struct timespec64 *ts, enum hrtimer_mode mode) __must_hold(&ctx->timeout_lock) { struct io_timeout_data *io; struct io_kiocb *req; bool found = false; list_for_each_entry(req, &ctx->ltimeout_list, timeout.list) { found = user_data == req->user_data; if (found) break; } if (!found) return -ENOEN...
0
[ "CWE-416" ]
linux
e677edbcabee849bfdd43f1602bccbecf736a646
96,066,128,689,743,900,000,000,000,000,000,000,000
22
io_uring: fix race between timeout flush and removal io_flush_timeouts() assumes the timeout isn't in progress of triggering or being removed/canceled, so it unconditionally removes it from the timeout list and attempts to cancel it. Leave it on the list and let the normal timeout cancelation take care of it. Cc: st...
static int ieee802154_create(struct net *net, struct socket *sock, int protocol, int kern) { struct sock *sk; int rc; struct proto *proto; const struct proto_ops *ops; if (!net_eq(net, &init_net)) return -EAFNOSUPPORT; switch (sock->type) { case SOCK_RAW: proto = &ieee802154_raw_prot; ops = &ieee...
1
[ "CWE-276" ]
linux
e69dbd4619e7674c1679cba49afd9dd9ac347eef
306,851,075,307,384,720,000,000,000,000,000,000,000
56
ieee802154: enforce CAP_NET_RAW for raw sockets When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron <orinimron123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> Signed-off-by: David S...
static void reset_mpidr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) { u64 mpidr; /* * Map the vcpu_id into the first three affinity level fields of * the MPIDR. We limit the number of VCPUs in level 0 due to a * limitation to 16 CPUs in that level in the ICC_SGIxR registers * of the GICv3 to be able...
0
[ "CWE-20", "CWE-617" ]
linux
9e3f7a29694049edd728e2400ab57ad7553e5aa9
317,510,762,421,518,940,000,000,000,000,000,000,000
16
arm64: KVM: pmu: Fix AArch32 cycle counter access We're missing the handling code for the cycle counter accessed from a 32bit guest, leading to unexpected results. Cc: stable@vger.kernel.org # 4.6+ Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
fep_client_get_poll_fd (FepClient *client) { return client->control; }
0
[ "CWE-264" ]
libfep
293d9d3f7565f01a9dc40b53259886832eaa2ace
163,013,384,541,901,960,000,000,000,000,000,000,000
4
Don't use abstract Unix domain sockets
CAMLprim value caml_blit_string(value s1, value ofs1, value s2, value ofs2, value n) { memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Int_val(n)); return Val_unit; }
1
[ "CWE-200" ]
ocaml
659615c7b100a89eafe6253e7a5b9d84d0e8df74
164,266,491,247,580,050,000,000,000,000,000,000,000
6
fix PR#7003 and a few other bugs caused by misuse of Int_val git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16525 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
ReadSupportedSecurityType(rfbClient* client, uint32_t *result, rfbBool subAuth) { uint8_t count=0; uint8_t loop=0; uint8_t flag=0; uint8_t tAuth[256]; char buf1[500],buf2[10]; uint32_t authScheme; if (!ReadFromRFBServer(client, (char *)&count, 1)) return FALSE; if (count==0) { ...
0
[ "CWE-20" ]
libvncserver
85a778c0e45e87e35ee7199f1f25020648e8b812
114,240,028,262,915,730,000,000,000,000,000,000,000
75
Check for MallocFrameBuffer() return value If MallocFrameBuffer() returns FALSE, frame buffer pointer is left to NULL. Subsequent writes into that buffer could lead to memory corruption, or even arbitrary code execution.
const bool is_rgb=true) const { return _save_yuv(file,0,chroma_subsampling,is_rgb); } const CImgList<T>& _save_yuv(std::FILE *const file, const char *const filename, const unsigned int chroma_subsampling, co...
0
[ "CWE-119", "CWE-787" ]
CImg
ac8003393569aba51048c9d67e1491559877b1d1
213,283,029,883,219,850,000,000,000,000,000,000,000
45
.
u32 gf_m2ts_pes_get_framing_mode(GF_M2TS_PES *pes) { if (pes->flags & GF_M2TS_ES_IS_SECTION) { if (pes->flags & GF_M2TS_ES_IS_SL) { if ( ((GF_M2TS_SECTION_ES *)pes)->sec->process_section == NULL) return GF_M2TS_PES_FRAMING_DEFAULT; } return GF_M2TS_PES_FRAMING_SKIP_NO_RESET; } if (!pes->reframe ) retu...
0
[ "CWE-416", "CWE-125" ]
gpac
1ab4860609f2e7a35634930571e7d0531297e090
108,032,962,631,189,570,000,000,000,000,000,000,000
16
fixed potential crash on PMT IOD parse - cf #1268 #1269
gboolean menu_cache_item_unref(MenuCacheItem* item) { /* DEBUG("item_unref(%s): %d", item->id, item->n_ref); */ /* We need a lock here unfortunately since another thread may have access to it via some child->parent which isn't protected by reference */ MENU_CACHE_LOCK; /* lock may be recursive here *...
0
[ "CWE-20" ]
menu-cache
56f66684592abf257c4004e6e1fff041c64a12ce
84,019,388,621,013,720,000,000,000,000,000,000,000
55
Fix potential access violation, use runtime user dir instead of tmp dir. Note: it limits libmenu-cache compatibility to menu-cached >= 0.7.0.
evdev_device_has_switch(struct evdev_device *device, enum libinput_switch sw) { unsigned int code; if (!(device->seat_caps & EVDEV_DEVICE_SWITCH)) return -1; switch (sw) { case LIBINPUT_SWITCH_LID: code = SW_LID; break; case LIBINPUT_SWITCH_TABLET_MODE: code = SW_TABLET_MODE; break; default: retu...
0
[ "CWE-134" ]
libinput
a423d7d3269dc32a87384f79e29bb5ac021c83d1
269,324,848,723,353,460,000,000,000,000,000,000,000
21
evdev: strip the device name of format directives This fixes a format string vulnerabilty. evdev_log_message() composes a format string consisting of a fixed prefix (including the rendered device name) and the passed-in format buffer. This format string is then passed with the arguments to the actual log handler, whi...
static void write_bulk_callback(struct urb *urb) { pegasus_t *pegasus = urb->context; struct net_device *net; int status = urb->status; if (!pegasus) return; net = pegasus->net; if (!netif_device_present(net) || !netif_running(net)) return; switch (status) { case -EPIPE: /* FIXME schedule_work() to cl...
0
[ "CWE-119", "CWE-284" ]
linux
5593523f968bc86d42a035c6df47d5e0979b5ace
16,538,916,081,618,806,000,000,000,000,000,000,000
35
pegasus: Use heap buffers for all register access Allocating USB buffers on the stack is not portable, and no longer works on x86_64 (with VMAP_STACK enabled as per default). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") References: https://bugs.debian.org/852556 Reported-by: Lisandro Damián Nicanor Pérez Meyer <lisandro@...