func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
GF_Err dmax_dump(GF_Box *a, FILE * trace)
{
GF_DMAXBox *p;
p = (GF_DMAXBox *)a;
gf_isom_box_dump_start(a, "MaxPacketDurationBox", trace);
fprintf(trace, "MaximumDuration=\"%d\">\n", p->maxDur);
gf_isom_box_dump_done("MaxPacketDurationBox", a, trace);
return GF_OK;
} | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 4,477,443,920,661,742,000,000,000,000,000,000,000 | 9 | fixed 2 possible heap overflows (inc. #1088) |
static void handle_nttrans(connection_struct *conn,
struct trans_state *state,
struct smb_request *req)
{
if (get_Protocol() >= PROTOCOL_NT1) {
req->flags2 |= 0x40; /* IS_LONG_NAME */
SSVAL(discard_const_p(uint8_t, req->inbuf),smb_flg2,req->flags2);
}
SMB_PERFCOUNT_SET_SUBOP(&req->pcd, state->call)... | 0 | [
"CWE-189"
] | samba | b4bfcdf921aeee05c4608d7b48618fdfb1f134dc | 86,294,844,921,768,350,000,000,000,000,000,000,000 | 130 | Fix bug #10010 - Missing integer wrap protection in EA list reading can cause server to loop with DOS.
Ensure we never wrap whilst adding client provided input.
Signed-off-by: Jeremy Allison <jra@samba.org> |
static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc,
const char *name, uint64_t *write_to)
{
uint64_t value;
int position, err, i;
if (ctx->trace_enable)
position = get_bits_count(gbc);
value = 0;
for (i = 0; i < 8; i++) {
in... | 0 | [
"CWE-20",
"CWE-129"
] | FFmpeg | b97a4b658814b2de8b9f2a3bce491c002d34de31 | 250,397,302,278,337,000,000,000,000,000,000,000,000 | 29 | cbs_av1: Fix reading of overlong uvlc codes
The specification allows 2^32-1 to be encoded as any number of zeroes
greater than 31, followed by a one. This previously failed because the
trace code would overflow the array containing the string representation
of the bits if there were more than 63 zeroes. Fix that by ... |
static uint dump_routines_for_db(char *db)
{
char query_buff[QUERY_LENGTH];
const char *routine_type[]= {"FUNCTION", "PROCEDURE"};
char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3];
char *routine_name;
int i;
FILE *sql_file= md_result_file;
MYSQL_RES *routine_res, *r... | 0 | [] | server | 5a43a31ee81bc181eeb5ef2bf0704befa6e0594d | 26,008,446,072,967,945,000,000,000,000,000,000,000 | 176 | mysqldump: comments and identifiers with new lines
don't let identifiers with new lines to break a comment |
int iwch_cxgb3_ofld_send(struct t3cdev *tdev, struct sk_buff *skb)
{
int error = 0;
struct cxio_rdev *rdev;
rdev = (struct cxio_rdev *)tdev->ulp;
if (cxio_fatal_error(rdev)) {
kfree_skb(skb);
return -EIO;
}
error = cxgb3_ofld_send(tdev, skb);
if (error < 0)
kfree_skb(skb);
return error;
} | 1 | [
"CWE-703"
] | linux | 67f1aee6f45059fd6b0f5b0ecb2c97ad0451f6b3 | 145,310,064,754,123,730,000,000,000,000,000,000,000 | 15 | 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... |
DropoutDescriptor CreateDropoutDescriptor() {
cudnnDropoutDescriptor_t result;
CHECK_CUDNN_OK(cudnnCreateDropoutDescriptor(&result));
return DropoutDescriptor(result);
} | 0 | [
"CWE-20"
] | tensorflow | 14755416e364f17fb1870882fa778c7fec7f16e3 | 34,186,937,647,163,146,000,000,000,000,000,000,000 | 5 | Prevent CHECK-fail in LSTM/GRU with zero-length input.
PiperOrigin-RevId: 346239181
Change-Id: I5f233dbc076aab7bb4e31ba24f5abd4eaf99ea4f |
//! Fill sequentially all pixel values with specified values \newinstance.
CImg<T> get_fill(const T& val0, const T& val1, const T& val2, const T& val3) const {
return CImg<T>(_width,_height,_depth,_spectrum).fill(val0,val1,val2,val3); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 285,336,893,292,194,600,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
int test_gf2m_mod_sqr(BIO *bp,BN_CTX *ctx)
{
BIGNUM *a,*b[2],*c,*d;
int i, j, ret = 0;
int p0[] = {163,7,6,3,0,-1};
int p1[] = {193,15,0,-1};
a=BN_new();
b[0]=BN_new();
b[1]=BN_new();
c=BN_new();
d=BN_new();
BN_GF2m_arr2poly(p0, b[0]);
BN_GF2m_arr2poly(p1, b[1]);
for (i=0; i<num0; i++)
{
BN_bntest_r... | 0 | [
"CWE-310"
] | openssl | a7a44ba55cb4f884c6bc9ceac90072dea38e66d0 | 180,319,954,257,110,950,000,000,000,000,000,000,000 | 58 | Fix for CVE-2014-3570 (with minor bn_asm.c revamp).
Reviewed-by: Emilia Kasper <emilia@openssl.org> |
halfpage(int flag, linenr_T Prenum)
{
long scrolled = 0;
int i;
int n;
int room;
if (Prenum)
curwin->w_p_scr = (Prenum > curwin->w_height) ?
curwin->w_height : Prenum;
n = (curwin->w_p_scr <= curwin->w_height) ?
curwin->w_p_scr : curwin->w_height;
update_topline();
va... | 0 | [
"CWE-122"
] | vim | 777e7c21b7627be80961848ac560cb0a9978ff43 | 60,061,165,113,433,210,000,000,000,000,000,000,000 | 179 | patch 8.2.3564: invalid memory access when scrolling without valid screen
Problem: Invalid memory access when scrolling without a valid screen.
Solution: Do not set VALID_BOTLINE in w_valid. |
plperlu_validator(PG_FUNCTION_ARGS)
{
return plperl_validator(fcinfo);
} | 1 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 318,726,637,511,280,950,000,000,000,000,000,000,000 | 4 | 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 ... |
serialize_uep(
bufinfo_T *bi,
u_entry_T *uep)
{
int i;
size_t len;
undo_write_bytes(bi, (long_u)uep->ue_top, 4);
undo_write_bytes(bi, (long_u)uep->ue_bot, 4);
undo_write_bytes(bi, (long_u)uep->ue_lcount, 4);
undo_write_bytes(bi, (long_u)uep->ue_size, 4);
for (i = 0; i < uep->ue_siz... | 0 | [
"CWE-190"
] | vim | 3eb1637b1bba19519885dd6d377bd5596e91d22c | 31,814,924,593,228,670,000,000,000,000,000,000,000 | 21 | patch 8.0.0377: possible overflow when reading corrupted undo file
Problem: Possible overflow when reading corrupted undo file.
Solution: Check if allocated size is not too big. (King) |
static int thread_sync(UNUSED void *arg)
{
virgl_gl_context gl_context = vrend_state.sync_context;
struct vrend_fence *fence, *stor;
pipe_mutex_lock(vrend_state.fence_mutex);
vrend_clicbs->make_current(gl_context);
while (!vrend_state.stop_sync_thread) {
if (LIST_IS_EMPTY(&vrend_state.fence_wait... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 36,816,208,529,983,953,000,000,000,000,000,000,000 | 31 | 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> |
status_icon_stop (GsdXrandrManager *manager)
{
struct GsdXrandrManagerPrivate *priv = manager->priv;
if (priv->status_icon) {
g_signal_handlers_disconnect_by_func (
priv->status_icon, G_CALLBACK (status_icon_activate_cb), manager);
g_signal_handle... | 0 | [] | gnome-settings-daemon | be513b3c7d80d0b7013d79ce46d7eeca929705cc | 116,416,391,939,779,380,000,000,000,000,000,000,000 | 14 | Implement autoconfiguration of the outputs
This is similar in spirit to 'xrandr --auto', but we disfavor selecting clone modes.
Instead, we lay out the outputs left-to-right.
Signed-off-by: Federico Mena Quintero <federico@novell.com> |
static inline void destroy_timer_on_stack(struct timer_list *timer) { } | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 204,912,218,150,564,930,000,000,000,000,000,000,000 | 1 | time: Remove CONFIG_TIMER_STATS
Currently CONFIG_TIMER_STATS exposes process information across namespaces:
kernel/time/timer_list.c print_timer():
SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
/proc/timer_list:
#11: <0000000000000000>, hrtimer_wakeup, S:01, do_nanosleep, cron/2570
Given that the trac... |
void WebContents::ExitFullscreenModeForTab(content::WebContents* source) {
CommonWebContentsDelegate::ExitFullscreenModeForTab(source);
Emit("leave-html-full-screen");
} | 0 | [
"CWE-284",
"CWE-693"
] | electron | 18613925610ba319da7f497b6deed85ad712c59b | 204,052,287,782,352,360,000,000,000,000,000,000,000 | 4 | refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25108)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25065)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL
* spec: add test for x-site _top navigation
* chore: old cod... |
rb_str_count(argc, argv, str)
int argc;
VALUE *argv;
VALUE str;
{
char table[256];
char *s, *send;
int init = 1;
int i;
if (argc < 1) {
rb_raise(rb_eArgError, "wrong number of arguments");
}
for (i=0; i<argc; i++) {
VALUE s = argv[i];
StringValue(s);
tr_setup_table(s, table... | 0 | [
"CWE-20"
] | ruby | e926ef5233cc9f1035d3d51068abe9df8b5429da | 322,961,669,628,075,140,000,000,000,000,000,000,000 | 32 | * random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
* string.c (rb_str_tmp_new), intern.h: New function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
int ssl3_send_certificate_request(SSL *s)
{
unsigned char *p, *d;
int i, j, nl, off, n;
STACK_OF(X509_NAME) *sk = NULL;
X509_NAME *name;
BUF_MEM *buf;
if (s->state == SSL3_ST_SW_CERT_REQ_A) {
buf = s->init_buf;
d = p = (unsigned char *)&(buf->data[4]);
/* get the list ... | 0 | [] | openssl | 1392c238657ec745af6a40def03d67d4ce02a082 | 10,073,073,550,453,408,000,000,000,000,000,000,000 | 89 | Fix PSK handling.
The PSK identity hint should be stored in the SSL_SESSION structure
and not in the parent context (which will overwrite values used
by other SSL structures with the same SSL_CTX).
Use BUF_strndup when copying identity as it may not be null terminated.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cher... |
PackLinuxElf32::PackLinuxElf32help1(InputFile *f)
{
e_type = get_te16(&ehdri.e_type);
e_phnum = get_te16(&ehdri.e_phnum);
e_shnum = get_te16(&ehdri.e_shnum);
unsigned const e_phentsize = get_te16(&ehdri.e_phentsize);
if (ehdri.e_ident[Elf32_Ehdr::EI_CLASS]!=Elf32_Ehdr::ELFCLASS32
|| sizeof(Elf3... | 1 | [
"CWE-787"
] | upx | 4e2fdb464a885c694408552c31739cb04b77bdcf | 268,744,237,030,719,100,000,000,000,000,000,000,000 | 81 | Defend against bad PT_DYNAMIC
https://github.com/upx/upx/issues/391
modified: p_lx_elf.cpp
modified: p_lx_elf.h |
_zip_readstr(unsigned char **buf, int len, int nulp, struct zip_error *error)
{
char *r, *o;
r = (char *)malloc(nulp ? len+1 : len);
if (!r) {
_zip_error_set(error, ZIP_ER_MEMORY, 0);
return NULL;
}
memcpy(r, *buf, len);
*buf += len;
if (nulp) {
/* replace any in-string NUL charact... | 0 | [
"CWE-189"
] | php-src | ef8fc4b53d92fbfcd8ef1abbd6f2f5fe2c4a11e5 | 55,918,233,862,689,220,000,000,000,000,000,000,000 | 23 | Fix bug #69253 - ZIP Integer Overflow leads to writing past heap boundary |
bool wsrep_sst_wait ()
{
if (mysql_mutex_lock (&LOCK_wsrep_sst)) abort();
while (!sst_complete)
{
WSREP_INFO("Waiting for SST to complete.");
mysql_cond_wait (&COND_wsrep_sst, &LOCK_wsrep_sst);
}
if (local_seqno >= 0)
{
WSREP_INFO("SST complete, seqno: %lld", (long long) local_seqno);
}
els... | 0 | [
"CWE-77"
] | mysql-wsrep | 4ea4b0c6a318209ac09b15aaa906c7b4a13b988c | 128,562,313,397,696,520,000,000,000,000,000,000,000 | 23 | codership/mysql-wsrep-bugs#758 Donor uses invalid SST methods |
TEST(FormatterTest, UnmatchedBraces) {
EXPECT_THROW_MSG(format("{"), FormatError, "invalid format string");
EXPECT_THROW_MSG(format("}"), FormatError, "unmatched '}' in format string");
EXPECT_THROW_MSG(format("{0{}"), FormatError, "invalid format string");
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 267,855,232,668,271,800,000,000,000,000,000,000,000 | 5 | Fix segfault on complex pointer formatting (#642) |
GF_Err gf_filter_pid_raw_new(GF_Filter *filter, const char *url, const char *local_file, const char *mime_type, const char *fext, u8 *probe_data, u32 probe_size, Bool trust_mime, GF_FilterPid **out_pid)
{
char tmp_ext[50];
u32 ext_len=0;
Bool ext_not_trusted, is_new_pid = GF_FALSE;
GF_FilterPid *pid = *out_pid;
if... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 224,613,772,832,450,340,000,000,000,000,000,000,000 | 133 | fixed crashes for very long path - cf #1908 |
static int netif_alloc_netdev_queues(struct net_device *dev)
{
unsigned int count = dev->num_tx_queues;
struct netdev_queue *tx;
size_t sz = count * sizeof(*tx);
if (count < 1 || count > 0xffff)
return -EINVAL;
tx = kvzalloc(sz, GFP_KERNEL | __GFP_RETRY_MAYFAIL);
if (!tx)
return -ENOMEM;
dev->_tx = tx;
... | 0 | [
"CWE-476"
] | linux | 0ad646c81b2182f7fa67ec0c8c825e0ee165696d | 249,394,858,704,674,600,000,000,000,000,000,000,000 | 20 | tun: call dev_get_valid_name() before register_netdevice()
register_netdevice() could fail early when we have an invalid
dev name, in which case ->ndo_uninit() is not called. For tun
device, this is a problem because a timer etc. are already
initialized and it expects ->ndo_uninit() to clean them up.
We could move th... |
static void jpc_siz_destroyparms(jpc_ms_t *ms)
{
jpc_siz_t *siz = &ms->parms.siz;
if (siz->comps) {
jas_free(siz->comps);
}
} | 0 | [] | jasper | 4031ca321d8cb5798c316ab39c7a5dc88a61fdd7 | 22,728,077,003,861,644,000,000,000,000,000,000,000 | 7 | Incorporated changes from patch
jasper-1.900.3-libjasper-stepsizes-overflow.patch |
static void spl_object_storage_dtor(zval *element) /* {{{ */
{
spl_SplObjectStorageElement *el = Z_PTR_P(element);
zval_ptr_dtor(&el->obj);
zval_ptr_dtor(&el->inf);
efree(el);
} /* }}} */ | 0 | [
"CWE-119",
"CWE-787"
] | php-src | 61cdd1255d5b9c8453be71aacbbf682796ac77d4 | 271,871,362,835,160,080,000,000,000,000,000,000,000 | 7 | Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key |
void ha_partition::change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
{
handler **file_array;
table= table_arg;
table_share= share;
/*
m_file can be NULL when using an old cached table in DROP TABLE, when the
table just has REMOVED PARTITIONING, see Bug#42438
*/
if (m_file)
{
file_array= m... | 0 | [] | mysql-server | be901b60ae59c93848c829d1b0b2cb523ab8692e | 245,265,944,533,662,030,000,000,000,000,000,000,000 | 29 | Bug#26390632: CREATE TABLE CAN CAUSE MYSQL TO EXIT.
Analysis
========
CREATE TABLE of InnoDB table with a partition name
which exceeds the path limit can cause the server
to exit.
During the preparation of the partition name,
there was no check to identify whether the complete
path name for partition exceeds the max ... |
PHP_FUNCTION(imagefilledellipse)
{
zval *IM;
zend_long cx, cy, w, h, color;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(IM), "Image", le_gd)) == NULL) {
RETURN_FALSE;
}
gdImage... | 0 | [
"CWE-787"
] | php-src | 28022c9b1fd937436ab67bb3d61f652c108baf96 | 230,599,746,754,788,340,000,000,000,000,000,000,000 | 18 | Fix bug#72697 - select_colors write out-of-bounds
(cherry picked from commit b6f13a5ef9d6280cf984826a5de012a32c396cd4)
Conflicts:
ext/gd/gd.c |
large_bitmap(void)
{
const int nbits = 1 << 16;
unsigned long *bits = kcalloc(BITS_TO_LONGS(nbits), sizeof(long), GFP_KERNEL);
if (!bits)
return;
bitmap_set(bits, 1, 20);
bitmap_set(bits, 60000, 15);
test("1-20,60000-60014", "%*pbl", nbits, bits);
kfree(bits);
} | 0 | [
"CWE-200"
] | linux | ad67b74d2469d9b82aaa572d76474c95bc484d57 | 181,960,670,568,966,680,000,000,000,000,000,000,000 | 12 | printk: hash addresses printed with %p
Currently there exist approximately 14 000 places in the kernel where
addresses are being printed using an unadorned %p. This potentially
leaks sensitive information regarding the Kernel layout in memory. Many
of these calls are stale, instead of fixing every call lets hash the
a... |
void ElectronBrowserHandlerImpl::MessageSync(bool internal,
const std::string& channel,
blink::CloneableMessage arguments,
MessageSyncCallback callback) {
api::WebContents* api_web_co... | 1 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 324,939,230,780,998,770,000,000,000,000,000,000,000 | 10 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
dns_message_getsig0(dns_message_t *msg, dns_name_t **owner) {
/*
* Get the SIG(0) record for 'msg'.
*/
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(owner == NULL || *owner == NULL);
if (msg->sig0 != NULL && owner != NULL) {
/* If dns_message_getsig0 is called on a rendered message
* after the SIG(0) has bee... | 0 | [
"CWE-617"
] | bind9 | 6ed167ad0a647dff20c8cb08c944a7967df2d415 | 163,802,006,204,646,330,000,000,000,000,000,000,000 | 21 | Always keep a copy of the message
this allows it to be available even when dns_message_parse()
returns a error. |
tor_tls_get_pending_bytes(tor_tls_t *tls)
{
tor_assert(tls);
return SSL_pending(tls->ssl);
} | 0 | [
"CWE-264"
] | tor | 638fdedcf16cf7d6f7c586d36f7ef335c1c9714f | 61,700,102,607,651,850,000,000,000,000,000,000,000 | 5 | Don't send a certificate chain on outgoing TLS connections from non-relays |
inline void AveragePool(const PoolParams& params,
const RuntimeShape& input_shape,
const int16_t* input_data,
const RuntimeShape& output_shape,
int16_t* output_data) {
TFLITE_DCHECK_LE(params.quantized_activation_min,
... | 1 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 140,919,246,887,249,800,000,000,000,000,000,000,000 | 58 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
virtio_vq_init(struct virtio_base *base, uint32_t pfn)
{
struct virtio_vq_info *vq;
uint64_t phys;
size_t size;
char *vb;
vq = &base->queues[base->curq];
vq->pfn = pfn;
phys = (uint64_t)pfn << VRING_PAGE_BITS;
size = vring_size(vq->qsize, VIRTIO_PCI_VRING_ALIGN);
vb = paddr_guest2host(base->dev->vmctx, phys, ... | 0 | [
"CWE-476"
] | acrn-hypervisor | 154fe59531c12b82e26d1b24b5531f5066d224f5 | 262,121,393,924,580,430,000,000,000,000,000,000,000 | 43 | 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> |
const std::array<unsigned char, 16> uuid() const {
int len = 0;
const char* data = nullptr;
if (isBinData(BinDataType::newUUID)) {
data = binData(len);
}
uassert(ErrorCodes::InvalidUUID,
"uuid must be a 16-byte binary field with UUID (4) subtype",
... | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 244,158,156,467,477,030,000,000,000,000,000,000,000 | 13 | SERVER-38984 Validate unique User ID on UserCache hit |
void int_CRYPTO_set_do_dynlock_callback(
void (*dyn_cb)(int mode, int type, const char *file, int line))
{
do_dynlock_cb = dyn_cb;
} | 0 | [
"CWE-310"
] | openssl | 270881316664396326c461ec7a124aec2c6cc081 | 125,393,933,193,056,610,000,000,000,000,000,000,000 | 5 | Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cher... |
bool const_item() const { return false; } | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 332,116,846,468,394,420,000,000,000,000,000,000,000 | 1 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
PJ_DEF(pj_status_t) pjmedia_sdp_neg_set_prefer_remote_codec_order(
pjmedia_sdp_neg *neg,
pj_bool_t prefer_remote)
{
PJ_ASSERT_RETURN(neg, PJ_EINVAL);
neg->prefer_remote_codec_order = prefer_remote;
return PJ_SUCCESS;
} | 0 | [
"CWE-400",
"CWE-200",
"CWE-754"
] | pjproject | 97b3d7addbaa720b7ddb0af9bf6f3e443e664365 | 135,161,748,195,259,280,000,000,000,000,000,000,000 | 8 | Merge pull request from GHSA-hvq6-f89p-frvp |
void LibRaw::fix_after_rawspeed(int bl)
{
if (load_raw == &LibRaw::lossy_dng_load_raw)
C.maximum = 0xffff;
else if (load_raw == &LibRaw::sony_load_raw)
C.maximum = 0x3ff0;
} | 0 | [
"CWE-129"
] | LibRaw | 89d065424f09b788f443734d44857289489ca9e2 | 322,931,899,041,354,500,000,000,000,000,000,000,000 | 7 | fixed two more problems found by fuzzer |
static int mov_write_uuid_tag_ipod(AVIOContext *pb)
{
avio_wb32(pb, 28);
ffio_wfourcc(pb, "uuid");
avio_wb32(pb, 0x6b6840f2);
avio_wb32(pb, 0x5f244fc5);
avio_wb32(pb, 0xba39a51b);
avio_wb32(pb, 0xcf0323f3);
avio_wb32(pb, 0x0);
return 28;
} | 0 | [
"CWE-369"
] | FFmpeg | 2c0e98a0b478284bdff6d7a4062522605a8beae5 | 66,684,008,764,339,020,000,000,000,000,000,000,000 | 11 | avformat/movenc: Write version 2 of audio atom if channels is not known
The version 1 needs the channel count and would divide by 0
Fixes: division by 0
Fixes: fpe_movenc.c_1108_1.ogg
Fixes: fpe_movenc.c_1108_2.ogg
Fixes: fpe_movenc.c_1108_3.wav
Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: Michael N... |
delete_files (CommonJob *job,
GList *files,
int *files_skipped)
{
GList *l;
GFile *file;
SourceInfo source_info;
TransferInfo transfer_info;
DeleteData data;
if (job_aborted (job))
{
return;
}
scan_sources (files,
&sou... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 18,751,205,960,623,747,000,000,000,000,000,000,000 | 57 | mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission i... |
bool ndp_msg_opt_prefix_flag_on_link(struct ndp_msg *msg, int offset)
{
struct nd_opt_prefix_info *pi =
ndp_msg_payload_opts_offset(msg, offset);
return pi->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK;
} | 0 | [
"CWE-284"
] | libndp | a4892df306e0532487f1634ba6d4c6d4bb381c7f | 30,671,778,417,449,660,000,000,000,000,000,000,000 | 7 | libndp: validate the IPv6 hop limit
None of the NDP messages should ever come from a non-local network; as
stated in RFC4861's 6.1.1 (RS), 6.1.2 (RA), 7.1.1 (NS), 7.1.2 (NA),
and 8.1. (redirect):
- The IP Hop Limit field has a value of 255, i.e., the packet
could not possibly have been forwarded by a router.
T... |
static void Ins_SDPVTL( INS_ARG )
{
Long A, B, C;
Long p1, p2; /* was Int in pas type ERROR */
p1 = args[1];
p2 = args[0];
if ( BOUNDS( p2, CUR.zp1.n_points ) ||
BOUNDS( p1, CUR.zp2.n_points ) )
{
CUR.error = TT_Err_Invalid_Reference;
return;
}
A = CUR.zp... | 0 | [
"CWE-125"
] | ghostpdl | c7c55972758a93350882c32147801a3485b010fe | 88,806,208,430,628,170,000,000,000,000,000,000,000 | 43 | Bug 698024: bounds check zone pointer in Ins_MIRP() |
plugin_flush (struct backend *b, struct connection *conn, uint32_t flags,
int *err)
{
struct backend_plugin *p = container_of (b, struct backend_plugin, backend);
int r;
assert (connection_get_handle (conn, 0));
if (p->plugin.flush)
r = p->plugin.flush (connection_get_handle (conn, 0), 0);
... | 0 | [
"CWE-406"
] | nbdkit | a6b88b195a959b17524d1c8353fd425d4891dc5f | 265,648,894,389,843,020,000,000,000,000,000,000,000 | 20 | 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 ... |
static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
{
return sys_acl_set_fd(handle, fsp, theacl);
} | 0 | [
"CWE-665"
] | samba | 30e724cbff1ecd90e5a676831902d1e41ec1b347 | 137,611,613,837,518,040,000,000,000,000,000,000,000 | 4 | FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero
Otherwise num_volumes and the end marker can return uninitialized data
to the client.
Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org> |
PHP_FUNCTION(dom_document_create_attribute_ns)
{
zval *id;
xmlDocPtr docp;
xmlNodePtr nodep = NULL, root;
xmlNsPtr nsptr;
int ret, uri_len = 0, name_len = 0;
char *uri, *name;
char *localname = NULL, *prefix = NULL;
dom_object *intern;
int errorcode;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC... | 0 | [
"CWE-20"
] | php-src | 52b93f0cfd3cba7ff98cc5198df6ca4f23865f80 | 108,499,303,209,830,600,000,000,000,000,000,000,000 | 59 | Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) |
const std::string& FilePath() const {
return _testFilePath;
} | 0 | [
"CWE-755"
] | mongo | 75f7184eafa78006a698cda4c4adfb57f1290047 | 46,661,052,162,440,760,000,000,000,000,000,000,000 | 3 | SERVER-50170 fix max staleness read preference parameter for server selection |
static void security_info_free(struct security_info *i) {
if (!i)
return;
free(i->id);
free(i->type);
free(i->load_state);
free(i->fragment_path);
free(i->user);
free(i->protect_home);
free(i->protect_system);
free(i->root_direc... | 0 | [
"CWE-269"
] | systemd | 9d880b70ba5c6ca83c82952f4c90e86e56c7b70c | 335,810,483,525,223,700,000,000,000,000,000,000,000 | 27 | analyze: check for RestrictSUIDSGID= in "systemd-analyze security"
And let's give it a heigh weight, since it pretty much can be used for
bad things only. |
CImg<T>& assign(const unsigned int size_x, const unsigned int size_y=1,
const unsigned int size_z=1, const unsigned int size_c=1) {
const size_t siz = safe_size(size_x,size_y,size_z,size_c);
if (!siz) return assign();
const size_t curr_siz = (size_t)size();
if (siz!=curr_... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 103,217,977,993,639,370,000,000,000,000,000,000,000 | 27 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
_equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
{
COMPARE_NODE_FIELD(opfamilyname);
COMPARE_STRING_FIELD(amname);
return true;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 111,076,853,163,079,070,000,000,000,000,000,000,000 | 7 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
void r_pkcs7_free_digestalgorithmidentifier (RPKCS7DigestAlgorithmIdentifiers *dai) {
ut32 i;
if (dai) {
for (i = 0; i < dai->length; ++i) {
if (dai->elements[i]) {
r_x509_free_algorithmidentifier (dai->elements[i]);
// r_x509_free_algorithmidentifier doesn't free the pointer
// because on x509 the o... | 0 | [
"CWE-476"
] | radare2 | 7ab66cca5bbdf6cb2d69339ef4f513d95e532dbf | 17,177,845,835,799,430,000,000,000,000,000,000,000 | 15 | Fix #7152 - Null deref in cms |
static int fuse_verify_xattr_list(char *list, size_t size)
{
size_t origsize = size;
while (size) {
size_t thislen = strnlen(list, size);
if (!thislen || thislen == size)
return -EIO;
size -= thislen + 1;
list += thislen + 1;
}
return origsize;
} | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 219,212,144,442,867,030,000,000,000,000,000,000,000 | 16 | 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 redisFormatSdsCommandArgv(hisds *target, int argc, const char **argv,
const size_t *argvlen)
{
hisds cmd, aux;
unsigned long long totlen;
int j;
size_t len;
/* Abort on a NULL target */
if (target == NULL)
return -1;
/* Calculate our total size */
... | 0 | [
"CWE-190",
"CWE-680"
] | redis | 0215324a66af949be39b34be2d55143232c1cb71 | 330,988,123,409,925,370,000,000,000,000,000,000,000 | 47 | Fix redis-cli / redis-sential overflow on some platforms (CVE-2021-32762) (#9587)
The redis-cli command line tool and redis-sentinel service may be vulnerable
to integer overflow when parsing specially crafted large multi-bulk network
replies. This is a result of a vulnerability in the underlying hiredis
library wh... |
static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head,
struct canfd_frame *frames, int has_timestamp)
{
struct sk_buff *skb;
struct canfd_frame *firstframe;
struct sockaddr_can *addr;
struct sock *sk = op->sk;
unsigned int datalen = head->nframes * op->cfsiz;
int err;
skb = alloc_skb... | 0 | [
"CWE-362"
] | linux | d5f9023fa61ee8b94f37a93f08e94b136cf1e463 | 182,962,786,325,777,460,000,000,000,000,000,000,000 | 59 | can: bcm: delay release of struct bcm_op after synchronize_rcu()
can_rx_register() callbacks may be called concurrently to the call to
can_rx_unregister(). The callbacks and callback data, though, are
protected by RCU and the struct sock reference count.
So the callback data is really attached to the life of sk, mean... |
TEST_F(RouterTest, PoolFailureDueToConnectTimeout) {
ON_CALL(callbacks_.route_->route_entry_, priority())
.WillByDefault(Return(Upstream::ResourcePriority::High));
EXPECT_CALL(cm_.thread_local_cluster_,
httpConnPool(Upstream::ResourcePriority::High, _, &router_));
EXPECT_CALL(cm_.thread_local_... | 0 | [
"CWE-703"
] | envoy | 18871dbfb168d3512a10c78dd267ff7c03f564c6 | 87,079,723,665,292,690,000,000,000,000,000,000,000 | 34 | [1.18] CVE-2022-21655
Crash with direct_response
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com> |
setCurlURL(instanceData *pData, uchar **tpls)
{
char authBuf[1024];
uchar *searchIndex;
uchar *searchType;
uchar *parent;
uchar *bulkId;
es_str_t *url;
int rLocal;
int r;
DEFiRet;
setBaseURL(pData, &url);
if(pData->bulkmode) {
r = es_addBuf(&url, "_bulk", sizeof("_bulk")-1);
parent = NULL;
} else {
... | 0 | [
"CWE-399"
] | rsyslog | 80f88242982c9c6ad6ce8628fc5b94ea74051cf4 | 126,406,900,006,017,630,000,000,000,000,000,000,000 | 59 | bugfix: double-free in omelasticsearch
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=461
Thanks to Marius Ionescu for providing a detailled bug report |
CotpConnection_parseIncomingMessage(CotpConnection* self)
{
CotpIndication indication = parseCotpMessage(self);
self->readBuffer->size = 0;
self->packetSize = 0;
return indication;
} | 0 | [
"CWE-122"
] | libiec61850 | 033ab5b6488250c8c3b838f25a7cbc3e099230bb | 260,031,883,440,343,800,000,000,000,000,000,000,000 | 9 | - COTP: fixed possible heap buffer overflow when handling message with invalid (zero) value in length field (#250) |
static void __init apply_trace_boot_options(void)
{
char *buf = trace_boot_options_buf;
char *option;
while (true) {
option = strsep(&buf, ",");
if (!option)
break;
if (*option)
trace_set_options(&global_trace, option);
/* Put back the comma to allow this to be called again */
if (buf)
*(buf -... | 0 | [
"CWE-415"
] | linux | 4397f04575c44e1440ec2e49b6302785c95fd2f8 | 117,221,522,482,041,480,000,000,000,000,000,000,000 | 19 | tracing: Fix possible double free on failure of allocating trace buffer
Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
tracing buffer, memory is freed, but the pointers that point to them are not
initialized back to NULL, and later paths may try to free the freed memory
again. Jing and Chu... |
int epo_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1,
const gx_drawing_color *pdcolor, gs_logical_operation_t lop,
fixed adjustx, fixed adjusty)
{
int code = epo_handle_erase_page(dev);
if (code != 0)
return code;
return dev_proc(dev, draw_thin_line)(dev, fx0, f... | 0 | [] | ghostpdl | c9b362ba908ca4b1d7c72663a33229588012d7d9 | 236,957,612,605,208,660,000,000,000,000,000,000,000 | 10 | Bug 699670: disallow copying of the epo device
The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.
Add an epo_finish_copydevice which NULLs the three offending poin... |
clientListenerConnectionOpened(AnyP::PortCfgPointer &s, const Ipc::FdNoteId portTypeNote, const Subscription::Pointer &sub)
{
Must(s != NULL);
if (!OpenedHttpSocket(s->listenConn, portTypeNote))
return;
Must(Comm::IsConnOpen(s->listenConn));
// TCP: setup a job to handle accept() with subscri... | 0 | [
"CWE-444"
] | squid | fd68382860633aca92065e6c343cfd1b12b126e7 | 248,477,666,967,991,220,000,000,000,000,000,000,000 | 36 | 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... |
void jas_matrix_bindsub(jas_matrix_t *mat0, jas_matrix_t *mat1, int r0, int c0,
int r1, int c1)
{
int i;
if (mat0->data_) {
if (!(mat0->flags_ & JAS_MATRIX_REF)) {
jas_free(mat0->data_);
}
mat0->data_ = 0;
mat0->datasize_ = 0;
}
if (mat0->rows_) {
jas_free(mat0->rows_);
mat0->rows_ = 0;
}
mat0->... | 1 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 323,202,212,214,647,750,000,000,000,000,000,000,000 | 30 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
TEST(ExistsMatchExpression, MatchesScalar) {
ExistsMatchExpression exists("a");
ASSERT(exists.matchesBSON(BSON("a" << 1), NULL));
ASSERT(exists.matchesBSON(BSON("a" << BSONNULL), NULL));
ASSERT(!exists.matchesBSON(BSON("b" << 1), NULL));
} | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 56,554,947,109,169,365,000,000,000,000,000,000,000 | 6 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
static double mp_max(_cimg_math_parser& mp) {
const unsigned int i_end = (unsigned int)mp.opcode[2];
double val = _mp_arg(3);
for (unsigned int i = 4; i<i_end; ++i) val = std::max(val,_mp_arg(i));
return val;
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 272,232,191,155,145,500,000,000,000,000,000,000,000 | 6 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static void jpc_dec_destroy(jpc_dec_t *dec)
{
if (dec->cstate) {
jpc_cstate_destroy(dec->cstate);
}
if (dec->pkthdrstreams) {
jpc_streamlist_destroy(dec->pkthdrstreams);
}
if (dec->image) {
jas_image_destroy(dec->image);
}
if (dec->cp) {
jpc_dec_cp_destroy(dec->cp);
}
if (dec->cmpts) {
jas_free(dec... | 0 | [
"CWE-787"
] | jasper | e2f2e5f4022baef2386eec25c57b63debfe4cb20 | 223,905,072,948,580,500,000,000,000,000,000,000,000 | 36 | jas_seq: check bounds in jas_seq2d_bindsub()
Fixes CVE-2017-5503, CVE-2017-5504, CVE-2017-5505,
Closes https://github.com/jasper-maint/jasper/issues/3
Closes https://github.com/jasper-maint/jasper/issues/4
Closes https://github.com/jasper-maint/jasper/issues/5
Closes https://github.com/mdadams/jasper/issues/88
Closes... |
static Bool session_should_abort(GF_FilterSession *fs)
{
if (fs->run_status<GF_OK) return GF_TRUE;
if (!fs->run_status) return GF_FALSE;
return fs->in_final_flush;
} | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 23,356,603,386,204,815,000,000,000,000,000,000,000 | 6 | fixed crashes for very long path - cf #1908 |
static int vfat_fill_super(struct super_block *sb, void *data, int silent)
{
return fat_fill_super(sb, data, silent, 1, setup);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd | 339,012,180,152,127,800,000,000,000,000,000,000,000 | 4 | NLS: improve UTF8 -> UTF16 string conversion routine
The utf8s_to_utf16s conversion routine needs to be improved. Unlike
its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
the maximum length of the output buffer or the endianness of its
16-bit output.
This patch (as1501) adds the two missing argumen... |
static void __d_rehash(struct dentry *entry)
{
struct hlist_bl_head *b = d_hash(entry->d_name.hash);
BUG_ON(!d_unhashed(entry));
hlist_bl_lock(b);
hlist_bl_add_head_rcu(&entry->d_hash, b);
hlist_bl_unlock(b);
} | 0 | [
"CWE-362",
"CWE-399"
] | linux | 49d31c2f389acfe83417083e1208422b4091cd9e | 320,603,441,307,911,500,000,000,000,000,000,000,000 | 8 | dentry name snapshots
take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified). In either case the pointer to stable
string is stored into the same st... |
static USBDevice *ehci_find_device(EHCIState *ehci, uint8_t addr)
{
USBDevice *dev;
USBPort *port;
int i;
for (i = 0; i < NB_PORTS; i++) {
port = &ehci->ports[i];
if (!(ehci->portsc[i] & PORTSC_PED)) {
DPRINTF("Port %d not enabled\n", i);
continue;
}
... | 0 | [] | qemu | 791f97758e223de3290592d169f8e6339c281714 | 196,637,487,082,238,440,000,000,000,000,000,000,000 | 19 | 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... |
poly_contained(PG_FUNCTION_ARGS)
{
Datum polya = PG_GETARG_DATUM(0);
Datum polyb = PG_GETARG_DATUM(1);
/* Just switch the arguments and pass it off to poly_contain */
PG_RETURN_DATUM(DirectFunctionCall2(poly_contain, polyb, polya));
} | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 219,227,451,224,147,330,000,000,000,000,000,000,000 | 8 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
loop_info64_to_old(const struct loop_info64 *info64, struct loop_info *info)
{
memset(info, 0, sizeof(*info));
info->lo_number = info64->lo_number;
info->lo_device = info64->lo_device;
info->lo_inode = info64->lo_inode;
info->lo_rdevice = info64->lo_rdevice;
info->lo_offset = info64->lo_offset;
info->lo_encrypt_... | 0 | [
"CWE-416",
"CWE-362"
] | linux | ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5 | 309,995,229,688,518,920,000,000,000,000,000,000,000 | 28 | loop: fix concurrent lo_open/lo_release
范龙飞 reports that KASAN can report a use-after-free in __lock_acquire.
The reason is due to insufficient serialization in lo_release(), which
will continue to use the loop device even after it has decremented the
lo_refcnt to zero.
In the meantime, another process can come in, o... |
static void put_ctx(struct perf_event_context *ctx)
{
if (atomic_dec_and_test(&ctx->refcount)) {
if (ctx->parent_ctx)
put_ctx(ctx->parent_ctx);
if (ctx->task && ctx->task != TASK_TOMBSTONE)
put_task_struct(ctx->task);
call_rcu(&ctx->rcu_head, free_ctx);
}
} | 0 | [
"CWE-362",
"CWE-125"
] | linux | 321027c1fe77f892f4ea07846aeae08cefbbb290 | 120,822,504,298,675,300,000,000,000,000,000,000,000 | 10 | 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... |
static int __netdev_adjacent_dev_link_lists(struct net_device *dev,
struct net_device *upper_dev,
struct list_head *up_list,
struct list_head *down_list,
void *private, bool master)
{
int ret;
ret = __netdev_adjacent_dev_insert(dev, upper_dev, up_list,
private, master);
... | 0 | [
"CWE-476"
] | linux | 0ad646c81b2182f7fa67ec0c8c825e0ee165696d | 53,972,020,418,415,800,000,000,000,000,000,000,000 | 22 | tun: call dev_get_valid_name() before register_netdevice()
register_netdevice() could fail early when we have an invalid
dev name, in which case ->ndo_uninit() is not called. For tun
device, this is a problem because a timer etc. are already
initialized and it expects ->ndo_uninit() to clean them up.
We could move th... |
bool ZrtpQueue::isMitmMode() {
return mitmMode;
} | 0 | [
"CWE-119"
] | ZRTPCPP | c8617100f359b217a974938c5539a1dd8a120b0e | 192,074,045,818,666,440,000,000,000,000,000,000,000 | 3 | Fix vulnerabilities found and reported by Mark Dowd
- limit length of memcpy
- limit number of offered algorithms in Hello packet
- length check in PING packet
- fix a small coding error |
fb_blank(struct fb_info *info, int blank)
{
struct fb_event event;
int ret = -EINVAL, early_ret;
if (blank > FB_BLANK_POWERDOWN)
blank = FB_BLANK_POWERDOWN;
event.info = info;
event.data = ␣
early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
if (info->fbops->fb_blank)
ret = info-... | 0 | [
"CWE-703",
"CWE-189"
] | linux | fc9bbca8f650e5f738af8806317c0a041a48ae4a | 296,571,947,831,743,160,000,000,000,000,000,000,000 | 29 | vm: convert fb_mmap to vm_iomap_memory() helper
This is my example conversion of a few existing mmap users. The
fb_mmap() case is a good example because it is a bit more complicated
than some: fb_mmap() mmaps one of two different memory areas depending
on the page offset of the mmap (but happily there is never any mi... |
NCURSES_SP_NAME(init_color) (NCURSES_SP_DCLx
NCURSES_COLOR_T color,
NCURSES_COLOR_T r,
NCURSES_COLOR_T g,
NCURSES_COLOR_T b)
{
return _nc_init_color(SP_PARM, color, r, g, b);
} | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 310,938,078,401,527,800,000,000,000,000,000,000,000 | 8 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
GF_Err gf_filter_set_source_restricted(GF_Filter *filter, GF_Filter *link_from, const char *link_ext)
{
GF_Err e = gf_filter_set_source(filter, link_from, link_ext);
if (e) return e;
if (link_from->restricted_source_id)
gf_free(link_from->restricted_source_id);
link_from->restricted_source_id = gf_strdup(link_f... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 260,599,814,244,411,300,000,000,000,000,000,000,000 | 10 | fixed crashes for very long path - cf #1908 |
const char* ExpressionArrayElemAt::getOpName() const {
return "$arrayElemAt";
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 279,659,236,077,935,730,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
load_binint(UnpicklerObject *self)
{
char *s;
if (_Unpickler_Read(self, &s, 4) < 0)
return -1;
return load_binintx(self, s, 4);
} | 0 | [
"CWE-190",
"CWE-369"
] | cpython | a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd | 100,473,346,001,320,980,000,000,000,000,000,000,000 | 9 | closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261) |
ext4_ext_binsearch(struct inode *inode,
struct ext4_ext_path *path, ext4_lblk_t block)
{
struct ext4_extent_header *eh = path->p_hdr;
struct ext4_extent *r, *l, *m;
if (eh->eh_entries == 0) {
/*
* this leaf is empty:
* we get such a leaf in split/add case
*/
return;
}
ext_debug("binsearch for %u: ... | 0 | [
"CWE-362"
] | linux-2.6 | dee1f973ca341c266229faa5a1a5bb268bed3531 | 238,947,459,161,891,700,000,000,000,000,000,000,000 | 55 | ext4: race-condition protection for ext4_convert_unwritten_extents_endio
We assumed that at the time we call ext4_convert_unwritten_extents_endio()
extent in question is fully inside [map.m_lblk, map->m_len] because
it was already split during submission. But this may not be true due to
a race between writeback vs fa... |
Value ExpressionAnyElementTrue::evaluate(const Document& root) const {
const Value arr = vpOperand[0]->evaluate(root);
uassert(17041,
str::stream() << getOpName() << "'s argument must be an array, but is "
<< typeName(arr.getType()),
arr.isArray());
const ve... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 243,328,783,631,534,540,000,000,000,000,000,000,000 | 14 | SERVER-38070 fix infinite loop in agg expression |
bool fields_are_impossible()
{
// no select or it is last select with no tables (service select)
return !select_stack_head() ||
(select_stack_top == 1 &&
select_stack[0]->is_service_select);
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 91,661,990,942,112,000,000,000,000,000,000,000,000 | 7 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
uint32_t BinaryProtocolWriter::serializedSizeMapBegin(
TType /*keyType*/,
TType /*valType*/,
uint32_t /*size*/) const {
return serializedSizeByte() + serializedSizeByte() + serializedSizeI32();
} | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | c9a903e5902834e95bbd4ab0e9fa53ba0189f351 | 73,420,055,839,268,200,000,000,000,000,000,000,000 | 6 | Better handling of truncated data when reading strings
Summary:
Currently we read string size and blindly pre-allocate it. This allows malicious attacker to send a few bytes message and cause server to allocate huge amount of memory (>1GB).
This diff changes the logic to check if we have enough data in the buffer bef... |
HTTPSession::onMessageComplete(HTTPCodec::StreamID streamID,
bool upgrade) {
DestructorGuard dg(this);
// The codec's parser detected the end of the ingress message for
// this transaction.
VLOG(4) << "processing ingress message complete for " << *this <<
", streamID=" << stre... | 0 | [
"CWE-20"
] | proxygen | 0600ebe59c3e82cd012def77ca9ca1918da74a71 | 110,662,311,599,045,900,000,000,000,000,000,000,000 | 57 | Check that a secondary auth manager is set before dereferencing.
Summary: CVE-2018-6343
Reviewed By: mingtaoy
Differential Revision: D12994423
fbshipit-source-id: 9229ec11da8085f1fa153595e8e5353e19d06fb7 |
static ssize_t hfi1_file_write(struct file *fp, const char __user *data,
size_t count, loff_t *offset)
{
const struct hfi1_cmd __user *ucmd;
struct hfi1_filedata *fd = fp->private_data;
struct hfi1_ctxtdata *uctxt = fd->uctxt;
struct hfi1_cmd cmd;
struct hfi1_user_info uinfo;
struct hfi1_tid_info tinfo;... | 0 | [
"CWE-284",
"CWE-264"
] | linux | e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 | 306,716,780,887,398,840,000,000,000,000,000,000,000 | 248 | IB/security: Restrict use of the write() interface
The drivers/infiniband stack uses write() as a replacement for
bi-directional ioctl(). This is not safe. There are ways to
trigger write calls that result in the return structure that
is normally written to user space being shunted off to user
specified kernel memory... |
static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, __be32 *p, struct nfs_readres *res)
{
struct xdr_stream xdr;
struct compound_hdr hdr;
int status;
xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
status = decode_compound_hdr(&xdr, &hdr);
if (status)
goto out;
status = decode_putfh(&xdr);
if (status)
goto ... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 319,205,819,905,614,700,000,000,000,000,000,000,000 | 19 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static inline struct msg_queue *msq_obtain_object(struct ipc_namespace *ns, int id)
{
struct kern_ipc_perm *ipcp = ipc_obtain_object_idr(&msg_ids(ns), id);
if (IS_ERR(ipcp))
return ERR_CAST(ipcp);
return container_of(ipcp, struct msg_queue, q_perm);
} | 0 | [
"CWE-362",
"CWE-401"
] | linux | b9a532277938798b53178d5a66af6e2915cb27cf | 111,070,657,721,790,030,000,000,000,000,000,000,000 | 9 | Initialize msg/shm IPC objects before doing ipc_addid()
As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before
having initialized the IPC object state. Yes, we initialize the IPC
object in a locked state, but with all the lockless RCU lookup work,
that IPC object lock no longer means that the state c... |
int luaRedisReplicateCommandsCommand(lua_State *lua) {
if (server.lua_write_dirty) {
lua_pushboolean(lua,0);
} else {
server.lua_replicate_commands = 1;
/* When we switch to single commands replication, we can provide
* different math.random() sequences at every call, which is w... | 0 | [
"CWE-703",
"CWE-125"
] | redis | 6ac3c0b7abd35f37201ed2d6298ecef4ea1ae1dd | 156,443,413,433,270,610,000,000,000,000,000,000,000 | 13 | Fix protocol parsing on 'ldbReplParseCommand' (CVE-2021-32672)
The protocol parsing on 'ldbReplParseCommand' (LUA debugging)
Assumed protocol correctness. This means that if the following
is given:
*1
$100
test
The parser will try to read additional 94 unallocated bytes after
the client buffer.
This commit fixes this ... |
free_config_ttl(
config_tree *ptree
)
{
FREE_INT_FIFO(ptree->ttl);
} | 0 | [
"CWE-19"
] | ntp | fe46889f7baa75fc8e6c0fcde87706d396ce1461 | 31,557,429,852,904,280,000,000,000,000,000,000,000 | 6 | [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. |
bool ldb_dn_add_child_fmt(struct ldb_dn *dn, const char *child_fmt, ...)
{
struct ldb_dn *child;
char *child_str;
va_list ap;
bool ret;
if ( !dn || dn->invalid) {
return false;
}
va_start(ap, child_fmt);
child_str = talloc_vasprintf(dn, child_fmt, ap);
va_end(ap);
if (child_str == NULL) {
return false;... | 0 | [
"CWE-200"
] | samba | 7f51ec8c4ed9ba1f53d722e44fb6fb3cde933b72 | 333,949,163,180,029,500,000,000,000,000,000,000,000 | 27 | CVE-2015-5330: ldb_dn: simplify and fix ldb_dn_escape_internal()
Previously we relied on NUL terminated strings and jumped back and
forth between copying escaped bytes and memcpy()ing un-escaped chunks.
This simple version is easier to reason about and works with
unterminated strings. It may also be faster as it avoid... |
static inline void pni_mutex_lock(pni_mutex_t *m) { EnterCriticalSection(m); } | 0 | [] | qpid-proton | 4aea0fd8502f5e9af7f22fd60645eeec07bce0b2 | 308,259,687,797,250,020,000,000,000,000,000,000,000 | 1 | PROTON-2014: [c] Ensure SSL mutual authentication
(cherry picked from commit 97c7733f07712665f3d08091c82c393e4c3adbf7) |
fr_window_archive_extract_here (FrWindow *window,
gboolean skip_older,
gboolean overwrite,
gboolean junk_paths,
gboolean ask_to_open_destination)
{
ExtractData *edata;
edata = extract_data_new (window,
NULL,
NULL,
NULL,
skip_older,
overwrite,
junk_pat... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 73,429,377,886,568,925,000,000,000,000,000,000,000 | 38 | libarchive: sanitize filenames before extracting |
Perl_my_popen(pTHX_ const char *cmd, const char *mode)
{
PERL_FLUSHALL_FOR_CHILD;
/* Call system's popen() to get a FILE *, then import it.
used 0 for 2nd parameter to PerlIO_importFILE;
apparently not used
*/
return PerlIO_importFILE(djgpp_popen(cmd, mode), 0);
} | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | perl5 | 34716e2a6ee2af96078d62b065b7785c001194be | 761,281,306,380,904,800,000,000,000,000,000,000 | 9 | Perl_my_setenv(); handle integer wrap
RT #133204
Wean this function off int/I32 and onto UV/Size_t.
Also, replace all malloc-ish calls with a wrapper that does
overflow checks,
In particular, it was doing (nlen + vlen + 2) which could wrap when
the combined length of the environment variable name and value
exceeded ... |
void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
void *outputStream, GooString *name,
GBool needVerticalMetrics,
int *maxUsedGlyph) {
Guchar headData[54];
TrueTypeLoca *locaTable;
Guchar *locaData;
TrueTypeTable newTables[nT42Tables];
Guchar tableDir[12 + nT42Ta... | 0 | [
"CWE-125"
] | poppler | bf4aae25a244b1033a2479b9a8f633224f7d5de5 | 231,962,303,967,574,700,000,000,000,000,000,000,000 | 321 | Off by one fix to the previous crash fix |
ec_pow3 (gcry_mpi_t w, const gcry_mpi_t b, mpi_ec_t ctx)
{
mpi_powm (w, b, mpi_const (MPI_C_THREE), ctx->p);
} | 0 | [
"CWE-200"
] | libgcrypt | 88e1358962e902ff1cbec8d53ba3eee46407851a | 324,751,720,076,296,500,000,000,000,000,000,000,000 | 4 | ecc: Constant-time multiplication for Weierstrass curve.
* mpi/ec.c (_gcry_mpi_ec_mul_point): Use simple left-to-right binary
method for Weierstrass curve when SCALAR is secure. |
static int jas_iccxyz_output(jas_iccattrval_t *attrval, jas_stream_t *out)
{
jas_iccxyz_t *xyz = &attrval->data.xyz;
if (jas_iccputuint32(out, xyz->x) ||
jas_iccputuint32(out, xyz->y) ||
jas_iccputuint32(out, xyz->z))
return -1;
return 0;
} | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 285,472,644,383,522,470,000,000,000,000,000,000,000 | 9 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
static struct inode *hugetlbfs_get_root(struct super_block *sb,
struct hugetlbfs_config *config)
{
struct inode *inode;
inode = new_inode(sb);
if (inode) {
struct hugetlbfs_inode_info *info;
inode->i_ino = get_next_ino();
inode->i_mode = S_IFDIR | config->mode;
inode->i_uid = config->uid;
inode->i_gi... | 0 | [
"CWE-399"
] | linux | 90481622d75715bfcb68501280a917dbfe516029 | 331,103,774,499,734,250,000,000,000,000,000,000,000 | 22 | hugepages: fix use after free bug in "quota" handling
hugetlbfs_{get,put}_quota() are badly named. They don't interact with the
general quota handling code, and they don't much resemble its behaviour.
Rather than being about maintaining limits on on-disk block usage by
particular users, they are instead about maintai... |
gxps_fonts_new_font_face (GXPSArchive *zip,
const gchar *font_uri,
GError **error)
{
GHashTable *ft_cache;
FtFontFace ft_face;
FtFontFace *ft_font_face;
FT_Face face;
cairo_font_face_t *font_face;
guchar *font_data;
gsize font_data_len;
... | 0 | [
"CWE-125"
] | libgxps | b458226e162fe1ffe7acb4230c114a52ada5131b | 108,477,480,685,497,970,000,000,000,000,000,000,000 | 61 | gxps-archive: Ensure gxps_archive_read_entry() fills the GError in case of failure
And fix the callers to not overwrite the GError. |
static int tty_ldiscs_seq_show(struct seq_file *m, void *v)
{
int i = *(loff_t *)v;
struct tty_ldisc_ops *ldops;
ldops = get_ldops(i);
if (IS_ERR(ldops))
return 0;
seq_printf(m, "%-10s %2d\n", ldops->name ? ldops->name : "???", i);
put_ldops(ldops);
return 0;
} | 0 | [
"CWE-200"
] | linux-stable | dd42bf1197144ede075a9d4793123f7689e164bc | 125,326,083,738,332,920,000,000,000,000,000,000,000 | 12 | tty: Prevent ldisc drivers from re-using stale tty fields
Line discipline drivers may mistakenly misuse ldisc-related fields
when initializing. For example, a failure to initialize tty->receive_room
in the N_GIGASET_M101 line discipline was recently found and fixed [1].
Now, the N_X25 line discipline has been discover... |
int main(int argc, char **argv)
{
struct sigaction sigact = { { 0 } };
int cfg_parsed;
int ret = EXIT_FAILURE;
init_dynload();
config.filename = av_strdup("/etc/ffserver.conf");
parse_loglevel(argc, argv, options);
av_register_all();
avformat_network_init();
show_banner(argc, arg... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | a5d25faa3f4b18dac737fdb35d0dd68eb0dc2156 | 187,457,005,535,439,320,000,000,000,000,000,000,000 | 67 | ffserver: Check chunk size
Fixes out of array access
Fixes: poc_ffserver.py
Found-by: Paul Cher <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static void free_fbind(imp_sth_phb_t *fbind)
{
if (fbind)
Safefree(fbind);
} | 0 | [
"CWE-416"
] | DBD-mysql | a56ae87a4c1c1fead7d09c3653905841ccccf1cc | 222,253,558,524,144,300,000,000,000,000,000,000,000 | 5 | fix use-after-free crash in RT #97625 |
static int stbi__process_frame_header(stbi__jpeg *z, int scan)
{
stbi__context *s = z->s;
int Lf,p,i,q, h_max=1,v_max=1,c;
Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format... | 1 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 285,846,982,414,941,660,000,000,000,000,000,000,000 | 84 | stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.
Fixes issue #1178. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.