func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
cvt_by_tile( TIFF *in, TIFF *out )
{
uint32* raster; /* retrieve RGBA image */
uint32 width, height; /* image width & height */
uint32 tile_width, tile_height;
uint32 row, col;
uint32 *wrk_line;
int ok = 1;
uint32 rastersize, wrk_linesize;
TIFFGetField(in, TIFFTAG_IMAGEWIDT... | 0 | [
"CWE-119"
] | libtiff | 98a254f5b92cea22f5436555ff7fceb12afee84d | 70,911,600,841,497,950,000,000,000,000,000,000,000 | 114 | enforce (configurable) memory limit in tiff2rgba
fixes #207
fixes #209 |
method_entry_loop(mrb_state *mrb, struct RClass* klass, khash_t(st)* set)
{
khint_t i;
khash_t(mt) *h = klass->mt;
if (!h || kh_size(h) == 0) return;
for (i=0;i<kh_end(h);i++) {
if (kh_exist(h, i)) {
mrb_method_t m = kh_value(h, i);
if (MRB_METHOD_UNDEF_P(m)) continue;
kh_put(st, mrb, set... | 0 | [
"CWE-824"
] | mruby | b64ce17852b180dfeea81cf458660be41a78974d | 97,903,008,770,551,770,000,000,000,000,000,000,000 | 14 | Should not call `initialize_copy` for `TT_ICLASS`; fix #4027
Since `TT_ICLASS` is a internal object that should never be revealed
to Ruby world. |
perf_read_hw(struct perf_event *event, char __user *buf, size_t count)
{
u64 read_format = event->attr.read_format;
int ret;
/*
* Return end-of-file for a read on a event that is in
* error state (i.e. because it was pinned but it couldn't be
* scheduled on to the CPU at some point).
*/
if (event->state ==... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8176cced706b5e5d15887584150764894e94e02f | 320,683,288,302,168,900,000,000,000,000,000,000,000 | 24 | perf: Treat attr.config as u64 in perf_swevent_init()
Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().
Introduced in commit b0a873ebb ("perf: Register PMU
implementations").
Signed... |
int rtnl_unregister(int protocol, int msgtype)
{
int msgindex;
BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);
msgindex = rtm_msgindex(msgtype);
if (rtnl_msg_handlers[protocol] == NULL)
return -ENOENT;
rtnl_msg_handlers[protocol][msgindex].doit = NULL;
rtnl_msg_handlers[protocol][msgindex].dumpit = NULL;... | 0 | [
"CWE-399"
] | linux-2.6 | 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 | 113,041,219,704,326,340,000,000,000,000,000,000,000 | 15 | rtnl: fix info leak on RTM_GETLINK request for VF devices
Initialize the mac address buffer with 0 as the driver specific function
will probably not fill the whole buffer. In fact, all in-kernel drivers
fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible
bytes. Therefore we currently leak 26 bytes ... |
smtp_filter_data_end(struct smtp_session *s)
{
if (!SESSION_FILTERED(s))
return;
if (s->tx->filter == NULL)
return;
io_free(s->tx->filter);
s->tx->filter = NULL;
m_create(p_lka, IMSG_FILTER_SMTP_DATA_END, 0, 0, -1);
m_add_id(p_lka, s->id);
m_close(p_lka);
} | 0 | [
"CWE-78",
"CWE-252"
] | src | 9dcfda045474d8903224d175907bfc29761dcb45 | 337,868,009,333,499,540,000,000,000,000,000,000,000 | 15 | Fix a security vulnerability discovered by Qualys which can lead to a
privileges escalation on mbox deliveries and unprivileged code execution
on lmtp deliveries, due to a logic issue causing a sanity check to be
missed.
ok eric@, millert@ |
static inline void adjust_tsc_offset_guest(struct kvm_vcpu *vcpu,
s64 adjustment)
{
kvm_x86_ops->adjust_tsc_offset_guest(vcpu, adjustment);
} | 0 | [
"CWE-369"
] | linux | 0185604c2d82c560dab2f2933a18f797e74ab5a8 | 101,599,013,783,149,830,000,000,000,000,000,000,000 | 5 | KVM: x86: Reload pit counters for all channels when restoring state
Currently if userspace restores the pit counters with a count of 0
on channels 1 or 2 and the guest attempts to read the count on those
channels, then KVM will perform a mod of 0 and crash. This will ensure
that 0 values are converted to 65536 as per... |
static void huf_canonical_code_table(uint64_t *hcode)
{
uint64_t c, n[59] = { 0 };
int i;
for (i = 0; i < HUF_ENCSIZE; ++i)
n[hcode[i]] += 1;
c = 0;
for (i = 58; i > 0; --i) {
uint64_t nc = ((c + n[i]) >> 1);
n[i] = c;
c = nc;
}
for (i = 0; i < HUF_ENCSI... | 0 | [
"CWE-787"
] | FFmpeg | b0a8b40294ea212c1938348ff112ef1b9bf16bb3 | 326,635,261,746,749,300,000,000,000,000,000,000,000 | 22 | avcodec/exr: skip bottom clearing loop when its outside the image
Fixes: signed integer overflow: 1633771809 * 32960 cannot be represented in type 'int'
Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tr... |
TEST(ComparisonsTest, LessEqualInt) {
ComparisonOpModel model({1, 1, 1, 4}, {1, 1, 1, 4}, TensorType_INT32,
BuiltinOperator_LESS_EQUAL);
model.PopulateTensor<int>(model.input1(), {-1, 9, 7, 3});
model.PopulateTensor<int>(model.input2(), {1, 2, 7, 5});
model.Invoke();
EXPECT_THAT(mod... | 0 | [
"CWE-20",
"CWE-703"
] | tensorflow | a989426ee1346693cc015792f11d715f6944f2b8 | 83,845,024,642,246,790,000,000,000,000,000,000,000 | 10 | Improve to cover scale value greater than one
PiperOrigin-RevId: 433050921 |
static void __switch_pg(struct multipath *m, struct pgpath *pgpath)
{
m->current_pg = pgpath->pg;
/* Must we initialise the PG first, and queue I/O till it's ready? */
if (m->hw_handler_name) {
m->pg_init_required = 1;
m->queue_io = 1;
} else {
m->pg_init_required = 0;
m->queue_io = 0;
}
m->pg_init_coun... | 0 | [
"CWE-284",
"CWE-264"
] | linux | ec8013beddd717d1740cfefb1a9b900deef85462 | 227,319,689,348,457,230,000,000,000,000,000,000,000 | 15 | dm: do not forward ioctls from logical volumes to the underlying device
A logical volume can map to just part of underlying physical volume.
In this case, it must be treated like a partition.
Based on a patch from Alasdair G Kergon.
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Signed-off-by: Paolo ... |
xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
const xmlChar *SystemID) {
xmlDtdPtr ret = NULL;
xmlParserCtxtPtr ctxt;
xmlParserInputPtr input = NULL;
xmlCharEncoding enc;
xmlChar* systemIdCanonic;
if ((ExternalID == NULL) && (SystemID == NULL)) return... | 0 | [] | libxml2 | be2a7edaf289c5da74a4f9ed3a0b6c733e775230 | 328,364,526,641,396,360,000,000,000,000,000,000,000 | 118 | Fix for CVE-2014-3660
Issues related to the billion laugh entity expansion which happened to
escape the initial set of fixes |
ecma_bigint_to_string (ecma_value_t value, /**< BigInt value */
ecma_bigint_digit_t radix) /**< conversion radix */
{
JERRY_ASSERT (ecma_is_value_bigint (value));
if (value == ECMA_BIGINT_ZERO)
{
return ecma_new_ecma_string_from_code_unit (LIT_CHAR_0);
}
uint32_t char_start_p, cha... | 0 | [
"CWE-416"
] | jerryscript | 3bcd48f72d4af01d1304b754ef19fe1a02c96049 | 62,558,372,063,735,560,000,000,000,000,000,000,000 | 33 | Improve parse_identifier (#4691)
Ascii string length is no longer computed during string allocation.
JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com |
static void gen_rot_rm_T1(DisasContext *s, TCGMemOp ot, int op1, int is_right)
{
target_ulong mask = (ot == MO_64 ? 0x3f : 0x1f);
TCGv_i32 t0, t1;
/* load */
if (op1 == OR_TMP0) {
gen_op_ld_v(s, ot, cpu_T0, cpu_A0);
} else {
gen_op_mov_v_reg(ot, cpu_T0, op1);
}
tcg_gen_andi... | 0 | [
"CWE-94"
] | qemu | 30663fd26c0307e414622c7a8607fbc04f92ec14 | 201,842,630,433,638,030,000,000,000,000,000,000,000 | 84 | tcg/i386: Check the size of instruction being translated
This fixes the bug: 'user-to-root privesc inside VM via bad translation
caching' reported by Jann Horn here:
https://bugs.chromium.org/p/project-zero/issues/detail?id=1122
Reviewed-by: Richard Henderson <rth@twiddle.net>
CC: Peter Maydell <peter.maydell@linaro.... |
GF_Err subs_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_SubSampleInformationBox *ptr = (GF_SubSampleInformationBox *)s;
u32 entry_count, i, j;
u16 subsample_count;
ISOM_DECREASE_SIZE(ptr, 4);
entry_count = gf_bs_read_u32(bs);
for (i=0; i<entry_count; i++) {
u32 subs_size=0;
GF_SubSampleInfoEntry *pSamp = (G... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 234,803,365,488,129,900,000,000,000,000,000,000,000 | 44 | fixed #1587 |
static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
if (nested_cpu_has_preemption_timer(get_vmcs12(vcpu)) &&
vmx->nested.preemption_timer_expired) {
if (vmx->nested.nested_run_pending)
return -EBUSY;
nested_vmx_vmexit(vcpu, EXIT_REASON_PREE... | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 268,403,079,948,166,460,000,000,000,000,000,000,000 | 37 | kvm: vmx: handle invvpid vm exit gracefully
On systems with invvpid instruction support (corresponding bit in
IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid
causes vm exit, which is currently not handled and results in
propagation of unknown exit to userspace.
Fix this by installing an invvpid vm exit ... |
static inline void skip_same_name(struct cache_entry *ce, struct unpack_trees_options *o)
{
int len = ce_namelen(ce);
const struct index_state *index = o->src_index;
while (o->pos < index->cache_nr) {
struct cache_entry *next = index->cache[o->pos];
if (len != ce_namelen(next))
break;
if (memcmp(ce->name, ... | 0 | [
"CWE-119"
] | git | fd55a19eb1d49ae54008d932a65f79cd6fda45c9 | 74,444,564,226,678,100,000,000,000,000,000,000,000 | 14 | Fix buffer overflow in git diff
If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com> |
static inline __must_check bool pipe_buf_get(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
return buf->ops->get(pipe, buf);
} | 0 | [
"CWE-416"
] | linux | 15fab63e1e57be9fdb5eec1bbc5916e9825e9acb | 254,578,290,959,942,930,000,000,000,000,000,000,000 | 5 | fs: prevent page refcount overflow in pipe_buf_get
Change pipe_buf_get() to return a bool indicating whether it succeeded
in raising the refcount of the page (if the thing in the pipe is a page).
This removes another mechanism for overflowing the page refcount. All
callers converted to handle a failure.
Reported-by:... |
static inline int xrstor_state(struct xsave_struct *fx, u64 mask)
{
int err = 0;
u32 lmask = mask;
u32 hmask = mask >> 32;
/*
* Use xrstors to restore context if it is enabled. xrstors supports
* compacted format of xsave area which is not supported by xrstor.
*/
alternative_input(
"1: " XRSTOR,
"1: " X... | 1 | [
"CWE-20"
] | linux | 06c8173eb92bbfc03a0fe8bb64315857d0badd06 | 276,792,979,421,527,450,000,000,000,000,000,000,000 | 24 | x86/fpu/xsaves: Fix improper uses of __ex_table
Commit:
f31a9f7c7169 ("x86/xsaves: Use xsaves/xrstors to save and restore xsave area")
introduced alternative instructions for XSAVES/XRSTORS and commit:
adb9d526e982 ("x86/xsaves: Add xsaves and xrstors support for booting time")
added support for the XSAVES/XRS... |
pixGetBackgroundRGBMap(PIX *pixs,
PIX *pixim,
PIX *pixg,
l_int32 sx,
l_int32 sy,
l_int32 thresh,
l_int32 mincount,
PIX **ppixmr,
... | 0 | [
"CWE-125"
] | leptonica | 3c18c43b6a3f753f0dfff99610d46ad46b8bfac4 | 211,241,834,212,266,700,000,000,000,000,000,000,000 | 171 | Fixing oss-fuzz issue 22512: Heap-buffer-overflow in rasteropGeneralLow()
* Simplified the hole-filling function
` |
size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx)
{
#ifdef ZSTD_MULTITHREAD
if (cctx->appliedParams.nbWorkers > 0) {
return ZSTDMT_toFlushNow(cctx->mtctx);
}
#endif
(void)cctx;
return 0; /* over-simplification; could also check if context is currently running in streaming mode, and in which case, report... | 0 | [
"CWE-362"
] | zstd | 3e5cdf1b6a85843e991d7d10f6a2567c15580da0 | 150,021,077,559,913,130,000,000,000,000,000,000,000 | 10 | fixed T36302429 |
template <class MessageType> static void validate(const MessageType& message) {
MessageUtil::validate(message, ProtobufMessage::getStrictValidationVisitor());
} | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 127,387,277,455,044,180,000,000,000,000,000,000,000 | 3 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
mwifiex_wmm_get_ralist_node(struct mwifiex_private *priv, u8 tid,
const u8 *ra_addr)
{
struct mwifiex_ra_list_tbl *ra_list;
list_for_each_entry(ra_list, &priv->wmm.tid_tbl_ptr[tid].ra_list,
list) {
if (!memcmp(ra_list->ra, ra_addr, ETH_ALEN))
return ra_list;
}
return NULL;
} | 0 | [
"CWE-787"
] | linux | 3a9b153c5591548612c3955c9600a98150c81875 | 114,329,690,678,295,450,000,000,000,000,000,000,000 | 13 | mwifiex: Fix possible buffer overflows in mwifiex_ret_wmm_get_status()
mwifiex_ret_wmm_get_status() calls memcpy() without checking the
destination size.Since the source is given from remote AP which
contains illegal wmm elements , this may trigger a heap buffer
overflow.
Fix it by putting the length check before call... |
filepos_t KaxInternalBlock::UpdateSize(bool /* bSaveDefault */, bool /* bForceRender */)
{
LacingType LacingHere;
assert(EbmlBinary::GetBuffer() == NULL); // Data is not used for KaxInternalBlock
assert(TrackNumber < 0x4000); // no more allowed for the moment
unsigned int i;
// compute the final size of the ... | 0 | [
"CWE-200",
"CWE-399",
"CWE-119"
] | libmatroska | 0a2d3e3644a7453b6513db2f9bc270f77943573f | 85,568,125,270,270,980,000,000,000,000,000,000,000 | 52 | KaxBlockInternal: check EBML lace sizes against available buffer space |
yang_check_bit(struct ly_ctx *ctx, struct yang_type *typ, struct lys_type_bit *bit, int64_t *value, int assign)
{
int i,j;
if (!assign) {
/* assign value automatically */
if (*value > UINT32_MAX) {
LOGVAL(ctx, LYE_INARG, LY_VLOG_NONE, NULL, "4294967295", "bit/position");
... | 0 | [
"CWE-415"
] | libyang | d9feacc4a590d35dbc1af21caf9080008b4450ed | 235,756,929,829,288,620,000,000,000,000,000,000,000 | 29 | yang parser BUGFIX double free
Fixes #742 |
onig_free_shared_cclass_table(void)
{
if (IS_NOT_NULL(OnigTypeCClassTable)) {
onig_st_foreach(OnigTypeCClassTable, i_free_shared_class, 0);
onig_st_free_table(OnigTypeCClassTable);
OnigTypeCClassTable = NULL;
}
return 0;
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 113,974,284,455,491,980,000,000,000,000,000,000,000 | 10 | onig-5.9.2 |
njs_string_eq(const njs_value_t *v1, const njs_value_t *v2)
{
size_t size, length1, length2;
const u_char *start1, *start2;
size = v1->short_string.size;
if (size != v2->short_string.size) {
return 0;
}
if (size != NJS_STRING_LONG) {
length1 = v1->short_string.length;
... | 0 | [] | njs | 36f04a3178fcb6da8513cc3dbf35215c2a581b3f | 158,791,580,454,675,130,000,000,000,000,000,000,000 | 50 | Fixed String.prototype.replace() with byte strings.
This closes #522 issue on Github. |
dwg_encode_common_entity_handle_data (Bit_Chain *dat, Bit_Chain *hdl_dat,
Dwg_Object *restrict obj)
{
Dwg_Object_Entity *ent;
// Dwg_Data *dwg = obj->parent;
Dwg_Object_Entity *_obj;
BITCODE_BL vcount;
int error = 0;
ent = obj->tio.entity;
_obj = ent;
// clang-form... | 0 | [
"CWE-703",
"CWE-835"
] | libredwg | c6f6668b82bfe595899cc820279ac37bb9ef16f5 | 208,476,207,362,250,400,000,000,000,000,000,000,000 | 17 | cleanup tio.unknown
not needed anymore, we only have UNKNOWN_OBJ or UNKNOWN_ENT with full common
entity_data.
Fixes GH #178 heap_overflow2 |
int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
uint t1_keys, uint t1_recs,
MI_KEYDEF *t2_keyinfo, MI_COLUMNDEF *t2_recinfo,
uint t2_keys, uint t2_recs, bool strict, TABLE *table_arg)
{
uint i, j;
DBUG_ENTER("check_definition");
... | 0 | [
"CWE-362"
] | mysql-server | 4e5473862e6852b0f3802b0cd0c6fa10b5253291 | 156,803,955,702,608,700,000,000,000,000,000,000,000 | 125 | Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD)
is created. When repair finishes, this file is renamed to the original
.MYD file. The problem was that during this rename, we copied the
stats from the old file to the new file w... |
check_special_mountprog(const char *spec, const char *node, const char *type, int flags,
char *extra_opts, int *status) {
char search_path[] = FS_SEARCH_PATH;
char *path, mountprog[150];
struct stat statbuf;
int res;
if (!external_allowed)
return 0;
if (type == NULL || strcmp(type, "none") == 0)
return 0... | 0 | [
"CWE-200"
] | util-linux | 0377ef91270d06592a0d4dd009c29e7b1ff9c9b8 | 91,515,715,718,570,070,000,000,000,000,000,000,000 | 99 | mount: (deprecated) drop --guess-fstype
The option is undocumented and unnecessary.
Signed-off-by: Karel Zak <kzak@redhat.com> |
tracing_buffers_poll(struct file *filp, poll_table *poll_table)
{
struct ftrace_buffer_info *info = filp->private_data;
struct trace_iterator *iter = &info->iter;
return trace_poll(iter, filp, poll_table);
} | 0 | [
"CWE-415"
] | linux | 4397f04575c44e1440ec2e49b6302785c95fd2f8 | 121,259,708,359,406,350,000,000,000,000,000,000,000 | 7 | 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... |
sound_save ()
{
int fd, i;
char buf[512];
fd = hexchat_open_file ("sound.conf", O_CREAT | O_TRUNC | O_WRONLY, 0x180,
XOF_DOMODE);
if (fd == -1)
return;
for (i = 0; i < NUM_XP; i++)
{
if (sound_files[i] && sound_files[i][0])
{
write (fd, buf, g_snprintf (buf, sizeof (buf),
"event=%... | 0 | [
"CWE-22"
] | hexchat | 15600f405f2d5bda6ccf0dd73957395716e0d4d3 | 106,755,751,067,739,740,000,000,000,000,000,000,000 | 23 | Sanitize network name for scrollback files
This prevents using invalid chars on Windows or creating directories |
TEST_F(OAuth2Test, OAuthOkPassButInvalidToken) {
init(getConfig(false /* forward_bearer_token */));
Http::TestRequestHeaderMapImpl mock_request_headers{
{Http::Headers::get().Path.get(), "/anypath"},
{Http::Headers::get().Host.get(), "traffic.example.com"},
{Http::Headers::get().Method.get(), Htt... | 0 | [
"CWE-416"
] | envoy | 7ffda4e809dec74449ebc330cebb9d2f4ab61360 | 51,625,571,159,343,520,000,000,000,000,000,000,000 | 35 | oauth2: do not blindly accept requests with a token in the Authorization headera (781)
The logic was broken because it assumed an additional call would be
performed to the auth server, which isn't the case. Per the filter
documentation, a request is only considered subsequently authenticated
if there's valid cookie th... |
OJPEGWriteStreamAcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
if (sp->actable[table_index]!=0)
{
*mem=(void*)(sp->actable[table_index]+sizeof(uint32));
*len=*((uint32*)sp->actable[table_index])-sizeof(uint32);
}
sp->out_state++;
} | 0 | [
"CWE-369"
] | libtiff | 43bc256d8ae44b92d2734a3c5bc73957a4d7c1ec | 34,718,524,246,258,090,000,000,000,000,000,000,000 | 10 | * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611 |
undo_allowed(void)
{
/* Don't allow changes when 'modifiable' is off. */
if (!curbuf->b_p_ma)
{
EMSG(_(e_modifiable));
return FALSE;
}
#ifdef HAVE_SANDBOX
/* In the sandbox it's not allowed to change the text. */
if (sandbox != 0)
{
EMSG(_(e_sandbox));
return FALSE;
}
#endif
/... | 0 | [
"CWE-190"
] | vim | 3eb1637b1bba19519885dd6d377bd5596e91d22c | 180,865,902,339,237,660,000,000,000,000,000,000,000 | 28 | 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 fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
unsigned long cr3, cr4;
/* Record the guest's net vcpu time for enforced NMI injections. */
if (unlikely(!enable_vnmi &&
vmx->loaded_vmcs->soft_vnmi_blocked))
vmx->loaded_vmcs->entry_time = ktime_get();
/*
* D... | 0 | [
"CWE-703"
] | linux | 6cd88243c7e03845a450795e134b488fc2afb736 | 284,464,503,100,774,150,000,000,000,000,000,000,000 | 193 | KVM: x86: do not report a vCPU as preempted outside instruction boundaries
If a vCPU is outside guest mode and is scheduled out, it might be in the
process of making a memory access. A problem occurs if another vCPU uses
the PV TLB flush feature during the period when the vCPU is scheduled
out, and a virtual address ... |
switchUser(uid_t uid, const struct passwd *userInfo) {
if (setuid(uid) == -1) {
int e = errno;
fprintf(stderr, "setuid(%d) failed: %s (errno=%d)\n",
(int) uid, strerror(e), e);
exit(1);
}
if (userInfo != NULL) {
setenv("USER", userInfo->pw_name, 1);
setenv("LOGNAME", userInfo->pw_name, 1);
setenv("SHE... | 0 | [
"CWE-284",
"CWE-732"
] | passenger | 4e97fdb86d0a0141ec9a052c6e691fcd07bb45c8 | 92,965,762,763,786,000,000,000,000,000,000,000,000 | 19 | ExecHelperMain: fix privilege lowering code |
start_user_session_if_ready (GdmManager *manager,
GdmSession *session,
const char *service_name)
{
gboolean start_when_ready;
start_when_ready = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (session), "start-when-ready"));
if (start_when... | 0 | [] | gdm | ff98b2817014684ae1acec78ff06f0f461a56a9f | 59,317,934,562,095,170,000,000,000,000,000,000,000 | 14 | manager: if falling back to X11 retry autologin
Right now, we get one shot to autologin. If it fails, we fall back to
the greeter. We should give it another go if the reason for the failure
was wayland fallback to X.
https://bugzilla.gnome.org/show_bug.cgi?id=780520 |
void Http2Session::Origin(const Origins& origins) {
Http2Scope h2scope(this);
CHECK_EQ(nghttp2_submit_origin(
session_.get(),
NGHTTP2_FLAG_NONE,
*origins,
origins.length()), 0);
} | 0 | [
"CWE-416"
] | node | a3c33d4ce78f74d1cf1765704af5b427aa3840a6 | 147,863,872,032,501,920,000,000,000,000,000,000,000 | 8 | http2: update handling of rst_stream with error code NGHTTP2_CANCEL
The PR updates the handling of rst_stream frames and adds all streams
to the pending list on receiving rst frames with the error code
NGHTTP2_CANCEL.
The changes will remove dependency on the stream state that may allow
bypassing the checks in certai... |
static NTSTATUS dcesrv_lsa_QueryTrustedDomainInfoBySid(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct lsa_QueryTrustedDomainInfoBySid *r)
{
NTSTATUS status;
struct lsa_OpenTrustedDomain opn = {{0},{0}};
struct lsa_QueryTrustedDomainInfo query;
struct dcesrv_handle *h;
opn.in.handle = r->in.... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 73,824,664,024,747,225,000,000,000,000,000,000,000 | 34 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
parse_pop_vlan(struct ofpbuf *ofpacts)
{
ofpact_put_STRIP_VLAN(ofpacts)->ofpact.raw = OFPAT_RAW11_POP_VLAN;
return NULL;
} | 0 | [
"CWE-125"
] | ovs | 9237a63c47bd314b807cda0bd2216264e82edbe8 | 331,667,274,359,043,840,000,000,000,000,000,000,000 | 5 | ofp-actions: Avoid buffer overread in BUNDLE action decoding.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
TfLiteRegistration Register_GATHER_ND() {
return tflite::micro::RegisterOp(nullptr, Prepare, Eval);
} | 0 | [
"CWE-703"
] | tflite-micro | 4142e47e9e31db481781b955ed3ff807a781b494 | 125,376,373,313,813,600,000,000,000,000,000,000,000 | 3 | GatherNd verifies that an index is valid before reading. (#1286) |
evdev_button_scroll_button(struct evdev_device *device,
uint64_t time, int is_press)
{
/* Where the button lock is enabled, we wrap the buttons into
their own little state machine and filter out the events.
*/
switch (device->scroll.lock_state) {
case BUTTONSCROLL_LOCK_DISABLED:
break;
case BUTTONSCRO... | 0 | [
"CWE-134"
] | libinput | 562157f2a56537f353ca49b194efeb770004ba63 | 278,508,622,037,033,650,000,000,000,000,000,000,000 | 86 | evdev: strip the device name of format directives
This fixes a format string vulnerabilty.
evdev_log_message() composes a format string consisting of a fixed
prefix (including the rendered device name) and the passed-in format
buffer. This format string is then passed with the arguments to the
actual log handler, whi... |
static int handle_uid_request(enum request_types request_type, uid_t uid,
const char *domain_name, struct berval **berval)
{
int ret;
struct passwd pwd;
char *sid_str = NULL;
enum sss_id_type id_type;
size_t buf_len;
char *buf = NULL;
struct sss_nss_kv *kv_list ... | 1 | [
"CWE-19"
] | freeipa | c15a407cbfaed163a933ab137eed16387efe25d2 | 236,444,270,901,252,200,000,000,000,000,000,000,000 | 66 | extdom: make nss buffer configurable
The get*_r_wrapper() calls expect a maximum buffer size to avoid memory
shortage if too many threads try to allocate buffers e.g. for large
groups. With this patch this size can be configured by setting
ipaExtdomMaxNssBufSize in the plugin config object
cn=ipa_extdom_extop,cn=plugi... |
void *ndpi_realloc(void *ptr, size_t old_size, size_t new_size) {
void *ret = ndpi_malloc(new_size);
if(!ret)
return(ret);
else {
memcpy(ret, ptr, old_size);
ndpi_free(ptr);
return(ret);
}
} | 0 | [
"CWE-416",
"CWE-787"
] | nDPI | 6a9f5e4f7c3fd5ddab3e6727b071904d76773952 | 175,257,118,757,836,230,000,000,000,000,000,000,000 | 11 | Fixed use after free caused by dangling pointer
* This fix also improved RCE Injection detection
Signed-off-by: Toni Uhlig <matzeton@googlemail.com> |
static int fts3EvalStart(Fts3Cursor *pCsr){
Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab;
int rc = SQLITE_OK;
int nToken = 0;
int nOr = 0;
/* Allocate a MultiSegReader for each token in the expression. */
fts3EvalAllocateReaders(pCsr, pCsr->pExpr, &nToken, &nOr, &rc);
/* Determine which, if any, toke... | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 107,622,603,729,575,850,000,000,000,000,000,000,000 | 46 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
static BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, UINT16 length)
{
UINT32 drawNineGridSupportLevel;
UINT16 DrawNineGridCacheSize;
UINT16 DrawNineGridCacheEntries;
WLog_INFO(TAG, "DrawNineGridCacheCapabilitySet (length %" PRIu16 "):", length);
if (length < 12)
return FALSE;
Stream_Read_UINT... | 0 | [
"CWE-119",
"CWE-125"
] | FreeRDP | 3627aaf7d289315b614a584afb388f04abfb5bbf | 99,697,391,840,067,470,000,000,000,000,000,000,000 | 15 | Fixed #6011: Bounds check in rdp_read_font_capability_set |
static struct sctp_auth_bytes *sctp_auth_create_key(__u32 key_len, gfp_t gfp)
{
struct sctp_auth_bytes *key;
/* Verify that we are not going to overflow INT_MAX */
if ((INT_MAX - key_len) < sizeof(struct sctp_auth_bytes))
return NULL;
/* Allocate the shared key */
key = kmalloc(sizeof(struct sctp_auth_bytes) +... | 0 | [
"CWE-189"
] | linux-2.6 | 30c2235cbc477d4629983d440cdc4f496fec9246 | 322,462,238,085,328,430,000,000,000,000,000,000,000 | 19 | sctp: add verification checks to SCTP_AUTH_KEY option
The structure used for SCTP_AUTH_KEY option contains a
length that needs to be verfied to prevent buffer overflow
conditions. Spoted by Eugene Teo <eteo@redhat.com>.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@da... |
CmdDropRole() : BasicCommand("dropRole") {} | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 94,963,541,260,679,680,000,000,000,000,000,000,000 | 1 | SERVER-38984 Validate unique User ID on UserCache hit |
void hamming(float *w, int N)
{
for (int i = 0; i < N; i++)
{
w[i] = (float)(0.54 - 0.46 * cos(TWOPI * i / (N - 1)));
}
}
| 0 | [
"CWE-617"
] | soundtouch | a1c400eb2cff849c0e5f9d6916d69ffea3ad2c85 | 271,250,469,061,164,150,000,000,000,000,000,000,000 | 8 | Fix issue CVE-2018-17096: Replace assert with runtime exception |
static int handle_pcommit(struct kvm_vcpu *vcpu)
{
/* we never catch pcommit instruct for L1 guest. */
WARN_ON(1);
return 1;
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 3ce424e45411cf5a13105e0386b6ecf6eeb4f66f | 244,759,146,288,744,300,000,000,000,000,000,000,000 | 6 | kvm:vmx: more complete state update on APICv on/off
The function to update APICv on/off state (in particular, to deactivate
it when enabling Hyper-V SynIC) is incomplete: it doesn't adjust
APICv-related fields among secondary processor-based VM-execution
controls. As a result, Windows 2012 guests get stuck when SynIC... |
static int robots_fsio_unlink(pr_fs_t *fs, const char *path) {
return 0;
} | 0 | [
"CWE-59",
"CWE-295"
] | proftpd | 349addc3be4fcdad9bd4ec01ad1ccd916c898ed8 | 264,051,269,670,252,530,000,000,000,000,000,000,000 | 3 | Walk the entire DefaultRoot path, checking for symlinks of any component,
when AllowChrootSymlinks is disabled. |
static X509 *lookup_cert_match(X509_STORE_CTX *ctx, X509 *x)
{
STACK_OF(X509) *certs;
X509 *xtmp = NULL;
int i;
/* Lookup all certs with matching subject name */
certs = ctx->lookup_certs(ctx, X509_get_subject_name(x));
if (certs == NULL)
return NULL;
/* Look for exact match */
f... | 0 | [
"CWE-295"
] | openssl | 2a40b7bc7b94dd7de897a74571e7024f0cf0d63b | 293,785,376,966,044,740,000,000,000,000,000,000,000 | 21 | check_chain_extensions: Do not override error return value by check_curve
The X509_V_FLAG_X509_STRICT flag enables additional security checks of the
certificates present in a certificate chain. It is not set by default.
Starting from OpenSSL version 1.1.1h a check to disallow certificates with
explicitly encoded elli... |
Field *default_field() const { return m_default_field; } | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 211,157,365,189,154,300,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 ... |
tcp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *tcp_info)
{
seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr;
const struct tcpheader *tcph = (const struct tcpheader *)tcp_info;
const char* flags;
seq_analysis_item_t *sai = sequence_analysis_create_sa... | 0 | [
"CWE-354"
] | wireshark | 7f3fe6164a68b76d9988c4253b24d43f498f1753 | 127,369,138,032,096,000,000,000,000,000,000,000,000 | 39 | TCP: do not use an unknown status when the checksum is 0xffff
Otherwise it triggers an assert when adding the column as the field is
defined as BASE_NONE and not BASE_DEC or BASE_HEX. Thus an unknown value
(not in proto_checksum_vals[)array) cannot be represented.
Mark the checksum as bad even if we process the packet... |
void rfbScaledScreenUpdateRect(rfbScreenInfoPtr screen, rfbScreenInfoPtr ptr, int x0, int y0, int w0, int h0)
{
int x,y,w,v,z;
int x1, y1, w1, h1;
int bitsPerPixel, bytesPerPixel, bytesPerLine, areaX, areaY, area2;
unsigned char *srcptr, *dstptr;
/* Nothing to do!!! */
if (screen==ptr) return;
... | 1 | [
"CWE-190",
"CWE-787"
] | libvncserver | a6788d1da719ae006605b78d22f5a9f170b423af | 295,503,009,586,478,470,000,000,000,000,000,000,000 | 122 | libvncserver: scale: cast to 64 bit before shifting
Since pixel_value is 64 bit the data type of the shift operand should
be 64 bit too to prevent integer overflows. |
static coroutine_fn int qcow2_co_readv(BlockDriverState *bs, int64_t sector_num,
int remaining_sectors, QEMUIOVector *qiov)
{
BDRVQcowState *s = bs->opaque;
int index_in_cluster, n1;
int ret;
int cur_nr_sectors; /* number of sectors in current iteration */
uint64_t cluster_... | 0 | [
"CWE-476"
] | qemu | 11b128f4062dd7f89b14abc8877ff20d41b28be9 | 11,254,746,365,532,535,000,000,000,000,000,000,000 | 136 | 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 int profile_device_accept(struct btd_service *service)
{
struct btd_profile *p = btd_service_get_profile(service);
DBG("%s accept", p->name);
return 0;
} | 0 | [
"CWE-416"
] | bluez | 838c0dc7641e1c991c0f3027bf94bee4606012f8 | 277,654,384,581,258,200,000,000,000,000,000,000,000 | 8 | gatt: Fix not cleaning up when disconnected
There is a current use after free possible on a gatt server if a client
disconnects while a WriteValue call is being processed with dbus.
This patch includes the addition of a pending disconnect callback to handle
cleanup better if a disconnect occurs during a write, an acq... |
static void add_partial(struct kmem_cache_node *n,
struct page *page, int tail)
{
spin_lock(&n->list_lock);
n->nr_partial++;
if (tail)
list_add_tail(&page->lru, &n->partial);
else
list_add(&page->lru, &n->partial);
spin_unlock(&n->list_lock);
} | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 216,496,484,358,949,900,000,000,000,000,000,000,000 | 11 | remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for
div_long_long_rem and it has the downside that one has to be very careful that
the divide doesn't overflow.
The API is a little akward, as the arguments for the unsigned divide are
signed. The signed version also doesn't handle ... |
void CLASS sony_decrypt (unsigned *data, int len, int start, int key)
{
// TODO: The following static variables are not thread-safe
static unsigned pad[128], p;
if (start) {
for (p=0; p < 4; p++)
pad[p] = key = key * 48828125 + 1;
pad[3] = pad[3] << 1 | (pad[0]^pad[2]) >> 31;
for (p=4; p < 127;... | 0 | [
"CWE-189"
] | rawstudio | 983bda1f0fa5fa86884381208274198a620f006e | 281,445,229,113,937,940,000,000,000,000,000,000,000 | 17 | Avoid overflow in ljpeg_start(). |
static int open_pack_bitmap_1(struct packed_git *packfile)
{
int fd;
struct stat st;
char *idx_name;
if (open_pack_index(packfile))
return -1;
idx_name = pack_bitmap_filename(packfile);
fd = git_open_noatime(idx_name);
free(idx_name);
if (fd < 0)
return -1;
if (fstat(fd, &st)) {
close(fd);
return -... | 0 | [
"CWE-119",
"CWE-787"
] | git | de1e67d0703894cb6ea782e36abb63976ab07e60 | 18,454,857,623,186,373,000,000,000,000,000,000,000 | 42 | list-objects: pass full pathname to callbacks
When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and ... |
int tty_standard_install(struct tty_driver *driver, struct tty_struct *tty)
{
int ret = tty_init_termios(tty);
if (ret)
return ret;
tty_driver_kref_get(driver);
tty->count++;
driver->ttys[tty->index] = tty;
return 0;
} | 0 | [
"CWE-200",
"CWE-362"
] | linux | 5c17c861a357e9458001f021a7afa7aab9937439 | 140,635,463,038,782,200,000,000,000,000,000,000,000 | 11 | tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios via ioctl(TCSETS*) without actually
changing the line discipline via ioctl(TIOCSETD).
However... |
static void ct_show_delta_time(struct seq_file *s, const struct nf_conn *ct)
{
struct ct_iter_state *st = s->private;
struct nf_conn_tstamp *tstamp;
s64 delta_time;
tstamp = nf_conn_tstamp_find(ct);
if (tstamp) {
delta_time = st->time_now - tstamp->start;
if (delta_time > 0)
delta_time = div_s64(delta_time... | 0 | [
"CWE-203"
] | linux | 2671fa4dc0109d3fb581bc3078fdf17b5d9080f6 | 147,211,648,678,126,800,000,000,000,000,000,000,000 | 19 | netfilter: conntrack: Make global sysctls readonly in non-init netns
These sysctls point to global variables:
- NF_SYSCTL_CT_MAX (&nf_conntrack_max)
- NF_SYSCTL_CT_EXPECT_MAX (&nf_ct_expect_max)
- NF_SYSCTL_CT_BUCKETS (&nf_conntrack_htable_size_user)
Because their data pointers are not updated to point to per-netns
s... |
Perl_croak_no_modify(void)
{
Perl_croak_nocontext( "%s", PL_no_modify);
} | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | perl5 | 34716e2a6ee2af96078d62b065b7785c001194be | 307,487,825,394,782,800,000,000,000,000,000,000,000 | 4 | 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 ... |
inline bool SegmentReader::containsInterval(const void* from, const void* to) {
uintptr_t start = reinterpret_cast<uintptr_t>(from) - reinterpret_cast<uintptr_t>(ptr.begin());
uintptr_t end = reinterpret_cast<uintptr_t>(to) - reinterpret_cast<uintptr_t>(ptr.begin());
uintptr_t bound = ptr.size() * sizeof(capnp::w... | 0 | [
"CWE-20"
] | capnproto | 52bc956459a5e83d7c31be95763ff6399e064ae4 | 49,704,559,053,194,500,000,000,000,000,000,000,000 | 13 | SECURITY: Prevent compiler from eliding bounds checks.
Details: https://github.com/sandstorm-io/capnproto/blob/master/security-advisories/2017-04-17-0-apple-32bit-elides-bounds-check.md |
void set_slave_skip_errors(char** slave_skip_errors_ptr)
{
DBUG_ENTER("set_slave_skip_errors");
print_slave_skip_errors();
*slave_skip_errors_ptr= slave_skip_error_names;
DBUG_VOID_RETURN;
} | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 93,720,629,320,478,660,000,000,000,000,000,000,000 | 7 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
const request_rec *r,
int subtype,
ap_filter_t *next_filter)
{
request_rec *rnew;
... | 0 | [] | httpd | eb986059aa5aa0b6c1d52714ea83e3dd758afdd1 | 142,519,791,789,430,620,000,000,000,000,000,000,000 | 128 | Merge r1889036 from trunk:
legacy default slash-matching behavior w/ 'MergeSlashes OFF'
Submitted By: Ruediger Pluem
Reviewed By: covener, rpluem, ylavic
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889038 13f79535-47bb-0310-9956-ffa450edef68 |
static inline void *AcquireCriticalMemory(const size_t size)
{
register void
*memory;
/*
Fail if memory request cannot be fulfilled.
*/
memory=AcquireMagickMemory(size);
if (memory == (void *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
return(memory);
} | 0 | [
"CWE-476"
] | ImageMagick | cca91aa1861818342e3d072bb0fad7dc4ffac24a | 333,106,930,802,485,440,000,000,000,000,000,000,000 | 13 | https://github.com/ImageMagick/ImageMagick/issues/790 |
static bool confirm_name_timeout(gpointer user_data)
{
struct btd_adapter *adapter = user_data;
btd_error(adapter->dev_id, "Confirm name timed out for hci%u",
adapter->dev_id);
adapter->confirm_name_timeout = 0;
mgmt_cancel(adapter->mgmt, adapter->confirm_name_id);
adapter->confirm_name_id = 0;
return ... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 171,524,100,168,521,850,000,000,000,000,000,000,000 | 14 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
static int read_new_config_info (WavpackContext *wpc, WavpackMetadata *wpmd)
{
int bytecnt = wpmd->byte_length;
unsigned char *byteptr = wpmd->data;
wpc->version_five = 1; // just having this block signals version 5.0
wpc->file_format = wpc->config.qmode = wpc->channel_layout = 0;
if (wpc->c... | 0 | [
"CWE-125"
] | WavPack | 4bc05fc490b66ef2d45b1de26abf1455b486b0dc | 230,717,473,443,410,340,000,000,000,000,000,000,000 | 67 | fixes for 4 fuzz failures posted to SourceForge mailing list |
static int signr_convert(int sig)
{
#ifdef CONFIG_X86_32
struct thread_info *info = current_thread_info();
if (info->exec_domain && info->exec_domain->signal_invmap && sig < 32)
return info->exec_domain->signal_invmap[sig];
#endif /* CONFIG_X86_32 */
return sig;
} | 0 | [
"CWE-400"
] | linux-stable-rt | bcf6b1d78c0bde228929c388978ed3af9a623463 | 231,546,972,277,335,300,000,000,000,000,000,000,000 | 10 | signal/x86: Delay calling signals in atomic
On x86_64 we must disable preemption before we enable interrupts
for stack faults, int3 and debugging, because the current task is using
a per CPU debug stack defined by the IST. If we schedule out, another task
can come in and use the same stack and cause the stack to be co... |
static int read_next_log_rec(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)
{
int err;
err = find_client_next_lsn(log, lcb, lsn);
if (err)
return err;
if (!*lsn)
return 0;
if (lcb->alloc)
kfree(lcb->log_rec);
lcb->log_rec = NULL;
lcb->alloc = false;
kfree(lcb->lrh);
lcb->lrh = NULL;
return find_l... | 0 | [
"CWE-416"
] | linux | f26967b9f7a830e228bb13fb41bd516ddd9d789d | 36,057,331,065,812,136,000,000,000,000,000,000,000 | 21 | fs/ntfs3: Fix invalid free in log_replay
log_read_rst() returns ENOMEM error when there is not enough memory.
In this case, if info is returned without initialization,
it attempts to kfree the uninitialized info->r_page pointer. This patch
moves the memset initialization code to before log_read_rst() is called.
Repor... |
Method* InstanceKlass::find_local_method(const Symbol* name,
const Symbol* signature,
OverpassLookupMode overpass_mode,
StaticLookupMode static_mode,
Privat... | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 160,692,831,845,319,870,000,000,000,000,000,000,000 | 12 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
static double mp_isnan(_cimg_math_parser& mp) {
return (double)cimg::type<double>::is_nan(_mp_arg(2));
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 103,099,740,265,284,110,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
PHP_FUNCTION(stream_set_read_buffer)
{
zval *arg1;
int ret;
long arg2;
size_t buff;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, &arg1);
buff = arg2;
/* if buff is 0 then set to non-buffered */
if... | 0 | [
"CWE-20"
] | php-src | 52b93f0cfd3cba7ff98cc5198df6ca4f23865f80 | 183,563,235,538,851,040,000,000,000,000,000,000,000 | 25 | Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) |
Item_return_date_time(THD *thd, const char *name_arg, uint length_arg,
enum_field_types field_type_arg):
Item_partition_func_safe_string(thd, name_arg, length_arg, &my_charset_bin),
date_time_field_type(field_type_arg)
{ decimals= 0; } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 293,619,307,122,790,600,000,000,000,000,000,000,000 | 5 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
qb_ipcs_connection_stats_get_2(qb_ipcs_connection_t *c,
int32_t clear_after_read)
{
struct qb_ipcs_connection_stats_2 * stats;
if (c == NULL) {
errno = EINVAL;
return NULL;
}
stats = calloc(1, sizeof(struct qb_ipcs_connection_stats_2));
if (stats == NULL) {
return NULL;
}
memcpy(stats, &c->stat... | 0 | [
"CWE-59"
] | libqb | e322e98dc264bc5911d6fe1d371e55ac9f95a71e | 92,919,448,820,137,790,000,000,000,000,000,000,000 | 27 | ipc: use O_EXCL on SHM files, and randomize the names
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com> |
template<typename tp, typename tf, typename tc, typename to>
const CImg<T>& _display_object3d(CImgDisplay& disp, const char *const title,
const CImg<tp>& vertices,
const CImgList<tf>& primitives,
const CImgList<tc>& colors,
const to& opacities,
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 136,627,409,364,973,040,000,000,000,000,000,000,000 | 427 | Fix other issues in 'CImg<T>::load_bmp()'. |
drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB,
int fore,
int color,
NCURSES_SP_OUTC outc)
{
SCREEN *sp;
AssertTCB();
SetSP();
if (fore) {
if (set_a_foreground) {
TPUTS_TRACE("set_a_foreground");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
TIPARM_1(set_a_foreground, color),... | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 306,270,421,598,629,600,000,000,000,000,000,000,000 | 34 | 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... |
HBasicBlock* HGraphBuilder::BreakAndContinueScope::Get(
BreakableStatement* stmt,
BreakType type,
int* drop_extra) {
*drop_extra = 0;
BreakAndContinueScope* current = this;
while (current != NULL && current->info()->target() != stmt) {
*drop_extra += current->info()->drop_extra();
current = cu... | 0 | [] | node | fd80a31e0697d6317ce8c2d289575399f4e06d21 | 158,816,444,023,559,160,000,000,000,000,000,000,000 | 37 | deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://coderevie... |
Invocation(const FindCmd* definition, const OpMsgRequest& request, StringData dbName)
: CommandInvocation(definition), _request(request), _dbName(dbName) {} | 0 | [
"CWE-20"
] | mongo | 722f06f3217c029ef9c50062c8cc775966fd7ead | 123,293,394,784,434,780,000,000,000,000,000,000,000 | 2 | SERVER-38275 ban find explain with UUID |
static VncServerInfo2List *qmp_query_server_entry(QIOChannelSocket *ioc,
bool websocket,
int auth,
int subauth,
VncServe... | 0 | [
"CWE-401"
] | qemu | 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 | 309,321,782,912,559,660,000,000,000,000,000,000,000 | 35 | vnc: fix memory leak when vnc disconnect
Currently when qemu receives a vnc connect, it creates a 'VncState' to
represent this connection. In 'vnc_worker_thread_loop' it creates a
local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
... |
static int put_v4l2_edid32(struct v4l2_edid __user *kp,
struct v4l2_edid32 __user *up)
{
void *edid;
if (!access_ok(VERIFY_WRITE, up, sizeof(*up)) ||
assign_in_user(&up->pad, &kp->pad) ||
assign_in_user(&up->start_block, &kp->start_block) ||
assign_in_user(&up->blocks, &kp->blocks) ||
get_u... | 0 | [
"CWE-787"
] | linux | a1dfb4c48cc1e64eeb7800a27c66a6f7e88d075a | 146,265,254,270,870,680,000,000,000,000,000,000,000 | 15 | media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic
The 32-bit compat v4l2 ioctl handling is implemented based on its 64-bit
equivalent. It converts 32-bit data structures into its 64-bit
equivalents and needs to provide the data to the 64-bit ioctl in user
space memory which is commonly allocated using
compat... |
mp_sint32 PlayerGeneric::pausePlaying()
{
paused = true;
if (mixer)
return mixer->pause();
return MP_OK;
} | 0 | [
"CWE-416"
] | MilkyTracker | 7afd55c42ad80d01a339197a2d8b5461d214edaf | 91,926,633,843,800,880,000,000,000,000,000,000,000 | 8 | Fix use-after-free in PlayerGeneric destructor |
static bool safe_recv(void *buf, size_t len) {
if (len == 0) {
return true;
}
off_t offset = 0;
do {
ssize_t nr = read(sock, ((char*)buf) + offset, len - offset);
if (nr == -1) {
if (errno != EINTR) {
fprintf(stderr, "Failed to read: %s\n", strerror(er... | 0 | [
"CWE-20"
] | memcached | 75cc83685e103bc8ba380a57468c8f04413033f9 | 283,160,088,106,907,230,000,000,000,000,000,000,000 | 23 | Issue 102: Piping null to the server will crash it |
static int ocfs2_write_begin_inline(struct address_space *mapping,
struct inode *inode,
struct ocfs2_write_ctxt *wc)
{
int ret;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct page *page;
handle_t *handle;
struct ocfs2_dinode *di = (struct ocfs2_dinode *)wc->w_di_bh->b_data;
page = find_o... | 0 | [
"CWE-20"
] | linux-2.6 | 272b62c1f0f6f742046e45b50b6fec98860208a0 | 13,827,089,298,025,720,000,000,000,000,000,000,000 | 55 | Treat writes as new when holes span across page boundaries
When a hole spans across page boundaries, the next write forces
a read of the block. This could end up reading existing garbage
data from the disk in ocfs2_map_page_blocks. This leads to
non-zero holes. In order to avoid this, mark the writes as new
when the h... |
static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
{
tp->pred_flags = htonl((tp->tcp_header_len << 26) |
ntohl(TCP_FLAG_ACK) |
snd_wnd);
} | 0 | [
"CWE-416",
"CWE-269"
] | linux | bb1fceca22492109be12640d49f5ea5a544c6bb4 | 9,847,037,853,206,422,000,000,000,000,000,000,000 | 6 | 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... |
static int dispatch_rqueue(sd_bus *bus, bool hint_priority, int64_t priority, sd_bus_message **m) {
int r, ret = 0;
assert(bus);
assert(m);
assert(IN_SET(bus->state, BUS_RUNNING, BUS_HELLO));
/* Note that the priority logic is only available on kdbus,
* where the rqueu... | 0 | [
"CWE-416"
] | systemd | 1068447e6954dc6ce52f099ed174c442cb89ed54 | 145,720,311,807,907,890,000,000,000,000,000,000,000 | 31 | sd-bus: introduce API for re-enqueuing incoming messages
When authorizing via PolicyKit we want to process incoming method calls
twice: once to process and figure out that we need PK authentication,
and a second time after we aquired PK authentication to actually execute
the operation. With this new call sd_bus_enqueu... |
getChar(widechar c, TranslationTableHeader *table,
TranslationTableOffset *characterOffset) {
const TranslationTableOffset bucket = table->characters[_lou_charHash(c)];
TranslationTableOffset offset = bucket;
while (offset) {
TranslationTableCharacter *character =
(TranslationTableCharacter *)&table->ruleAre... | 0 | [
"CWE-787"
] | liblouis | 2e4772befb2b1c37cb4b9d6572945115ee28630a | 53,921,176,517,495,170,000,000,000,000,000,000,000 | 15 | Prevent an invalid memory writes in compileRule
Thanks to Han Zheng for reporting it
Fixes #1214 |
static uint8_t get_uuid_mask(uuid_t *uuid)
{
if (uuid->type != SDP_UUID16)
return 0;
switch (uuid->value.uuid16) {
case DIALUP_NET_SVCLASS_ID:
case CIP_SVCLASS_ID:
return 0x42; /* Telephony & Networking */
case IRMC_SYNC_SVCLASS_ID:
case OBEX_OBJPUSH_SVCLASS_ID:
case OBEX_FILETRANS_SVCLASS_ID:
case IRMC_SY... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 197,226,113,665,384,570,000,000,000,000,000,000,000 | 44 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
void ssl_set_dbg( ssl_context *ssl,
void (*f_dbg)(void *, int, const char *),
void *p_dbg )
{
ssl->f_dbg = f_dbg;
ssl->p_dbg = p_dbg;
} | 0 | [
"CWE-310"
] | polarssl | 4582999be608c9794d4518ae336b265084db9f93 | 120,718,410,238,184,840,000,000,000,000,000,000,000 | 7 | Fixed timing difference resulting from badly formatted padding. |
static long ppc_set_hwdebug(struct task_struct *child,
struct ppc_hw_breakpoint *bp_info)
{
#ifdef CONFIG_HAVE_HW_BREAKPOINT
int len = 0;
struct thread_struct *thread = &(child->thread);
struct perf_event *bp;
struct perf_event_attr attr;
#endif /* CONFIG_HAVE_HW_BREAKPOINT */
#ifndef CONFIG_PPC_ADV_DEBUG_RE... | 0 | [
"CWE-119",
"CWE-787"
] | linux | c1fa0768a8713b135848f78fd43ffc208d8ded70 | 245,871,896,023,068,870,000,000,000,000,000,000,000 | 107 | powerpc/tm: Flush TM only if CPU has TM feature
Commit cd63f3c ("powerpc/tm: Fix saving of TM SPRs in core dump")
added code to access TM SPRs in flush_tmregs_to_thread(). However
flush_tmregs_to_thread() does not check if TM feature is available on
CPU before trying to access TM SPRs in order to copy live state to
th... |
static void sub_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top){
int i;
uint8_t l, lt;
l= *left;
lt= *left_top;
for(i=0; i<w; i++){
const int pred= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF);
lt= src1[i];
... | 0 | [
"CWE-703",
"CWE-189"
] | FFmpeg | 454a11a1c9c686c78aa97954306fb63453299760 | 29,529,159,186,284,880,000,000,000,000,000,000,000 | 17 | avcodec/dsputil: fix signedness in sizeof() comparissions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
*/
static int
xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp,
xmlXPathObjectPtr *resultSeq, int toBool)
{
int max_depth, min_depth;
int from_root;
int ret, depth;
int eval_all_nodes;
xmlNodePtr cur = NULL, limit = NULL;
xmlStreamCtxtPtr patstream = NULL;
int nb_n... | 0 | [] | libxml2 | 03c6723043775122313f107695066e5744189a08 | 217,572,584,608,368,600,000,000,000,000,000,000,000 | 224 | Handling of XPath function arguments in error case
The XPath engine tries to guarantee that every XPath function can pop
'nargs' non-NULL values off the stack. libxslt, for example, relies on
this assumption. But the check isn't thorough enough if there are errors
during the evaluation of arguments. This can lead to s... |
static __u32 tcp_v4_init_sequence(const struct sk_buff *skb)
{
return secure_tcp_sequence_number(ip_hdr(skb)->daddr,
ip_hdr(skb)->saddr,
tcp_hdr(skb)->dest,
tcp_hdr(skb)->source);
} | 0 | [
"CWE-284"
] | linux | ac6e780070e30e4c35bd395acfe9191e6268bdd3 | 233,267,501,201,533,200,000,000,000,000,000,000,000 | 7 | tcp: take care of truncations done by sk_filter()
With syzkaller help, Marco Grassi found a bug in TCP stack,
crashing in tcp_collapse()
Root cause is that sk_filter() can truncate the incoming skb,
but TCP stack was not really expecting this to happen.
It probably was expecting a simple DROP or ACCEPT behavior.
We ... |
static void snd_timer_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_timer *timer;
struct snd_timer_instance *ti;
mutex_lock(®ister_mutex);
list_for_each_entry(timer, &snd_timer_list, device_list) {
switch (timer->tmr_class) {
case SNDRV_TIMER_CLASS_GLOBAL:
snd_i... | 0 | [
"CWE-200",
"CWE-362"
] | linux | ee8413b01045c74340aa13ad5bdf905de32be736 | 119,296,087,137,744,290,000,000,000,000,000,000,000 | 43 | ALSA: timer: Fix double unlink of active_list
ALSA timer instance object has a couple of linked lists and they are
unlinked unconditionally at snd_timer_stop(). Meanwhile
snd_timer_interrupt() unlinks it, but it calls list_del() which leaves
the element list itself unchanged. This ends up with unlinking twice,
and i... |
static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)
{
int pixelCount;
int channelCount, compression;
int channel, i;
int bitdepth;
int w,h;
stbi_uc *out;
STBI_NOTUSED(ri);
// Check identifier
if (stbi__get32be(s) != 0x3842505... | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 186,333,829,603,190,760,000,000,000,000,000,000,000 | 200 | 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. |
void PackLinuxElf32armBe::defineSymbols(Filter const *ft)
{
ARM_defineSymbols(ft);
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 47,519,878,998,784,060,000,000,000,000,000,000,000 | 4 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
d2s_array (const double *src, int count, short *dest, double scale)
{ while (--count >= 0)
{ dest [count] = lrint (scale * src [count]) ;
} ;
} /* d2s_array */ | 0 | [
"CWE-369"
] | libsndfile | 85c877d5072866aadbe8ed0c3e0590fbb5e16788 | 201,337,195,376,147,600,000,000,000,000,000,000,000 | 5 | double64_init: Check psf->sf.channels against upper bound
This prevents division by zero later in the code.
While the trivial case to catch this (i.e. sf.channels < 1) has already
been covered, a crafted file may report a number of channels that is
so high (i.e. > INT_MAX/sizeof(double)) that it "somehow" gets
miscal... |
asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void)
{
} | 0 | [
"CWE-400"
] | linux-stable-rt | e5d4e1c3ccee18c68f23d62ba77bda26e893d4f0 | 325,944,112,075,224,800,000,000,000,000,000,000,000 | 3 | x86: Do not disable preemption in int3 on 32bit
Preemption must be disabled before enabling interrupts in do_trap
on x86_64 because the stack in use for int3 and debug is a per CPU
stack set by th IST. But 32bit does not have an IST and the stack
still belongs to the current task and there is no problem in scheduling
... |
static int reencrypt_context_init(struct crypt_device *cd, struct luks2_hdr *hdr, struct luks2_reencrypt *rh, uint64_t device_size, const struct crypt_params_reencrypt *params)
{
int r;
uint64_t dummy, area_length;
rh->reenc_keyslot = LUKS2_find_keyslot(hdr, "reencrypt");
if (rh->reenc_keyslot < 0)
return -EINVA... | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 122,974,436,631,953,180,000,000,000,000,000,000,000 | 119 | 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... |
static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 mac_status)
{
int current_link_up = 0;
if (!(mac_status & MAC_STATUS_PCS_SYNCED))
goto out;
if (tp->link_config.autoneg == AUTONEG_ENABLE) {
u32 txflags, rxflags;
int i;
if (fiber_autoneg(tp, &txflags, &rxflags)) {
u32 local_adv = 0, remote_adv = 0... | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 286,580,723,814,731,400,000,000,000,000,000,000,000 | 64 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.