func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
gss_seal(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
int qop_req,
gss_buffer_t input_message_buffer,
int *conf_state,
gss_buffer_t output_message_buffer)
{
return gss_wrap(minor_status, context_handle,
conf_req_f... | 0 | [
"CWE-415"
] | krb5 | 56f7b1bc95a2a3eeb420e069e7655fb181ade5cf | 246,540,447,637,907,840,000,000,000,000,000,000,000 | 14 | Preserve GSS context on init/accept failure
After gss_init_sec_context() or gss_accept_sec_context() has created a
context, don't delete the mechglue context on failures from subsequent
calls, even if the mechanism deletes the mech-specific context (which
is allowed by RFC 2744 but not preferred). Check for union con... |
InsertChar(n)
int n;
{
register int y = curr->w_y, x = curr->w_x;
if (n <= 0)
return;
if (x == cols)
x--;
save_mline(&curr->w_mlines[y], cols);
MScrollH(curr, -n, y, x, curr->w_width - 1, CURR_BCE);
LScrollH(&curr->w_layer, -n, y, x, curr->w_width - 1, CURR_BCE, &mline_old);
LGotoPos(&curr->w_lay... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 194,268,923,584,119,070,000,000,000,000,000,000,000 | 14 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
LIST *mutt_add_list (LIST *head, const char *data)
{
size_t len = mutt_strlen (data);
return mutt_add_list_n (head, data, len ? len + 1 : 0);
} | 0 | [
"CWE-668"
] | mutt | 6d0624411a979e2e1d76af4dd97d03f47679ea4a | 232,103,516,052,430,100,000,000,000,000,000,000,000 | 6 | use a 64-bit random value in temporary filenames.
closes #3158 |
vq_endchains(struct virtio_vq_info *vq, int used_all_avail)
{
struct virtio_base *base;
uint16_t event_idx, new_idx, old_idx;
int intr;
if (!vq || !vq->used)
return;
/*
* Interrupt generation: if we're using EVENT_IDX,
* interrupt if we've crossed the event threshold.
* Otherwise interrupt is generated i... | 0 | [
"CWE-476"
] | acrn-hypervisor | 154fe59531c12b82e26d1b24b5531f5066d224f5 | 116,982,534,787,850,070,000,000,000,000,000,000,000 | 42 | dm: validate inputs in vq_endchains
inputs shall be validated to avoid NULL pointer access.
Tracked-On: #6129
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> |
BSONObj spec() {
return BSON("$and" << BSONArray());
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 280,572,134,107,344,370,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
grub_crypto_gcry_error (gcry_err_code_t in)
{
if (in == GPG_ERR_NO_ERROR)
return GRUB_ERR_NONE;
return GRUB_ACCESS_DENIED;
} | 0 | [
"CWE-264"
] | grub | 451d80e52d851432e109771bb8febafca7a5f1f2 | 125,116,955,853,773,370,000,000,000,000,000,000,000 | 6 | Fix security issue when reading username and password
This patch fixes two integer underflows at:
* grub-core/lib/crypto.c
* grub-core/normal/auth.c
CVE-2015-8370
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
Also-By: Andrey Borzenkov <arvidjaar@... |
PackLinuxElf64::check_pt_load(Elf64_Phdr const *const phdr)
{
u64_t filesz = get_te64(&phdr->p_filesz);
u64_t offset = get_te64(&phdr->p_offset), offend = filesz + offset;
u64_t vaddr = get_te64(&phdr->p_vaddr);
u64_t paddr = get_te64(&phdr->p_paddr);
u64_t align = get_te64(&phdr->p_align);
... | 0 | [
"CWE-476",
"CWE-190"
] | upx | 8be9da8280dfa69d5df4417d4d81bda1cab78010 | 303,205,781,478,698,880,000,000,000,000,000,000,000 | 18 | Avoid bogus values in PT_DYNAMIC segment.
Detect duplicate DT_*.
Detect out-of-bounds hashtab and gashtab.
Detect missing DT_REL, DT_RELA.
Detect out-of-bounds d_val.
https://github.com/upx/upx/issues/317
modified: p_lx_elf.cpp |
sf_flac_enc_seek_callback (const FLAC__StreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data)
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
if (psf->error)
return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR ;
return FLAC__STREAM_ENCO... | 0 | [
"CWE-119",
"CWE-369"
] | libsndfile | 60b234301adf258786d8b90be5c1d437fc8799e0 | 31,661,256,445,122,364,000,000,000,000,000,000,000 | 9 | src/flac.c: Improve error handling
Especially when dealing with corrupt or malicious files. |
static void _free_event(struct perf_event *event)
{
irq_work_sync(&event->pending);
unaccount_event(event);
if (event->rb) {
/*
* Can happen when we close an event with re-directed output.
*
* Since we have a 0 refcount, perf_mmap_close() will skip
* over us; possibly making our ring_buffer_put() the... | 0 | [
"CWE-362",
"CWE-125"
] | linux | 321027c1fe77f892f4ea07846aeae08cefbbb290 | 324,455,296,820,188,540,000,000,000,000,000,000,000 | 41 | perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race
Di Shen reported a race between two concurrent sys_perf_event_open()
calls where both try and move the same pre-existing software group
into a hardware context.
The problem is exactly that described in commit:
f63a8daa5812 ("perf: Fix event->ctx... |
stack_param_list_read(stack_param_list * plist, ref_stack_t * pstack,
uint skip, const ref * ppolicies, bool require_all,
gs_ref_memory_t *imem)
{
iparam_list *const iplist = (iparam_list *) plist;
uint count = ref_stack_counttomark(pstack);
if (count == 0)
... | 0 | [] | ghostpdl | bfa6b2ecbe48edc69a7d9d22a12419aed25960b8 | 211,917,295,568,244,600,000,000,000,000,000,000,000 | 18 | Bug 697548: use the correct param list enumerator
When we encountered dictionary in a ref_param_list, we were using the enumerator
for the "parent" param_list, rather than the enumerator for the param_list
we just created for the dictionary. That parent was usually the stack
list enumerator, and caused a segfault.
Us... |
static errno_t sssctl_backup(bool force)
{
const char *files[] = {SSS_BACKUP_USER_OVERRIDES,
SSS_BACKUP_GROUP_OVERRIDES,
NULL};
enum sssctl_prompt_result prompt;
errno_t ret;
ret = sssctl_create_backup_dir(SSS_BACKUP_DIR);
if (ret != EOK) {
... | 0 | [
"CWE-78"
] | sssd | 7ab83f97e1cbefb78ece17232185bdd2985f0bbe | 83,092,739,791,554,050,000,000,000,000,000,000,000 | 45 | TOOLS: replace system() with execvp() to avoid execution of user supplied command
:relnote: A flaw was found in SSSD, where the sssctl command was
vulnerable to shell command injection via the logs-fetch and
cache-expire subcommands. This flaw allows an attacker to trick
the root user into running a specially crafted ... |
ConnStateData::pinConnection(const Comm::ConnectionPointer &pinServer, const HttpRequest &request)
{
if (Comm::IsConnOpen(pinning.serverConnection) &&
pinning.serverConnection->fd == pinServer->fd) {
debugs(33, 3, "already pinned" << pinServer);
return;
}
unpinConnection(true); ... | 0 | [
"CWE-444"
] | squid | fd68382860633aca92065e6c343cfd1b12b126e7 | 34,945,357,638,159,460,000,000,000,000,000,000,000 | 41 | Improve Transfer-Encoding handling (#702)
Reject messages containing Transfer-Encoding header with coding other
than chunked or identity. Squid does not support other codings.
For simplicity and security sake, also reject messages where
Transfer-Encoding contains unnecessary complex values that are
technically equiva... |
_g_uri_remove_host (const char *uri)
{
const char *idx, *sep;
if (uri == NULL)
return NULL;
idx = strstr (uri, "://");
if (idx == NULL)
return uri;
idx += 3;
if (*idx == '\0')
return "/";
sep = strstr (idx, "/");
... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 338,165,351,199,177,900,000,000,000,000,000,000,000 | 18 | libarchive: sanitize filenames before extracting |
int main() {
AspellConfig * spell_config = new_aspell_config();
aspell_config_replace(spell_config, "master", "en_US-w_accents");
aspell_config_replace(spell_config, "encoding", "ucs-2");
AspellCanHaveError * possible_err = new_aspell_speller(spell_config);
AspellSpeller * spell_checker = 0;
if (aspell_erro... | 0 | [
"CWE-125"
] | aspell | de29341638833ba7717bd6b5e6850998454b044b | 214,920,477,860,048,730,000,000,000,000,000,000,000 | 56 | Don't allow null-terminated UCS-2/4 strings using the original API.
Detect if the encoding is UCS-2/4 and the length is -1 in affected API
functions and refuse to convert the string. If the string ends up
being converted somehow, abort with an error message in DecodeDirect
and ConvDirect. To convert a null terminate... |
TEST_F(HttpConnectionManagerImplTest, RequestTimeoutIsDisarmedOnCompleteRequestWithData) {
request_timeout_ = std::chrono::milliseconds(10);
setup(false, "");
EXPECT_CALL(*codec_, dispatch(_)).WillOnce(Invoke([&](Buffer::Instance& data) -> Http::Status {
Event::MockTimer* request_timer = setUpTimer();
EX... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 223,100,319,220,638,300,000,000,000,000,000,000,000 | 26 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static __always_inline void slab_unlock(struct page *page)
{
VM_BUG_ON_PAGE(PageTail(page), page);
__bit_spin_unlock(PG_locked, &page->flags);
} | 0 | [] | linux | fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8 | 74,716,339,120,672,720,000,000,000,000,000,000,000 | 5 | mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
When kmem_cache_alloc_bulk() attempts to allocate N objects from a percpu
freelist of length M, and N > M > 0, it will first remove the M elements
from the percpu freelist, then call ___slab_alloc() to allocate the next
element and repopulate the percpu freelis... |
void cgit_redirect(const char *url, bool permanent)
{
htmlf("Status: %d %s\n", permanent ? 301 : 302, permanent ? "Moved" : "Found");
html("Location: ");
html_url_path(url);
html("\n\n");
exit(0);
} | 0 | [] | cgit | 513b3863d999f91b47d7e9f26710390db55f9463 | 337,569,015,305,998,400,000,000,000,000,000,000,000 | 8 | ui-shared: prevent malicious filename from injecting headers |
void igmp6_late_cleanup(void)
{
unregister_netdevice_notifier(&igmp6_netdev_notifier);
} | 0 | [
"CWE-703"
] | linux | 2d3916f3189172d5c69d33065c3c21119fe539fc | 309,370,556,014,513,870,000,000,000,000,000,000,000 | 4 | ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
While investigating on why a synchronize_net() has been added recently
in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report()
might drop skbs in some cases.
Discussion about removing synchronize_net() from ipv6_mc_down()
will ha... |
static int sc_pkcs15emu_sc_hsm_add_dcod(sc_pkcs15_card_t * p15card, u8 id) {
sc_card_t *card = p15card->card;
sc_pkcs15_data_info_t *data_info;
sc_pkcs15_object_t data_obj;
u8 fid[2];
u8 efbin[512];
const u8 *ptr;
size_t len;
int r;
fid[0] = DCOD_PREFIX;
fid[1] = id;
/* Try to select a related EF containi... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 272,276,542,277,568,600,000,000,000,000,000,000,000 | 33 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf,
int len, int peek)
{
int al, i, j, ret;
unsigned int n;
SSL3_RECORD *rr;
void (*cb) (const SSL *ssl, int type2, int val) = NULL;
if (!SSL3_BUFFER_is_initialised(&s->rlayer.rbuf)) {
/* Not initia... | 1 | [
"CWE-400"
] | openssl | af58be768ebb690f78530f796e92b8ae5c9a4401 | 58,804,532,419,231,060,000,000,000,000,000,000,000 | 577 | Don't allow too many consecutive warning alerts
Certain warning alerts are ignored if they are received. This can mean that
no progress will be made if one peer continually sends those warning alerts.
Implement a count so that we abort the connection if we receive too many.
Issue reported by Shi Lei.
Reviewed-by: Ri... |
static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now,
int large_allowed)
{
struct tcp_sock *tp = tcp_sk(sk);
u32 new_size_goal, size_goal;
if (!large_allowed)
return mss_now;
/* Note : tcp_tso_autosize() will eventually split this later */
new_size_goal = sk->sk_gso_max_size - 1 - MAX... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 185,838,707,080,531,560,000,000,000,000,000,000,000 | 24 | tcp: limit payload size of sacked skbs
Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :
BUG_ON(tcp_skb_pcount(skb) < pcount);
This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48
An skb can hold 17 fragments, and each fragment can ho... |
GF_Err piff_pssh_dump(GF_Box *a, FILE * trace)
{
GF_PIFFProtectionSystemHeaderBox *ptr = (GF_PIFFProtectionSystemHeaderBox*) a;
if (!a) return GF_BAD_PARAM;
gf_isom_box_dump_start(a, "PIFFProtectionSystemHeaderBox", trace);
fprintf(trace, "SystemID=\"");
dump_data_hex(trace, (char *) ptr->SystemID, 16);
fprintf... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 8,819,185,526,914,621,000,000,000,000,000,000,000 | 15 | fixed 2 possible heap overflows (inc. #1088) |
static int __init init_f2fs_fs(void)
{
int err;
f2fs_build_trace_ios();
err = init_inodecache();
if (err)
goto fail;
err = create_node_manager_caches();
if (err)
goto free_inodecache;
err = create_segment_manager_caches();
if (err)
goto free_node_manager_caches;
err = create_checkpoint_caches();
if (e... | 0 | [
"CWE-20"
] | linux | 638164a2718f337ea224b747cf5977ef143166a4 | 304,182,912,172,916,260,000,000,000,000,000,000,000 | 54 | f2fs: fix potential panic during fstrim
As Ju Hyung Park reported:
"When 'fstrim' is called for manual trim, a BUG() can be triggered
randomly with this patch.
I'm seeing this issue on both x86 Desktop and arm64 Android phone.
On x86 Desktop, this was caused during Ubuntu boot-up. I have a
cronjob installed which c... |
PHP_METHOD(Phar, __construct)
{
#if !HAVE_SPL
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Cannot instantiate Phar object without SPL extension");
#else
char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
int fname_len, alias_len = 0, arch_len, entry_len, is_d... | 0 | [
"CWE-416"
] | php-src | d144590d38fa321b46b8e199c754006318985c84 | 314,500,697,264,704,360,000,000,000,000,000,000,000 | 130 | Fix bug #72321 - use efree() for emalloc allocation |
bytes_str(PyObject *op)
{
if (Py_BytesWarningFlag) {
if (PyErr_WarnEx(PyExc_BytesWarning,
"str() on a bytes instance", 1))
return NULL;
}
return bytes_repr(op);
} | 0 | [
"CWE-190"
] | cpython | 6c004b40f9d51872d848981ef1a18bb08c2dfc42 | 159,877,549,540,004,140,000,000,000,000,000,000,000 | 9 | bpo-30657: Fix CVE-2017-1000158 (#4758)
Fixes possible integer overflow in PyBytes_DecodeEscape.
Co-Authored-By: Jay Bosamiya <jaybosamiya@gmail.com> |
static void init_session_cache_ctx(SSL_CTX *sctx)
{
SSL_CTX_set_session_cache_mode(sctx,
SSL_SESS_CACHE_NO_INTERNAL|SSL_SESS_CACHE_SERVER);
SSL_CTX_sess_set_new_cb(sctx, add_session);
SSL_CTX_sess_set_get_cb(sctx, get_session);
SSL_CTX_sess_set_remove_cb(sctx, del_session);
} | 0 | [] | openssl | a70da5b3ecc3160368529677006801c58cb369db | 49,087,134,632,026,370,000,000,000,000,000,000,000 | 8 | New functions to check a hostname email or IP address against a
certificate. Add options to s_client, s_server and x509 utilities
to print results of checks. |
sync_cookie_get_server_info(Slapi_PBlock *pb __attribute__((unused)))
{
char *info_enc;
int rc = 0;
Slapi_Entry **entries;
Slapi_PBlock *srch_pb = NULL;
const char *host = NULL;
const char *port = NULL;
char *server_attrs[] = {"nsslapd-localhost", "nsslapd-port", NULL};
srch_pb = slapi_... | 0 | [
"CWE-476"
] | 389-ds-base | d7eef2fcfbab2ef8aa6ee0bf60f0a9b16ede66e0 | 95,754,628,611,655,300,000,000,000,000,000,000,000 | 37 | Issue 4711 - SIGSEV with sync_repl (#4738)
Bug description:
sync_repl sends back entries identified with a unique
identifier that is 'nsuniqueid'. If 'nsuniqueid' is
missing, then it may crash
Fix description:
Check a nsuniqueid is available else returns OP_ERR
relates: https://github.com/389ds/389-ds-ba... |
static json_object *reencrypt_make_hot_segments_encrypt_shift(struct luks2_hdr *hdr,
struct luks2_reencrypt *rh,
uint64_t data_offset)
{
int sg, crypt_seg, i = 0;
uint64_t segment_size;
json_object *jobj_seg_shrunk, *jobj_seg_new, *jobj_copy, *jobj_enc_seg = NULL,
*jobj_segs_hot = json_object_new_object();
... | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 201,243,594,399,101,500,000,000,000,000,000,000,000 | 62 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
R_API bool r_core_serve(RCore *core, RIODesc *file) {
ut8 cmd, flg, *ptr = NULL, buf[1024];
int i, pipefd = -1;
ut64 x;
RIORap *rior = (RIORap *)file->data;
if (!rior|| !rior->fd) {
eprintf ("rap: cannot listen.\n");
return false;
}
RSocket *fd = rior->fd;
eprintf ("RAP Server started (rap.loop=%s)\n",
... | 0 | [
"CWE-415",
"CWE-703"
] | radare2 | cb8b683758edddae2d2f62e8e63a738c39f92683 | 94,163,911,611,877,180,000,000,000,000,000,000,000 | 279 | Fix #16303 - c->table_query double free (#16318) |
static void mon_text_event(struct mon_reader_text *rp, struct urb *urb,
char ev_type, int status)
{
struct mon_event_text *ep;
unsigned int stamp;
struct usb_iso_packet_descriptor *fp;
struct mon_iso_desc *dp;
int i, ndesc;
stamp = mon_get_timestamp();
if (rp->nevents >= EVENT_MAX ||
(ep = kmem_cache_... | 0 | [
"CWE-787"
] | linux | a5f596830e27e15f7a0ecd6be55e433d776986d8 | 129,975,671,170,049,810,000,000,000,000,000,000,000 | 65 | usb: usbmon: Read text within supplied buffer size
This change fixes buffer overflows and silent data corruption with the
usbmon device driver text file read operations.
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by... |
LIST *mutt_find_list (LIST *l, const char *data)
{
LIST *p = l;
while (p)
{
if (data == p->data)
return p;
if (data && p->data && mutt_strcmp (p->data, data) == 0)
return p;
p = p->next;
}
return NULL;
} | 0 | [
"CWE-668"
] | mutt | 6d0624411a979e2e1d76af4dd97d03f47679ea4a | 171,481,671,226,401,900,000,000,000,000,000,000,000 | 14 | use a 64-bit random value in temporary filenames.
closes #3158 |
static ssize_t _hostfs_readv(
oe_fd_t* desc,
const struct oe_iovec* iov,
int iovcnt)
{
ssize_t ret = -1;
file_t* file = _cast_file(desc);
void* buf = NULL;
size_t buf_size = 0;
size_t data_size = 0;
if (!file || (!iov && iovcnt) || iovcnt < 0 || iovcnt > OE_IOV_MAX)
OE_RAISE... | 0 | [
"CWE-200",
"CWE-552"
] | openenclave | bcac8e7acb514429fee9e0b5d0c7a0308fd4d76b | 34,421,214,900,018,330,000,000,000,000,000,000,000 | 60 | Merge pull request from GHSA-525h-wxcc-f66m
Signed-off-by: Ming-Wei Shih <mishih@microsoft.com> |
NO_INLINE JsVar *jspeStatementReturn() {
JsVar *result = 0;
JSP_ASSERT_MATCH(LEX_R_RETURN);
if (lex->tk != ';' && lex->tk != '}') {
// we only want the value, so skip the name if there was one
result = jsvSkipNameAndUnLock(jspeExpression());
}
if (JSP_SHOULD_EXECUTE) {
JsVar *resultVar = jspeiFind... | 0 | [
"CWE-119",
"CWE-125"
] | Espruino | c36d30529118aa049797db43f111ddad468aad29 | 120,041,197,204,898,630,000,000,000,000,000,000,000 | 20 | Fix stack overflow if void void void... is repeated many times (fix #1434) |
const char* getBasePtr() const {
return _buffer;
} | 0 | [
"CWE-20"
] | mongo | 8f1c734c7f1862180f607c241fb167640889efba | 9,131,733,109,917,048,000,000,000,000,000,000,000 | 3 | SERVER-17264: improve bson validation for utf-8 strings
(cherry picked from commit 394a8569ff14a215c0691aa34440227b2e62a4de) |
static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
sockptr_t ov, unsigned int ol)
{
struct sock *sk = sock->sk;
struct tipc_sock *tsk = tipc_sk(sk);
struct tipc_group_req mreq;
u32 value = 0;
int res = 0;
if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM))
return 0;
if (lvl != SOL_TI... | 0 | [
"CWE-200",
"CWE-909"
] | linux | d6d86830705f173fca6087a3e67ceaf68db80523 | 103,834,241,000,500,300,000,000,000,000,000,000,000 | 80 | net ticp:fix a kernel-infoleak in __tipc_sendmsg()
struct tipc_socket_addr.ref has a 4-byte hole,and __tipc_getname() currently
copying it to user space,causing kernel-infoleak.
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:121 [inline]
BUG: KMSAN: kernel-infoleak in instrument_c... |
next_open (void *nxdata, int readonly)
{
struct b_conn *b_conn = nxdata;
return b_conn->b->open (b_conn->b, b_conn->conn, readonly);
} | 0 | [
"CWE-406"
] | nbdkit | bf0d61883a2f02f4388ec10dc92d4c61c093679e | 62,094,126,139,259,150,000,000,000,000,000,000,000 | 6 | server: Fix regression for NBD_OPT_INFO before NBD_OPT_GO
Most known NBD clients do not bother with NBD_OPT_INFO (except for
clients like 'qemu-nbd --list' that don't ever intend to connect), but
go straight to NBD_OPT_GO. However, it's not too hard to hack up qemu
to add in an extra client step (whether info on the ... |
int TNEFParseMemory(BYTE *memory, long size, TNEFStruct *TNEF) {
TNEFMemInfo minfo;
DEBUG(TNEF->Debug, 1, "Attempting to parse memory block...\n");
minfo.dataStart = memory;
minfo.ptr = memory;
minfo.size = size;
minfo.Debug = TNEF->Debug;
TNEF->IO.data = (void *)&minfo;
TNEF->IO.InitProc = TNEFMemory... | 0 | [
"CWE-399",
"CWE-125"
] | ytnef | 3cb0f914d6427073f262e1b2b5fd973e3043cdf7 | 222,331,936,451,653,880,000,000,000,000,000,000,000 | 15 | BugFix - Potential OOB with Fields of Size 0
Thanks to @hannob for contributing a malformed TNEF stream with
a Version field of size 0. Now such files will return an error
indicating invalid data. |
struct io_context *get_io_context(gfp_t gfp_flags, int node)
{
struct io_context *ret = NULL;
/*
* Check for unlikely race with exiting task. ioc ref count is
* zero when ioc is being detached.
*/
do {
ret = current_io_context(gfp_flags, node);
if (unlikely(!ret))
break;
} while (!atomic_long_inc_not_... | 0 | [
"CWE-20",
"CWE-703",
"CWE-400"
] | linux | 61cc74fbb87af6aa551a06a370590c9bc07e29d9 | 232,179,909,551,051,300,000,000,000,000,000,000,000 | 16 | block: Fix io_context leak after clone with CLONE_IO
With CLONE_IO, copy_io() increments both ioc->refcount and ioc->nr_tasks.
However exit_io_context() only decrements ioc->refcount if ioc->nr_tasks
reaches 0.
Always call put_io_context() in exit_io_context().
Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com... |
void sqlite3VdbeRunOnlyOnce(Vdbe *p){
p->runOnlyOnce = 1;
} | 0 | [
"CWE-755"
] | sqlite | 8654186b0236d556aa85528c2573ee0b6ab71be3 | 240,698,168,838,097,380,000,000,000,000,000,000,000 | 3 | When an error occurs while rewriting the parser tree for window functions
in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set,
and make sure that this shuts down any subsequent code generation that might
depend on the transformations that were implemented. This fixes a problem
discovered by the Y... |
static bool vrend_compile_shader(struct vrend_context *ctx,
struct vrend_shader *shader)
{
GLint param;
const char *shader_parts[SHADER_MAX_STRINGS];
for (int i = 0; i < shader->glsl_strings.num_strings; i++)
shader_parts[i] = shader->glsl_strings.strings[i].buf;
glSh... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 234,946,199,317,796,030,000,000,000,000,000,000,000 | 22 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
void fx_TypedArray_prototype_slice(txMachine* the)
{
mxTypedArrayDeclarations;
txInteger delta = dispatch->value.typedArray.dispatch->size;
txInteger start = (txInteger)fxArgToIndex(the, 0, 0, length);
txInteger end = (txInteger)fxArgToIndex(the, 1, length, length);
txInteger count = (end > start) ? end - start : ... | 0 | [
"CWE-125"
] | moddable | 135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45 | 201,356,056,026,208,600,000,000,000,000,000,000,000 | 37 | XS: #896 |
void _desinit_fullscreen() {
if (!_is_fullscreen) return;
Display *const dpy = cimg::X11_attr().display;
XUngrabKeyboard(dpy,CurrentTime);
#ifdef cimg_use_xrandr
if (cimg::X11_attr().resolutions && cimg::X11_attr().curr_resolution) {
XRRScreenConfiguration *config = XRRGetScreenInfo... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 224,822,270,442,547,180,000,000,000,000,000,000,000 | 18 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static void bpf_overflow_handler(struct perf_event *event,
struct perf_sample_data *data,
struct pt_regs *regs)
{
struct bpf_perf_event_data_kern ctx = {
.data = data,
.regs = regs,
};
int ret = 0;
preempt_disable();
if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1))
goto out;
rcu_read_lo... | 0 | [
"CWE-362",
"CWE-125"
] | linux | 321027c1fe77f892f4ea07846aeae08cefbbb290 | 122,382,691,092,600,960,000,000,000,000,000,000,000 | 24 | perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race
Di Shen reported a race between two concurrent sys_perf_event_open()
calls where both try and move the same pre-existing software group
into a hardware context.
The problem is exactly that described in commit:
f63a8daa5812 ("perf: Fix event->ctx... |
plperl_validator(PG_FUNCTION_ARGS)
{
Oid funcoid = PG_GETARG_OID(0);
HeapTuple tuple;
Form_pg_proc proc;
char functyptype;
int numargs;
Oid *argtypes;
char **argnames;
char *argmodes;
bool is_trigger = false;
bool is_event_trigger = false;
int i;
if (!CheckFunctionValidatorAccess(fcinfo->... | 0 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 245,390,860,353,370,000,000,000,000,000,000,000,000 | 67 | Prevent privilege escalation in explicit calls to PL validators.
The primary role of PL validators is to be called implicitly during
CREATE FUNCTION, but they are also normal functions that a user can call
explicitly. Add a permissions check to each validator to ensure that a
user cannot use explicit validator calls ... |
PHP_METHOD(PharFileInfo, getMetadata)
{
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (entry_obj->ent.entry->metadata) {
if (entry_obj->ent.entry->is_persistent) {
zval *ret;
char *buf = estrndup((char *) entry_obj->ent.entry->metadata, entry_obj->ent.entry->metadata_l... | 0 | [
"CWE-119"
] | php-src | 13ad4d3e971807f9a58ab5933182907dc2958539 | 61,653,792,197,444,220,000,000,000,000,000,000,000 | 20 | Fix bug #71354 - remove UMR when size is 0 |
vrrp_rt_rlimit_handler(vector_t *strvec)
{
global_data->vrrp_rlimit_rt = get_rt_rlimit(strvec, "vrrp");
} | 0 | [
"CWE-200"
] | keepalived | c6247a9ef2c7b33244ab1d3aa5d629ec49f0a067 | 162,176,802,122,719,150,000,000,000,000,000,000,000 | 4 | Add command line and configuration option to set umask
Issue #1048 identified that files created by keepalived are created
with mode 0666. This commit changes the default to 0644, and also
allows the umask to be specified in the configuration or as a command
line option.
Signed-off-by: Quentin Armitage <quentin@armit... |
DeepTiledInputFile::readTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly)
{
//
// Read a range of tiles from the file into the framebuffer
//
try
{
Lock lock (*_data->_streamData);
if (_data->slices.size() == 0)
throw IEX_NAMESPACE::ArgExc ("No frame buffer spe... | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 137,953,803,659,784,280,000,000,000,000,000,000,000 | 112 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
static int ull_name_ok(String *name)
{
if (!name || !name->length())
return 0;
if (name->length() > NAME_LEN)
{
my_error(ER_TOO_LONG_IDENT, MYF(0), name->c_ptr_safe());
return 0;
}
return 1;
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 40,408,892,180,637,735,000,000,000,000,000,000,000 | 12 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
static inline int may_rename(struct inode *old_dir,
struct dentry *old_dentry,
struct inode *new_dir,
struct dentry *new_dentry)
{
struct inode_security_struct *old_dsec, *new_dsec, *old_isec, *new_isec;
struct common_audit_data ad;
u32 sid = current_sid();
u32 av;
int old_is_dir, new_is_di... | 0 | [
"CWE-264"
] | linux | 7b0d0b40cd78cadb525df760ee4cac151533c2b5 | 287,842,099,765,722,450,000,000,000,000,000,000,000 | 54 | selinux: Permit bounded transitions under NO_NEW_PRIVS or NOSUID.
If the callee SID is bounded by the caller SID, then allowing
the transition to occur poses no risk of privilege escalation and we can
therefore safely allow the transition to occur. Add this exemption
for both the case where a transition was explicitl... |
static struct fixed_rsrc_ref_node *alloc_fixed_rsrc_ref_node(
struct io_ring_ctx *ctx)
{
struct fixed_rsrc_ref_node *ref_node;
ref_node = kzalloc(sizeof(*ref_node), GFP_KERNEL);
if (!ref_node)
return NULL;
if (percpu_ref_init(&ref_node->refs, io_rsrc_node_ref_zero,
0, GFP_KERNEL)) {
kfree(ref_node)... | 0 | [
"CWE-667"
] | linux | 3ebba796fa251d042be42b929a2d916ee5c34a49 | 261,141,027,830,534,200,000,000,000,000,000,000,000 | 19 | io_uring: ensure that SQPOLL thread is started for exit
If we create it in a disabled state because IORING_SETUP_R_DISABLED is
set on ring creation, we need to ensure that we've kicked the thread if
we're exiting before it's been explicitly disabled. Otherwise we can run
into a deadlock where exit is waiting go park t... |
static int
compare_old_routers_by_identity_(const void **_a, const void **_b)
{
int i;
const signed_descriptor_t *r1 = *_a, *r2 = *_b;
if ((i = fast_memcmp(r1->identity_digest, r2->identity_digest, DIGEST_LEN)))
return i;
return (int)(r1->published_on - r2->published_on); | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 302,742,811,612,059,100,000,000,000,000,000,000,000 | 8 | 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... |
ASC_selectReadableAssociation(T_ASC_Association* assocs[],
int assocCount, int timeout)
{
if (assocCount <= 0) return OFFalse;
P_DcmTransportConnection *connections = new P_DcmTransportConnection[assocCount];
if (connections == NULL) return OFFalse;
int i;
for (i=0; i<assocCount; i++)
{
if (as... | 0 | [
"CWE-415",
"CWE-703",
"CWE-401"
] | dcmtk | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | 280,526,076,170,476,200,000,000,000,000,000,000,000 | 25 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. |
static u32 beta(u32 da, u32 dm)
{
u32 d2, d3;
d2 = dm / 10;
if (da <= d2)
return BETA_MIN;
d3 = (8 * dm) / 10;
if (da >= d3 || d3 <= d2)
return BETA_MAX;
/*
* Based on:
*
* bmin d3 - bmax d2
* k3 = -------------------
* d3 - d2
*
* bmax - bmin
* k4 = -------------
* ... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8f363b77ee4fbf7c3bbcf5ec2c5ca482d396d664 | 238,601,364,284,500,340,000,000,000,000,000,000,000 | 28 | net: fix divide by zero in tcp algorithm illinois
Reading TCP stats when using TCP Illinois congestion control algorithm
can cause a divide by zero kernel oops.
The division by zero occur in tcp_illinois_info() at:
do_div(t, ca->cnt_rtt);
where ca->cnt_rtt can become zero (when rtt_reset is called)
Steps to Reprodu... |
ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf)
{
/* protocol, followed by bitmap of services */
struct protoent *protocol;
char *proto_name = NULL;
uint8_t protocol_nr;
struct servent *service;
uint16_t current_service;
if(ldns_rdf_size(rdf) < 1) {
return LDNS_STATUS_WI... | 0 | [
"CWE-415"
] | ldns | 070b4595981f48a21cc6b4f5047fdc2d09d3da91 | 263,540,139,028,194,880,000,000,000,000,000,000,000 | 42 | CAA and URI |
static void nfs4_init_opendata_res(struct nfs4_opendata *p)
{
p->o_res.f_attr = &p->f_attr;
p->o_res.dir_attr = &p->dir_attr;
p->o_res.seqid = p->o_arg.seqid;
p->c_res.seqid = p->c_arg.seqid;
p->o_res.server = p->o_arg.server;
nfs_fattr_init(&p->f_attr);
nfs_fattr_init(&p->dir_attr);
nfs_fattr_init_names(&p->f_... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 20e0fa98b751facf9a1101edaefbc19c82616a68 | 233,607,824,949,423,960,000,000,000,000,000,000,000 | 11 | Fix length of buffer copied in __nfs4_get_acl_uncached
_copy_from_pages() used to copy data from the temporary buffer to the
user passed buffer is passed the wrong size parameter when copying
data. res.acl_len contains both the bitmap and acl lenghts while
acl_len contains the acl length after adjusting for the bitmap... |
gdk_pixbuf_error_quark (void)
{
return g_quark_from_static_string ("gdk-pixbuf-error-quark");
} | 0 | [] | gdk-pixbuf | deb78d971c4bcb9e3ccbb71e7925bc6baa707188 | 168,256,158,338,928,050,000,000,000,000,000,000,000 | 4 | Use g_try_malloc_n where it makes sense
This lets us avoid some manual overflow checks. |
create_kernel_context(struct intel_engine_cs *engine)
{
static struct lock_class_key kernel;
return create_pinned_context(engine, I915_GEM_HWS_SEQNO_ADDR,
&kernel, "kernel_context");
} | 0 | [
"CWE-20",
"CWE-190"
] | linux | c784e5249e773689e38d2bc1749f08b986621a26 | 20,996,555,967,756,040,000,000,000,000,000,000,000 | 7 | drm/i915/guc: Update to use firmware v49.0.1
The latest GuC firmware includes a number of interface changes that
require driver updates to match.
* Starting from Gen11, the ID to be provided to GuC needs to contain
the engine class in bits [0..2] and the instance in bits [3..6].
NOTE: this patch breaks pointer d... |
static int cac_restore_security_env(sc_card_t *card, int se_num)
{
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_SUCCESS);
} | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 225,450,202,972,488,900,000,000,000,000,000,000,000 | 6 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
bool f_libxml_disable_entity_loader(bool disable /* = true */) {
bool old = s_libxml_errors->m_entity_loader_disabled;
s_libxml_errors->m_entity_loader_disabled = disable;
return old;
} | 0 | [
"CWE-94"
] | hhvm | 95f96e7287effe2fcdfb9a5338d1a7e4f55b083b | 328,813,929,020,967,230,000,000,000,000,000,000,000 | 7 | Fix libxml_disable_entity_loader()
This wasn't calling requestInit and setting the libxml handler no null.
So the first time an error came along it would reset the handler from
no-op to reading again.
This is a much better fix, we set our custom handler in requestInit and
when libxml_disable_entity_loader we store th... |
aiff_read_basc_chunk (SF_PRIVATE * psf, int datasize)
{ const char * type_str ;
basc_CHUNK bc ;
int count ;
count = psf_binheader_readf (psf, "E442", &bc.version, &bc.numBeats, &bc.rootNote) ;
count += psf_binheader_readf (psf, "E222", &bc.scaleType, &bc.sigNumerator, &bc.sigDenominator) ;
count += psf_binheader_... | 0 | [
"CWE-119",
"CWE-787"
] | libsndfile | f833c53cb596e9e1792949f762e0b33661822748 | 235,630,327,089,765,700,000,000,000,000,000,000,000 | 65 | src/aiff.c: Fix a buffer read overflow
Secunia Advisory SA76717.
Found by: Laurent Delosieres, Secunia Research at Flexera Software |
void Compute(OpKernelContext* context) override {
const Tensor& data = context->input(0);
const Tensor& weights = context->input(1);
bool use_weights = weights.NumElements() > 0;
OP_REQUIRES(context,
TensorShapeUtils::IsVector(data.shape()) ||
TensorShapeUtils::IsM... | 1 | [
"CWE-369"
] | tensorflow | da5ff2daf618591f64b2b62d9d9803951b945e9f | 115,043,877,279,404,540,000,000,000,000,000,000,000 | 60 | Fix FPE issue with `tf.raw_ops.DenseCountSparseOutput`.
PiperOrigin-RevId: 370946862
Change-Id: I3752584ad04aaecb327ff6793a9640ac56acfe7a |
static GTextInfo *GListFGetItem(GGadget *g,int32 pos) {
GListField *gl = (GListField *) g;
if ( pos<0 || pos>=gl->ltot )
return( NULL );
return(gl->ti[pos]);
} | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 184,770,185,636,929,700,000,000,000,000,000,000,000 | 7 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
xmlTextReaderGetAttributeNo(xmlTextReaderPtr reader, int no) {
xmlChar *ret;
int i;
xmlAttrPtr cur;
xmlNsPtr ns;
if (reader == NULL)
return(NULL);
if (reader->node == NULL)
return(NULL);
if (reader->curnode != NULL)
return(NULL);
/* TODO: handle the xmlDecl */
if (reader->node->t... | 0 | [
"CWE-399"
] | libxml2 | 213f1fe0d76d30eaed6e5853057defc43e6df2c9 | 198,920,928,798,989,050,000,000,000,000,000,000,000 | 37 | CVE-2015-1819 Enforce the reader to run in constant memory
One of the operation on the reader could resolve entities
leading to the classic expansion issue. Make sure the
buffer used for xmlreader operation is bounded.
Introduce a new allocation type for the buffers for this effect. |
auth_spa_server(auth_instance *ablock, uschar *data)
{
auth_spa_options_block *ob = (auth_spa_options_block *)(ablock->options_block);
uint8x lmRespData[24];
uint8x ntRespData[24];
SPAAuthRequest request;
SPAAuthChallenge challenge;
SPAAuthResponse response;
SPAAuthResponse *responseptr = &response;
uschar msgbuf[204... | 1 | [
"CWE-125"
] | exim | 57aa14b216432be381b6295c312065b2fd034f86 | 139,267,281,744,400,770,000,000,000,000,000,000,000 | 113 | Fix SPA authenticator, checking client-supplied data before using it. Bug 2571 |
TEST(MessageCompressorManager, MessageSizeTooLarge) {
auto registry = buildRegistry();
MessageCompressorManager compManager(®istry);
auto badMessageBuffer = SharedBuffer::allocate(128);
MsgData::View badMessage(badMessageBuffer.get());
badMessage.setId(1);
badMessage.setResponseToMsgId(0);
... | 0 | [
"CWE-697"
] | mongo | 1411cf602a21e45a5ef42b6869c480eb420976ee | 322,569,246,749,444,520,000,000,000,000,000,000,000 | 19 | SERVER-43751 Recompute compressor manager message parameters |
GF_Err gf_isom_change_ismacryp_protection(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex, char *scheme_uri, char *kms_uri)
{
GF_TrackBox *trak;
GF_Err e;
GF_SampleEntryBox *sea;
GF_ProtectionSchemeInfoBox *sinf;
e = CanAccessMovie(the_file, GF_ISOM_OPEN_WRITE);
if (e) return e;
trak = gf_iso... | 0 | [
"CWE-476"
] | gpac | 3b84ffcbacf144ce35650df958432f472b6483f8 | 233,251,125,758,162,920,000,000,000,000,000,000,000 | 27 | fixed #1735 |
static int smack_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
{
char *sp = smack_from_secid(secid);
*secdata = sp;
*seclen = strlen(sp);
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 163,793,021,863,696,420,000,000,000,000,000,000,000 | 8 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static inline void tcp_highest_sack_combine(struct sock *sk,
struct sk_buff *old,
struct sk_buff *new)
{
if (tcp_sk(sk)->sacked_out && (old == tcp_sk(sk)->highest_sack))
tcp_sk(sk)->highest_sack = new;
} | 0 | [
"CWE-416",
"CWE-269"
] | linux | bb1fceca22492109be12640d49f5ea5a544c6bb4 | 129,969,886,929,348,400,000,000,000,000,000,000,000 | 7 | tcp: fix use after free in tcp_xmit_retransmit_queue()
When tcp_sendmsg() allocates a fresh and empty skb, it puts it at the
tail of the write queue using tcp_add_write_queue_tail()
Then it attempts to copy user data into this fresh skb.
If the copy fails, we undo the work and remove the fresh skb.
Unfortunately, t... |
DLLEXPORT int tjTransform(tjhandle handle, const unsigned char *jpegBuf,
unsigned long jpegSize, int n,
unsigned char **dstBufs, unsigned long *dstSizes,
tjtransform *t, int flags)
{
jpeg_transform_info *xinfo = NULL;
jvirt_barray_ptr *sr... | 0 | [
"CWE-787"
] | libjpeg-turbo | 2a9e3bd7430cfda1bc812d139e0609c6aca0b884 | 328,216,573,634,814,250,000,000,000,000,000,000,000 | 150 | TurboJPEG: Properly handle gigapixel images
Prevent several integer overflow issues and subsequent segfaults that
occurred when attempting to compress or decompress gigapixel images with
the TurboJPEG API:
- Modify tjBufSize(), tjBufSizeYUV2(), and tjPlaneSizeYUV() to avoid
integer overflow when computing the retur... |
void c_shquote_discard_comment(const char **inp,
size_t *n_inp) {
size_t len;
c_assert(**inp == '#');
/* Skip up-to, but excluding, the next newline. */
len = c_shquote_strncspn(*inp, *n_inp, "\n");
c_shquote_skip_str(inp, n_inp, len);
} | 0 | [
"CWE-787"
] | c-shquote | 7fd15f8e272136955f7ffc37df29fbca9ddceca1 | 198,291,397,416,350,000,000,000,000,000,000,000,000 | 10 | strnspn: fix buffer overflow
Fix the strnspn and strncspn functions to use a properly sized buffer.
It used to be 1 byte too short. Checking for `0xff` in a string will
thus write `0xff` once byte beyond the stack space of the local buffer.
Note that the public API does not allow to pass `0xff` to those
functions. Th... |
static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb)
{
struct net *net = sock_net(skb->sk);
struct rtnl_net_dump_cb net_cb = {
.net = net,
.skb = skb,
.cb = cb,
.idx = 0,
.s_idx = cb->args[0],
};
spin_lock_bh(&net->nsid_lock);
idr_for_each(&net->netns_ids, rtnl_net_dumpid_one, &n... | 0 | [
"CWE-416"
] | linux | 21b5944350052d2583e82dd59b19a9ba94a007f0 | 122,764,979,091,987,200,000,000,000,000,000,000,000 | 18 | net: Fix double free and memory corruption in get_net_ns_by_id()
(I can trivially verify that that idr_remove in cleanup_net happens
after the network namespace count has dropped to zero --EWB)
Function get_net_ns_by_id() does not check for net::count
after it has found a peer in netns_ids idr.
It may dereference a... |
static void tstream_tls_readv_crypt_next(struct tevent_req *req)
{
struct tstream_tls_readv_state *state =
tevent_req_data(req,
struct tstream_tls_readv_state);
struct tstream_tls *tlss =
tstream_context_data(state->stream,
struct tstream_tls);
/*
* copy the pending buffer first
*/
while (tlss->read.le... | 0 | [] | samba | 22af043d2f20760f27150d7d469c7c7b944c6b55 | 132,000,519,443,123,990,000,000,000,000,000,000,000 | 41 | CVE-2013-4476: s4:libtls: check for safe permissions of tls private key file (key.pem)
If the tls key is not owned by root or has not mode 0600 samba will not
start up.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@s... |
megasas_get_pd_list(struct megasas_instance *instance)
{
int ret = 0, pd_index = 0;
struct megasas_cmd *cmd;
struct megasas_dcmd_frame *dcmd;
struct MR_PD_LIST *ci;
struct MR_PD_ADDRESS *pd_addr;
dma_addr_t ci_h = 0;
if (instance->pd_list_not_supported) {
dev_info(&instance->pdev->dev, "MR_DCMD_PD_LIST_QUERY ... | 0 | [
"CWE-476"
] | linux | bcf3b67d16a4c8ffae0aa79de5853435e683945c | 188,792,101,858,100,400,000,000,000,000,000,000,000 | 118 | scsi: megaraid_sas: return error when create DMA pool failed
when create DMA pool for cmd frames failed, we should return -ENOMEM,
instead of 0.
In some case in:
megasas_init_adapter_fusion()
-->megasas_alloc_cmds()
-->megasas_create_frame_pool
create DMA pool failed,
--> megasas_fre... |
static char *ini_escape_str(AVBPrint *dst, const char *src)
{
int i = 0;
char c = 0;
while (c = src[i++]) {
switch (c) {
case '\b': av_bprintf(dst, "%s", "\\b"); break;
case '\f': av_bprintf(dst, "%s", "\\f"); break;
case '\n': av_bprintf(dst, "%s", "\\n"); break;
ca... | 0 | [
"CWE-476"
] | FFmpeg | 837cb4325b712ff1aab531bf41668933f61d75d2 | 66,631,588,449,781,230,000,000,000,000,000,000,000 | 26 | ffprobe: Fix null pointer dereference with color primaries
Found-by: AD-lab of venustech
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
GF_Err gf_isom_box_read(GF_Box *a, GF_BitStream *bs)
{
if (!a) return GF_BAD_PARAM;
if (!a->registry) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Read invalid box type %s without registry\n", gf_4cc_to_str(a->type) ));
return GF_ISOM_INVALID_FILE;
}
return a->registry->read_fn(a, bs); | 0 | [
"CWE-476"
] | gpac | d527325a9b72218612455a534a508f9e1753f76e | 1,785,437,062,093,518,000,000,000,000,000,000,000 | 9 | fixed #1768 |
f_getcmdpos(typval_T *argvars UNUSED, typval_T *rettv)
{
cmdline_info_T *p = get_ccline_ptr();
rettv->vval.v_number = 0;
if (p != NULL)
rettv->vval.v_number = p->cmdpos + 1;
} | 0 | [
"CWE-122",
"CWE-787"
] | vim | 85b6747abc15a7a81086db31289cf1b8b17e6cb1 | 61,986,230,309,464,450,000,000,000,000,000,000,000 | 8 | patch 8.2.4214: illegal memory access with large 'tabstop' in Ex mode
Problem: Illegal memory access with large 'tabstop' in Ex mode.
Solution: Allocate enough memory. |
int btrfs_duplicate_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path,
const struct btrfs_key *new_key)
{
struct extent_buffer *leaf;
int ret;
u32 item_size;
leaf = path->nodes[0];
item_size = btrfs_item_size_nr(leaf, path->slots[0]);
ret = setup_leaf_for_split(t... | 0 | [
"CWE-362"
] | linux | dbcc7d57bffc0c8cac9dac11bec548597d59a6a5 | 100,880,336,912,212,600,000,000,000,000,000,000,000 | 25 | btrfs: fix race when cloning extent buffer during rewind of an old root
While resolving backreferences, as part of a logical ino ioctl call or
fiemap, we can end up hitting a BUG_ON() when replaying tree mod log
operations of a root, triggering a stack trace like the following:
------------[ cut here ]------------
... |
static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
gspca_dbg(gspca_dev, D_PACK, "Packet of length %d arrived\n", len);
/* A packet may contain several frames
loop until the whole packet is r... | 0 | [
"CWE-476"
] | linux | 485b06aadb933190f4bc44e006076bc27a23f205 | 48,254,678,568,703,940,000,000,000,000,000,000,000 | 113 | media: stv06xx: add missing descriptor sanity checks
Make sure to check that we have two alternate settings and at least one
endpoint before accessing the second altsetting structure and
dereferencing the endpoint arrays.
This specifically avoids dereferencing NULL-pointers or corrupting
memory when a device does not... |
static int tls_process_ske_psk_preamble(SSL *s, PACKET *pkt)
{
#ifndef OPENSSL_NO_PSK
PACKET psk_identity_hint;
/* PSK ciphersuites are preceded by an identity hint */
if (!PACKET_get_length_prefixed_2(pkt, &psk_identity_hint)) {
SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
ret... | 0 | [
"CWE-835"
] | openssl | 758754966791c537ea95241438454aa86f91f256 | 49,418,176,652,622,610,000,000,000,000,000,000,000 | 38 | Fix invalid handling of verify errors in libssl
In the event that X509_verify() returned an internal error result then
libssl would mishandle this and set rwstate to SSL_RETRY_VERIFY. This
subsequently causes SSL_get_error() to return SSL_ERROR_WANT_RETRY_VERIFY.
That return code is supposed to only ever be returned i... |
createCroppedImage(struct image_data *image, struct crop_mask *crop,
unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)
{
tsize_t cropsize;
unsigned char *read_buff = NULL;
unsigned char *crop_buff = NULL;
unsigned char *new_buff = NULL;
static tsize_t prev_cropsize ... | 0 | [
"CWE-125"
] | libtiff | 21d39de1002a5e69caa0574b2cc05d795d6fbfad | 128,694,338,013,343,750,000,000,000,000,000,000,000 | 113 | * tools/tiffcrop.c: fix multiple uint32 overflows in
writeBufferToSeparateStrips(), writeBufferToContigTiles() and
writeBufferToSeparateTiles() that could cause heap buffer overflows.
Reported by Henri Salo from Nixu Corporation.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2592 |
static void process_COM (const uchar * Data, int length)
{
int ch;
char Comment[MAX_COMMENT_SIZE+1];
int nch;
int a;
nch = 0;
if (length > MAX_COMMENT_SIZE) length = MAX_COMMENT_SIZE; // Truncate if it won't fit in our structure.
for (a=2;a<length;a++){
ch = Data[a];
... | 0 | [
"CWE-787"
] | jhead | 5186ddcf9e35a7aa0ff0539489a930434a1325f4 | 292,664,364,004,845,700,000,000,000,000,000,000,000 | 31 | Just allocate 20 bytes extra at the end of a section. Otherwise, we end
up with a whole lot of little checks for structures that the file says
are there but are unexpectedly cut off in fuzz tests |
PHP_METHOD(Phar, offsetExists)
{
char *fname;
size_t fname_len;
phar_entry_info *entry;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) {
if (NULL != (entry =... | 1 | [
"CWE-20"
] | php-src | 1e9b175204e3286d64dfd6c9f09151c31b5e099a | 113,357,952,796,293,630,000,000,000,000,000,000,000 | 32 | Fix bug #71860: Require valid paths for phar filenames |
nonnewline(p)
register struct parse *p;
{
register unsigned char *oldnext = p->next;
register unsigned char *oldend = p->end;
unsigned char bracket[4];
p->next = bracket;
p->end = bracket+3;
bracket[0] = '^';
bracket[1] = '\n';
bracket[2] = ']';
bracket[3] = '\0';
p_bracket(p);
assert(p->next == bracket+3);... | 0 | [] | php-src | 124fb22a13fafa3648e4e15b4f207c7096d8155e | 222,160,126,229,813,200,000,000,000,000,000,000,000 | 18 | Fixed bug #68739 #68740 #68741 |
static void test_simple_update()
{
MYSQL_STMT *stmt;
int rc;
char szData[25];
int nData= 1;
MYSQL_RES *result;
MYSQL_BIND my_bind[2];
ulong length[2];
char query[MAX_TEST_QUERY_LENGTH];
myheader("test_simple_update");
rc= mysql_autocommit(mysql, TRUE);
myquery(rc);
r... | 0 | [
"CWE-416"
] | mysql-server | 4797ea0b772d5f4c5889bc552424132806f46e93 | 228,108,736,867,077,520,000,000,000,000,000,000,000 | 76 | BUG#17512527: LIST HANDLING INCORRECT IN MYSQL_PRUNE_STMT_LIST()
Analysis:
---------
Invalid memory access maybe observed when using prepared statements if:
a) The mysql client connection is lost after statement preparation
is complete and
b) There is at least one statement which is in initialized state but
not ... |
static bool exec_needs_mount_namespace(
const ExecContext *context,
const ExecParameters *params,
const ExecRuntime *runtime) {
assert(context);
assert(params);
if (context->root_image)
return true;
if (!strv_isempty(cont... | 0 | [
"CWE-269"
] | systemd | f69567cbe26d09eac9d387c0be0fc32c65a83ada | 25,612,031,566,542,690,000,000,000,000,000,000,000 | 60 | core: expose SUID/SGID restriction as new unit setting RestrictSUIDSGID= |
TEST_P(ProtocolIntegrationTest, 1xxAndClose) { testEnvoyHandling1xx(false, "", true); } | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 1,008,159,135,806,400,200,000,000,000,000,000,000 | 1 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static inline u32 nfsd4_commit_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
{
return (op_encode_hdr_size + op_encode_verifier_maxsz) * sizeof(__be32);
} | 0 | [
"CWE-20",
"CWE-129"
] | linux | b550a32e60a4941994b437a8d662432a486235a5 | 31,471,191,891,547,035,000,000,000,000,000,000,000 | 4 | nfsd: fix undefined behavior in nfsd4_layout_verify
UBSAN: Undefined behaviour in fs/nfsd/nfs4proc.c:1262:34
shift exponent 128 is too large for 32-bit type 'int'
Depending on compiler+architecture, this may cause the check for
layout_type to succeed for overly large values (which seems to be the
case with amd64)... |
static inline void nested_release_vmcs12(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
if (vmx->nested.current_vmptr == -1ull)
return;
if (enable_shadow_vmcs) {
/* copy to memory all shadowed fields in case
they were modified */
copy_shadow_to_vmcs12(vmx);
vmx->nested.need_vmcs12_sync ... | 0 | [
"CWE-863"
] | kvm | acff78477b9b4f26ecdf65733a4ed77fe837e9dc | 292,891,623,669,872,660,000,000,000,000,000,000,000 | 25 | KVM: x86: nVMX: close leak of L0's x2APIC MSRs (CVE-2019-3887)
The nested_vmx_prepare_msr_bitmap() function doesn't directly guard the
x2APIC MSR intercepts with the "virtualize x2APIC mode" MSR. As a
result, we discovered the potential for a buggy or malicious L1 to get
access to L0's x2APIC MSRs, via an L2, as follo... |
EXPORTED int annotate_state_writemask(annotate_state_t *state,
const char *entry,
const char *userid,
const struct buf *value)
{
/* if the user is the owner, then write to the shared namespace */
if... | 0 | [
"CWE-732"
] | cyrus-imapd | 621f9e41465b521399f691c241181300fab55995 | 256,284,278,780,521,600,000,000,000,000,000,000,000 | 11 | annotate: don't allow everyone to write shared server entries |
static void pvclock_irq_work_fn(struct irq_work *w)
{
queue_work(system_long_wq, &pvclock_gtod_work);
} | 0 | [
"CWE-476"
] | linux | 55749769fe608fa3f4a075e42e89d237c8e37637 | 132,391,239,728,227,400,000,000,000,000,000,000,000 | 4 | KVM: x86: Fix wall clock writes in Xen shared_info not to mark page dirty
When dirty ring logging is enabled, any dirty logging without an active
vCPU context will cause a kernel oops. But we've already declared that
the shared_info page doesn't get dirty tracking anyway, since it would
be kind of insane to mark it di... |
int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
int error;
struct file *file = vma->vm_file;
struct address_space *mapping = file->f_mapping;
struct file_ra_state *ra = &file->f_ra;
struct inode *inode = mapping->host;
struct page *page;
pgoff_t size;
int did_readaround = 0;
int ret = 0;
... | 0 | [
"CWE-193"
] | linux-2.6 | 94ad374a0751f40d25e22e036c37f7263569d24c | 235,434,225,927,780,380,000,000,000,000,000,000,000 | 155 | Fix off-by-one error in iov_iter_advance()
The iov_iter_advance() function would look at the iov->iov_len entry
even though it might have iterated over the whole array, and iov was
pointing past the end. This would cause DEBUG_PAGEALLOC to trigger a
kernel page fault if the allocation was at the end of a page, and th... |
njs_vm_meta(njs_vm_t *vm, njs_uint_t index)
{
njs_vm_meta_t *metas;
metas = vm->options.metas;
if (njs_slow_path(metas == NULL || metas->size <= index)) {
return -1;
}
return metas->values[index];
} | 0 | [
"CWE-416"
] | njs | 6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6 | 19,755,284,641,920,433,000,000,000,000,000,000,000 | 11 | Fixed recursive async function calls.
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with c... |
static struct vblk * ldm_get_disk_objid (const struct ldmdb *ldb)
{
struct list_head *item;
BUG_ON (!ldb);
list_for_each (item, &ldb->v_disk) {
struct vblk *v = list_entry (item, struct vblk, list);
if (!memcmp (v->vblk.disk.disk_id, ldb->ph.disk_id, GUID_SIZE))
return v;
}
return NULL;
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | cae13fe4cc3f24820ffb990c09110626837e85d4 | 135,863,220,179,866,790,000,000,000,000,000,000,000 | 14 | Fix for buffer overflow in ldm_frag_add not sufficient
As Ben Hutchings discovered [1], the patch for CVE-2011-1017 (buffer
overflow in ldm_frag_add) is not sufficient. The original patch in
commit c340b1d64000 ("fs/partitions/ldm.c: fix oops caused by corrupted
partition table") does not consider that, for subsequen... |
static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
struct nlattr **attrs)
{
struct net *net = sock_net(skb->sk);
struct xfrm_state *x;
int err;
struct xfrm_user_expire *ue = nlmsg_data(nlh);
struct xfrm_usersa_info *p = &ue->state;
struct xfrm_mark m;
u32 mark = xfrm_mark_get(attrs, &m);
... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 25,358,723,509,486,514,000,000,000,000,000,000,000 | 38 | net: Use netlink_ns_capable to verify the permisions of netlink messages
It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.
... |
void gnutls_x509_crt_set_pin_function(gnutls_x509_crt_t crt,
gnutls_pin_callback_t fn,
void *userdata)
{
crt->pin.cb = fn;
crt->pin.data = userdata;
} | 0 | [
"CWE-295"
] | gnutls | 6e76e9b9fa845b76b0b9a45f05f4b54a052578ff | 120,855,827,510,724,250,000,000,000,000,000,000,000 | 7 | on certificate import check whether the two signature algorithms match |
static int qcow2_create(const char *filename, QEMUOptionParameter *options,
Error **errp)
{
const char *backing_file = NULL;
const char *backing_fmt = NULL;
uint64_t sectors = 0;
int flags = 0;
size_t cluster_size = DEFAULT_CLUSTER_SIZE;
int prealloc = 0;
int version ... | 0 | [
"CWE-476"
] | qemu | 11b128f4062dd7f89b14abc8877ff20d41b28be9 | 52,458,167,824,976,860,000,000,000,000,000,000,000 | 74 | qcow2: Fix NULL dereference in qcow2_open() error path (CVE-2014-0146)
The qcow2 code assumes that s->snapshots is non-NULL if s->nb_snapshots
!= 0. By having the initialisation of both fields separated in
qcow2_open(), any error occuring in between would cause the error path
to dereference NULL in qcow2_free_snapshot... |
static UINT32 rdp_get_sec_bytes(rdpRdp* rdp)
{
UINT32 sec_bytes;
if (rdp->sec_flags & SEC_ENCRYPT)
{
sec_bytes = 12;
if (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS)
sec_bytes += 4;
}
else if (rdp->sec_flags != 0)
{
sec_bytes = 4;
}
else
{
sec_bytes = 0;
}
return sec_bytes;
} | 0 | [
"CWE-476"
] | FreeRDP | 7d58aac24fe20ffaad7bd9b40c9ddf457c1b06e7 | 102,206,572,355,543,250,000,000,000,000,000,000,000 | 22 | security: add a NULL pointer check to fix a server crash. |
static inline void crypto_xor_byte(u8 *a, const u8 *b, unsigned int size)
{
for (; size; size--)
*a++ ^= *b++;
} | 0 | [
"CWE-284",
"CWE-264",
"CWE-269"
] | linux | 4943ba16bbc2db05115707b3ff7b4874e9e3c560 | 191,194,397,585,317,100,000,000,000,000,000,000,000 | 5 | crypto: include crypto- module prefix in template
This adds the module loading prefix "crypto-" to the template lookup
as well.
For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly
includes the "crypto-" prefix at every level, correctly rejecting "vfat":
net-pf-38
algif-hash
crypto-vfat(blowf... |
void Compute(OpKernelContext* ctx) override {
try {
const Tensor& input = ctx->input(kInputTensorIndex);
OP_REQUIRES(
ctx, input.dims() == 4,
errors::InvalidArgument("Current RequantizePerChannel operator"
"supports 4D tensors only."));
cons... | 0 | [
"CWE-20"
] | tensorflow | 203214568f5bc237603dbab6e1fd389f1572f5c9 | 327,373,815,843,705,970,000,000,000,000,000,000,000 | 119 | Reorganize and add more validation to MKL requantization
PiperOrigin-RevId: 387901341
Change-Id: I2515b9034c64e113db0bcec8337d30643ab0a0f1 |
static void inet_get_ping_group_range_net(struct net *net, kgid_t *low,
kgid_t *high)
{
kgid_t *data = net->ipv4.ping_group_range.range;
unsigned int seq;
do {
seq = read_seqbegin(&net->ipv4.ping_group_range.lock);
*low = data[0];
*high = data[1];
} while (read_seqretry(&net->ipv4.ping_group_range.lo... | 0 | [
"CWE-703"
] | linux | a134f083e79fb4c3d0a925691e732c56911b4326 | 60,526,975,012,335,850,000,000,000,000,000,000,000 | 13 | ipv4: Missing sk_nulls_node_init() in ping_unhash().
If we don't do that, then the poison value is left in the ->pprev
backlink.
This can cause crashes if we do a disconnect, followed by a connect().
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Wen Xu <hotdog3645@gmail.com>
Signed-off-by: D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.