func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
*/
void re_yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
re_yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
re_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
}
re_yy_init_buffer(YY_... | 0 | [
"CWE-476",
"CWE-703",
"CWE-125"
] | yara | 3119b232c9c453c98d8fa8b6ae4e37ba18117cd4 | 110,324,439,603,510,020,000,000,000,000,000,000,000 | 13 | re_lexer: Make reading escape sequences more robust (#586)
* Add test for issue #503
* re_lexer: Make reading escape sequences more robust
This commit fixes parsing incomplete escape sequences at the end of a
regular expression and parsing things like \xxy (invalid hex digits)
which before were silently turned... |
void dpy_text_update(QemuConsole *con, int x, int y, int w, int h)
{
DisplayState *s = con->ds;
DisplayChangeListener *dcl;
if (!qemu_console_is_visible(con)) {
return;
}
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
conti... | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 305,459,381,318,649,570,000,000,000,000,000,000,000 | 17 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
static int rfcomm_sock_release(struct socket *sock)
{
struct sock *sk = sock->sk;
int err;
BT_DBG("sock %p, sk %p", sock, sk);
if (!sk)
return 0;
err = rfcomm_sock_shutdown(sock, 2);
sock_orphan(sk);
rfcomm_sock_kill(sk);
return err;
} | 0 | [
"CWE-476"
] | linux | 951b6a0717db97ce420547222647bcc40bf1eacd | 1,085,988,528,883,754,700,000,000,000,000,000,000 | 16 | Bluetooth: Fix potential NULL dereference in RFCOMM bind callback
addr can be NULL and it should not be dereferenced before NULL checking.
Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
make_get_auname(cmdidx_T cmdidx)
{
switch (cmdidx)
{
case CMD_make: return (char_u *)"make";
case CMD_lmake: return (char_u *)"lmake";
case CMD_grep: return (char_u *)"grep";
case CMD_lgrep: return (char_u *)"lgrep";
case CMD_grepadd: return (char_u *)"grepadd";
case CMD_lgrepadd: retur... | 0 | [
"CWE-416"
] | vim | 4f1b083be43f351bc107541e7b0c9655a5d2c0bb | 246,102,649,915,136,100,000,000,000,000,000,000,000 | 13 | patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set
Problem: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any. |
void fini_debug_store_on_cpu(int cpu)
{
if (!per_cpu(cpu_hw_events, cpu).ds)
return;
wrmsr_on_cpu(cpu, MSR_IA32_DS_AREA, 0, 0);
} | 0 | [
"CWE-755"
] | linux | d88d05a9e0b6d9356e97129d4ff9942d765f46ea | 26,951,761,883,184,034,000,000,000,000,000,000,000 | 7 | perf/x86/intel: Fix a crash caused by zero PEBS status
A repeatable crash can be triggered by the perf_fuzzer on some Haswell
system.
https://lore.kernel.org/lkml/7170d3b-c17f-1ded-52aa-cc6d9ae999f4@maine.edu/
For some old CPUs (HSW and earlier), the PEBS status in a PEBS record
may be mistakenly set to 0. To minimiz... |
static void print_indent(size_t depth)
{
for (; depth > 0; depth--) {
putchar(' ');
}
} | 0 | [
"CWE-119",
"CWE-787"
] | OpenSC | 412a6142c27a5973c61ba540e33cdc22d5608e68 | 19,007,037,867,869,394,000,000,000,000,000,000,000 | 6 | fixed out of bounds access of ASN.1 Bitstring
Credit to OSS-Fuzz |
md_decode_utf16le_before__(MD_CTX* ctx, OFF off)
{
if(off > 2 && IS_UTF16_SURROGATE_HI(CH(off-2)) && IS_UTF16_SURROGATE_LO(CH(off-1)))
return UTF16_DECODE_SURROGATE(CH(off-2), CH(off-1));
return CH(off);
} | 0 | [
"CWE-125",
"CWE-908"
] | md4c | 4fc808d8fe8d8904f8525bb4231d854f45e23a19 | 241,179,808,703,115,020,000,000,000,000,000,000,000 | 7 | md_analyze_line: Avoid reading 1 byte beyond the input size.
Fixes #155. |
static inline void sync_lapic_to_cr8(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
u64 cr8;
if (svm_nested_virtualize_tpr(vcpu) ||
kvm_vcpu_apicv_active(vcpu))
return;
cr8 = kvm_get_cr8(vcpu);
svm->vmcb->control.int_ctl &= ~V_TPR_MASK;
svm->vmcb->control.int_ctl |= cr8 & V_TPR_MASK;
} | 0 | [
"CWE-401"
] | linux | d80b64ff297e40c2b6f7d7abc1b3eba70d22a068 | 103,679,242,238,366,150,000,000,000,000,000,000,000 | 13 | KVM: SVM: Fix potential memory leak in svm_cpu_init()
When kmalloc memory for sd->sev_vmcbs failed, we forget to free the page
held by sd->save_area. Also get rid of the var r as '-ENOMEM' is actually
the only possible outcome here.
Reviewed-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Vitaly Kuznetsov <vkuzne... |
static void
routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old,
routerinfo_t *ri_new)
{
int idx;
int same_descriptors;
routerinfo_t *ri_tmp;
extrainfo_t *ei_tmp;
{
const routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri_new);
}
tor_as... | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 190,485,768,309,945,400,000,000,000,000,000,000,000 | 99 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
{
char *res = NULL, *var, *val, *separator = NULL;
const char *c_var;
zval *array_ptr;
int free_buffer = 0;
char *strtok_buf = NULL;
long count = 0;
switch (arg) {
case PARSE_POST:
case PARSE_GET:
case PARSE_COOKIE:
ALLOC_ZVAL(array_ptr);
array_i... | 0 | [
"CWE-601"
] | php-src | 98b9dfaec95e6f910f125ed172cdbd25abd006ec | 186,882,433,580,288,500,000,000,000,000,000,000,000 | 138 | Fix for HTTP_PROXY issue.
The following changes are made:
- _SERVER/_ENV only has HTTP_PROXY if the local environment has it,
and only one from the environment.
- getenv('HTTP_PROXY') only returns one from the local environment
- getenv has optional second parameter, telling it to only consider
local environment |
static int mpage_process_page_bufs(struct mpage_da_data *mpd,
struct buffer_head *head,
struct buffer_head *bh,
ext4_lblk_t lblk)
{
struct inode *inode = mpd->inode;
int err;
ext4_lblk_t blocks = (i_size_read(inode) + i_blocksize(inode) - 1)
>> inode->i_blkbits;
if (ext4_verity_in_progr... | 0 | [
"CWE-703"
] | linux | ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1 | 12,881,586,878,148,854,000,000,000,000,000,000,000 | 39 | ext4: check journal inode extents more carefully
Currently, system zones just track ranges of block, that are "important"
fs metadata (bitmaps, group descriptors, journal blocks, etc.). This
however complicates how extent tree (or indirect blocks) can be checked
for inodes that actually track such metadata - currently... |
GF_Err stsg_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_SubTrackSampleGroupBox *ptr = (GF_SubTrackSampleGroupBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->grouping_type);
gf_bs_write_u16(bs, ptr->nb_groups);
for (i = 0; i < ptr->nb_groups; i++) {
gf_bs... | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 70,111,619,116,337,840,000,000,000,000,000,000,000 | 15 | fixed #2255 |
static int http_start_receive_data(HTTPContext *c)
{
int fd;
int ret;
int64_t ret64;
if (c->stream->feed_opened) {
http_log("Stream feed '%s' was not opened\n",
c->stream->feed_filename);
return AVERROR(EINVAL);
}
/* Don't permit writing to this one */
if (... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | a5d25faa3f4b18dac737fdb35d0dd68eb0dc2156 | 146,199,418,957,603,800,000,000,000,000,000,000,000 | 61 | 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 u32 bnx2x_get_pretend_reg(struct bnx2x *bp)
{
u32 base = PXP2_REG_PGL_PRETEND_FUNC_F0;
u32 stride = PXP2_REG_PGL_PRETEND_FUNC_F1 - base;
return base + (BP_ABS_FUNC(bp)) * stride;
} | 0 | [
"CWE-20"
] | linux | 8914a595110a6eca69a5e275b323f5d09e18f4f9 | 148,300,308,336,467,610,000,000,000,000,000,000,000 | 6 | bnx2x: disable GSO where gso_size is too big for hardware
If a bnx2x card is passed a GSO packet with a gso_size larger than
~9700 bytes, it will cause a firmware error that will bring the card
down:
bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert!
bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT... |
void Filter::UpstreamRequest::onPoolFailure(Http::ConnectionPool::PoolFailureReason reason,
absl::string_view transport_failure_reason,
Upstream::HostDescriptionConstSharedPtr host) {
Http::StreamResetReason reset_reason = Http::S... | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 324,942,043,663,527,400,000,000,000,000,000,000,000 | 17 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
static int sd_config(struct gspca_dev *gspca_dev,
const struct usb_device_id *id)
{
struct sd *sd = (struct sd *) gspca_dev;
struct cam *cam = &gspca_dev->cam;
sd->bridge = id->driver_info & BRIDGE_MASK;
sd->invert_led = (id->driver_info & BRIDGE_INVERT_LED) != 0;
switch (sd->bridge) {
case BRIDGE_OV511:
ca... | 0 | [
"CWE-476"
] | linux | 998912346c0da53a6dbb71fab3a138586b596b30 | 196,874,877,435,668,500,000,000,000,000,000,000,000 | 41 | media: ov519: add missing endpoint sanity checks
Make sure to check that we have at least one endpoint before accessing
the endpoint array to avoid dereferencing a NULL-pointer on stream
start.
Note that these sanity checks are not redundant as the driver is mixing
looking up altsettings by index and by number, which... |
void WebContents::OnEnterFullscreenModeForTab(
content::RenderFrameHost* requesting_frame,
const blink::mojom::FullscreenOptions& options,
bool allowed) {
if (!allowed)
return;
if (!owner_window_)
return;
auto* source = content::WebContents::FromRenderFrameHost(requesting_frame);
if (IsFulls... | 0 | [
"CWE-200",
"CWE-668"
] | electron | 07a1c2a3e5845901f7e2eda9506695be58edc73c | 137,261,535,001,956,530,000,000,000,000,000,000,000 | 23 | fix: restrict sendToFrame to same-process frames by default (#26875) |
TIFFNumberOfStrips(TIFF* tif)
{
TIFFDirectory *td = &tif->tif_dir;
uint32 nstrips;
nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplespe... | 0 | [
"CWE-125"
] | libtiff | 9a72a69e035ee70ff5c41541c8c61cd97990d018 | 14,202,829,007,390,167,000,000,000,000,000,000,000 | 12 | * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
instead of a logic based on the total size of data. Which is faulty is
the total size of data is not sufficient to fill the whole image, and thus
results in reading outside ... |
static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags,
struct flowi6 *flp6, const struct net_device *dev)
{
struct fib6_rule *r = (struct fib6_rule *)rule;
/* If we need to find a source address for this traffic,
* we check the result if it meets requirement of the rule.
*/
if ((rul... | 0 | [
"CWE-772",
"CWE-401"
] | linux | ca7a03c4175366a92cee0ccc4fec0038c3266e26 | 204,753,745,827,321,800,000,000,000,000,000,000,000 | 24 | ipv6: do not free rt if FIB_LOOKUP_NOREF is set on suppress rule
Commit 7d9e5f422150 removed references from certain dsts, but accounting
for this never translated down into the fib6 suppression code. This bug
was triggered by WireGuard users who use wg-quick(8), which uses the
"suppress-prefix" directive to ip-rule(8... |
lys_node_dup_recursion(struct lys_module *module, struct lys_node *parent, const struct lys_node *node,
struct unres_schema *unres, int shallow, int finalize)
{
struct lys_node *retval = NULL, *iter, *p;
struct ly_ctx *ctx = module->ctx;
enum int_log_opts prev_ilo;
int i, j, rc;
... | 0 | [
"CWE-617"
] | libyang | 5ce30801f9ccc372bbe9b7c98bb5324b15fb010a | 279,709,685,946,456,400,000,000,000,000,000,000,000 | 455 | schema tree BUGFIX freeing nodes with no module set
Context must be passed explicitly for these cases.
Fixes #1452 |
static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
unsigned long vmcb_pa = svm->current_vmcb->pa;
guest_state_enter_irqoff();
if (sev_es_guest(vcpu->kvm)) {
__svm_sev_es_vcpu_run(vmcb_pa);
} else {
struct svm_cpu_data *sd = per_cpu(svm_data, vcpu->cpu);
/... | 0 | [
"CWE-703"
] | linux | 6cd88243c7e03845a450795e134b488fc2afb736 | 127,521,813,504,505,000,000,000,000,000,000,000,000 | 27 | 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 ... |
static int do_decode(AVCodecContext *avctx, AVPacket *pkt)
{
int got_frame;
int ret;
av_assert0(!avctx->internal->buffer_frame->buf[0]);
if (!pkt)
pkt = avctx->internal->buffer_pkt;
// This is the lesser evil. The field is for compatibility with legacy users
// of the legacy API, and ... | 0 | [
"CWE-787"
] | FFmpeg | 2080bc33717955a0e4268e738acf8c1eeddbf8cb | 115,565,987,735,635,610,000,000,000,000,000,000,000 | 63 | avcodec/utils: correct align value for interplay
Fixes out of array access
Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
void NumberFormatTest::TestJB3832(){
const char* localeID = "pt_PT@currency=PTE";
Locale loc(localeID);
UErrorCode status = U_ZERO_ERROR;
UnicodeString expected(CharsToUnicodeString("1,150$50\\u00A0\\u200B")); // per cldrbug 7670
UnicodeString s;
NumberFormat* currencyFmt = NumberFormat::createC... | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 132,030,717,187,913,360,000,000,000,000,000,000,000 | 22 | ICU-20246 Fixing another integer overflow in number parsing. |
int make_pages_present(unsigned long addr, unsigned long end)
{
int ret, len, write;
struct vm_area_struct * vma;
vma = find_vma(current->mm, addr);
if (!vma)
return -ENOMEM;
/*
* We want to touch writable mappings with a write fault in order
* to break COW, except for shared mappings because these don't CO... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 139,572,513,145,826,660,000,000,000,000,000,000,000 | 23 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
static void ap_integer_decrement_le(BYTE* number, size_t size)
{
size_t index;
WINPR_ASSERT(number || (size == 0));
for (index = 0; index < size; index++)
{
if (number[index] > 0)
{
number[index]--;
break;
}
else
{
number[index] = 0xFF;
continue;
}
}
} | 0 | [] | FreeRDP | 479e891545473f01c187daffdfa05fc752b54b72 | 228,373,981,756,975,850,000,000,000,000,000,000,000 | 20 | check return values for SetCredentialsAttributes, throw warnings for unsupported attributes |
static void spl_array_set_array(zval *object, spl_array_object *intern, zval **array, long ar_flags, int just_array TSRMLS_DC) {
if (Z_TYPE_PP(array) == IS_ARRAY) {
SEPARATE_ZVAL_IF_NOT_REF(array);
}
if (Z_TYPE_PP(array) == IS_OBJECT && (Z_OBJ_HT_PP(array) == &spl_handler_ArrayObject || Z_OBJ_HT_PP(array) == &sp... | 0 | [] | php-src | a374dfab567ff7f0ab0dc150f14cc891b0340b47 | 330,996,322,395,423,300,000,000,000,000,000,000,000 | 40 | Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion |
static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
{
return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
} | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 198,427,933,375,856,840,000,000,000,000,000,000,000 | 4 | ipv6: add complete rcu protection around np->opt
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-a... |
GBool CairoOutputDev::axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading)
{
return (shading->getExtend0() == shading->getExtend1());
} | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 21,944,863,166,640,890,000,000,000,000,000,000,000 | 4 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
Texture() : sampler(-1), source(-1) {} | 0 | [
"CWE-20"
] | tinygltf | 52ff00a38447f06a17eab1caa2cf0730a119c751 | 94,287,056,108,391,760,000,000,000,000,000,000,000 | 1 | Do not expand file path since its not necessary for glTF asset path(URI) and for security reason(`wordexp`). |
ampdu_reassemble_cleanup(void)
{
reassembly_table_destroy(&du_reassembly_table);
} | 0 | [
"CWE-20"
] | wireshark | 2c13e97d656c1c0ac4d76eb9d307664aae0e0cf7 | 104,429,933,036,344,540,000,000,000,000,000,000,000 | 4 | The WTAP_ENCAP_ETHERNET dissector needs to be passed a struct eth_phdr.
We now require that. Make it so.
Bug: 12440
Change-Id: Iffee520976b013800699bde3c6092a3e86be0d76
Reviewed-on: https://code.wireshark.org/review/15424
Reviewed-by: Guy Harris <guy@alum.mit.edu> |
ldns_rr_new(void)
{
ldns_rr *rr;
rr = LDNS_MALLOC(ldns_rr);
if (!rr) {
return NULL;
}
ldns_rr_set_owner(rr, NULL);
ldns_rr_set_question(rr, false);
ldns_rr_set_rd_count(rr, 0);
rr->_rdata_fields = NULL;
ldns_rr_set_class(rr, LDNS_RR_CLASS_IN);
ldns_rr_set_ttl(rr, LDNS_DEFAULT_TTL);
... | 0 | [
"CWE-415"
] | ldns | 070b4595981f48a21cc6b4f5047fdc2d09d3da91 | 190,342,062,316,831,700,000,000,000,000,000,000,000 | 16 | CAA and URI |
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
{
int ret = ff_set_dimensions(s, width, height);
if (ret < 0) {
av_log(s, AV_LOG_WARNING, "Failed to set dimensions %d %d\n", width, height);
}
} | 0 | [
"CWE-703"
] | FFmpeg | e5c7229999182ad1cef13b9eca050dba7a5a08da | 314,569,512,812,125,440,000,000,000,000,000,000,000 | 7 | avcodec/utils: set AVFrame format unconditional
Fixes inconsistency and out of array accesses
Fixes: 10cdd7e63e7f66e3e66273939e0863dd-asan_heap-oob_1a4ff32_7078_cov_4056274555_mov_h264_aac__mp4box_frag.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
string t_cpp_generator::function_signature(t_function* tfunction,
string style,
string prefix,
bool name_params) {
t_type* ttype = tfunction->get_returntype();
t_struct* arglist = tfuncti... | 0 | [
"CWE-20"
] | thrift | cfaadcc4adcfde2a8232c62ec89870b73ef40df1 | 268,538,210,234,109,000,000,000,000,000,000,000,000 | 42 | THRIFT-3231 CPP: Limit recursion depth to 64
Client: cpp
Patch: Ben Craig <bencraig@apache.org> |
iter_fill_rtt(struct iter_env* iter_env, struct module_env* env,
uint8_t* name, size_t namelen, uint16_t qtype, time_t now,
struct delegpt* dp, int* best_rtt, struct sock_list* blacklist,
size_t* num_suitable_results)
{
int got_it = 0;
struct delegpt_addr* a;
*num_suitable_results = 0;
if(dp->bogus)
return 0... | 0 | [
"CWE-400"
] | unbound | ba0f382eee814e56900a535778d13206b86b6d49 | 220,207,869,807,019,530,000,000,000,000,000,000,000 | 29 | - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
query into a large number of queries directed to a target.
- CVE-2020-12663 Malformed answers from upstream name servers can be
used to make Unbound unresponsive. |
static int __init ftrace_nodyn_init(void)
{
ftrace_enabled = 1;
return 0;
} | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 309,151,595,845,518,450,000,000,000,000,000,000,000 | 5 | tracing: Fix possible NULL pointer dereferences
Currently set_ftrace_pid and set_graph_function files use seq_lseek
for their fops. However seq_open() is called only for FMODE_READ in
the fops->open() so that if an user tries to seek one of those file
when she open it for writing, it sees NULL seq_file and then panic... |
TEST_F(HttpConnectionManagerImplTest, PathWithEscapedSlashesRejectedIfGRPC) {
// This test is slightly weird as it sends gRPC "request" over H/1 client of the
// HttpConnectionManagerImplTest. However it is sufficient to test the behavior of path
// normalization as it is determined by the content type only.
pa... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 158,654,437,354,117,870,000,000,000,000,000,000,000 | 16 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
void copyOut(size_t start, uint64_t size, void* data) const override {
::memcpy(data, this->start() + start, size);
} | 0 | [
"CWE-401"
] | envoy | 5eba69a1f375413fb93fab4173f9c393ac8c2818 | 167,028,221,770,187,530,000,000,000,000,000,000,000 | 3 | [buffer] Add on-drain hook to buffer API and use it to avoid fragmentation due to tracking of H2 data and control frames in the output buffer (#144)
Signed-off-by: antonio <avd@google.com> |
template<typename T>
inline CImg<_cimg_Tfloat> atan(const CImg<T>& instance) {
return instance.get_atan(); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 209,935,909,299,355,850,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
const char *device_path,
struct btrfs_device *srcdev,
struct btrfs_device **device_out)
{
struct btrfs_device *device;
struct block_device *bdev;
struct list_head *devices;
struct rcu_string *name;
u64 devid = BTRFS_DEV_REPLA... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 277,572,052,059,456,250,000,000,000,000,000,000,000 | 92 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
static void hugetlb_vm_op_open(struct vm_area_struct *vma)
{
struct resv_map *reservations = vma_resv_map(vma);
/*
* This new VMA should share its siblings reservation map if present.
* The VMA will only ever have a valid reservation map pointer where
* it is being copied for another still existing VMA. As th... | 0 | [
"CWE-399"
] | linux | 90481622d75715bfcb68501280a917dbfe516029 | 333,801,649,973,561,600,000,000,000,000,000,000,000 | 15 | 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... |
int http_resync_states(struct session *s)
{
struct http_txn *txn = &s->txn;
int old_req_state = txn->req.msg_state;
int old_res_state = txn->rsp.msg_state;
http_silent_debug(__LINE__, s);
http_sync_req_state(s);
while (1) {
http_silent_debug(__LINE__, s);
if (!http_sync_res_state(s))
break;
http_silent_... | 0 | [] | haproxy-1.4 | dc80672211e085c211f1fc47e15cfe57ab587d38 | 181,002,294,649,526,160,000,000,000,000,000,000,000 | 66 | BUG/CRITICAL: using HTTP information in tcp-request content may crash the process
During normal HTTP request processing, request buffers are realigned if
there are less than global.maxrewrite bytes available after them, in
order to leave enough room for rewriting headers after the request. This
is done in http_wait_fo... |
static ssize_t queue_wc_show(struct request_queue *q, char *page)
{
if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
return sprintf(page, "write back\n");
return sprintf(page, "write through\n");
} | 0 | [
"CWE-416"
] | linux | c3e2219216c92919a6bd1711f340f5faa98695e6 | 145,304,717,118,759,480,000,000,000,000,000,000,000 | 7 | block: free sched's request pool in blk_cleanup_queue
In theory, IO scheduler belongs to request queue, and the request pool
of sched tags belongs to the request queue too.
However, the current tags allocation interfaces are re-used for both
driver tags and sched tags, and driver tags is definitely host wide,
and doe... |
static inline u32 signal_to_av(int sig)
{
u32 perm = 0;
switch (sig) {
case SIGCHLD:
/* Commonly granted from child to parent. */
perm = PROCESS__SIGCHLD;
break;
case SIGKILL:
/* Cannot be caught or ignored */
perm = PROCESS__SIGKILL;
break;
case SIGSTOP:
/* Cannot be caught or ignored */
perm = P... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 15,463,185,466,191,108,000,000,000,000,000,000,000 | 25 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
int ssh_dh_generate_e(ssh_session session) {
#ifdef HAVE_LIBCRYPTO
bignum_CTX ctx = bignum_ctx_new();
if (ctx == NULL) {
return -1;
}
#endif
session->next_crypto->e = bignum_new();
if (session->next_crypto->e == NULL) {
#ifdef HAVE_LIBCRYPTO
bignum_ctx_free(ctx);
#endif
return -1;
}
#ifdef HAV... | 0 | [
"CWE-200"
] | libssh | 4e6ff36a9a3aef72aa214f6fb267c28953b80060 | 163,583,035,892,253,740,000,000,000,000,000,000,000 | 34 | dh: Fix CVE-2016-0739
Due to a byte/bit confusion, the DH secret was too short. This file was
completely reworked and will be commited in a future version.
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org> |
rgw::IAM::Environment rgw_build_iam_environment(RGWRados* store,
struct req_state* s)
{
rgw::IAM::Environment e;
const auto& m = s->info.env->get_map();
auto t = ceph::real_clock::now();
e.emplace("aws:CurrentTime", std::to_string(ceph::real_clock::to_time_t(t)));
e.emplace("aws:EpochTime", ceph::to_iso... | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 237,552,663,538,127,240,000,000,000,000,000,000,000 | 54 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));
switch (input->type) {
case kTfLiteFloat32:
return EvalImpl<kernel_type, kTfLiteFloat32>(context, node);
case kTfLiteUInt8:
return EvalI... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 272,105,889,482,462,050,000,000,000,000,000,000,000 | 19 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
void set_worker_desc(const char *fmt, ...)
{
struct worker *worker = current_wq_worker();
va_list args;
if (worker) {
va_start(args, fmt);
vsnprintf(worker->desc, sizeof(worker->desc), fmt, args);
va_end(args);
worker->desc_valid = true;
}
} | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 302,071,444,221,682,200,000,000,000,000,000,000,000 | 12 | 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... |
static void __ffs_event_add(struct ffs_data *ffs,
enum usb_functionfs_event_type type)
{
enum usb_functionfs_event_type rem_type1, rem_type2 = type;
int neg = 0;
/*
* Abort any unhandled setup
*
* We do not need to worry about some cmpxchg() changing value
* of ffs->setup_state without holding the lo... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 38740a5b87d53ceb89eb2c970150f6e94e00373a | 231,136,262,348,979,560,000,000,000,000,000,000,000 | 66 | usb: gadget: f_fs: Fix use-after-free
When using asynchronous read or write operations on the USB endpoints the
issuer of the IO request is notified by calling the ki_complete() callback
of the submitted kiocb when the URB has been completed.
Calling this ki_complete() callback will free kiocb. Make sure that the
str... |
static Handle<Value> New(const Arguments& args) {
HandleScope scope;
http_parser_type type =
static_cast<http_parser_type>(args[0]->Int32Value());
if (type != HTTP_REQUEST && type != HTTP_RESPONSE) {
return ThrowException(Exception::Error(String::New(
"Argument must be HTTPParser... | 0 | [] | node | 7b3fb22290c3b6acb497ca85cf2f1648d75c8154 | 184,916,222,518,299,370,000,000,000,000,000,000,000 | 16 | typo in node_http_parser |
oop InstanceKlass::protection_domain() const {
// return the protection_domain from the mirror
return java_lang_Class::protection_domain(java_mirror());
} | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 105,353,101,208,112,230,000,000,000,000,000,000,000 | 4 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
DCH_cache_getnew(char *str)
{
DCHCacheEntry *ent;
/* counter overflow check - paranoia? */
if (DCHCounter >= (INT_MAX - DCH_CACHE_FIELDS - 1))
{
DCHCounter = 0;
for (ent = DCHCache; ent <= (DCHCache + DCH_CACHE_FIELDS); ent++)
ent->age = (++DCHCounter);
}
/*
* If cache is full, remove oldest entry
*... | 0 | [
"CWE-120"
] | postgres | 0150ab567bcf5e5913e2b62a1678f84cc272441f | 281,888,114,317,313,850,000,000,000,000,000,000,000 | 49 | to_char(): prevent accesses beyond the allocated buffer
Previously very long field masks for floats could access memory
beyond the existing buffer allocated to hold the result.
Reported by Andres Freund and Peter Geoghegan. Backpatch to all
supported versions.
Security: CVE-2015-0241 |
on_register_handler(TCMUService1HandlerManager1 *interface,
GDBusMethodInvocation *invocation,
gchar *subtype,
gchar *cfg_desc,
gpointer user_data)
{
struct tcmur_handler *handler;
struct dbus_info *info;
char *bus_name;
bus_name = g_strdup_printf("org.kernel.TCMUService1.HandlerManager1.%s... | 0 | [
"CWE-476"
] | tcmu-runner | bb80e9c7a798f035768260ebdadffb6eb0786178 | 157,950,360,366,982,330,000,000,000,000,000,000,000 | 35 | only allow dynamic UnregisterHandler for external handlers, thereby fixing DoS
Trying to unregister an internal handler ended up in a SEGFAULT, because
the tcmur_handler->opaque was NULL. Way to reproduce:
dbus-send --system --print-reply --dest=org.kernel.TCMUService1 /org/kernel/TCMUService1/HandlerManager1 org.ker... |
server_select_comp_method(gnutls_session_t session,
uint8_t * data, int datalen)
{
int x, i, j;
uint8_t comps[MAX_ALGOS];
x = _gnutls_supported_compression_methods(session, comps,
MAX_ALGOS);
if (x < 0) {
gnutls_assert();
return x;
}
if (session->internals.priorities.server_precedence == 0) {
... | 0 | [
"CWE-310"
] | gnutls | db9a7d810f9ee4c9cc49731f5fd9bdeae68d7eaa | 64,224,403,522,623,680,000,000,000,000,000,000,000 | 68 | handshake: check for TLS_FALLBACK_SCSV
If TLS_FALLBACK_SCSV was sent by the client during the handshake, and
the advertised protocol version is lower than GNUTLS_TLS_VERSION_MAX,
send the "Inappropriate fallback" fatal alert and abort the handshake.
This mechanism was defined in RFC7507. |
vim_unescape_csi(char_u *p)
{
char_u *s = p, *d = p;
while (*s != NUL)
{
if (s[0] == K_SPECIAL && s[1] == KS_SPECIAL && s[2] == KE_FILLER)
{
*d++ = K_SPECIAL;
s += 3;
}
else if ((s[0] == K_SPECIAL || s[0] == CSI)
&& s[1] == KS_EXTRA && s[2] == (int)KE_CSI)
{
*d++ = CSI;
s +=... | 0 | [
"CWE-78"
] | vim | 53575521406739cf20bbe4e384d88e7dca11f040 | 206,891,259,940,510,170,000,000,000,000,000,000,000 | 22 | patch 8.1.1365: source command doesn't check for the sandbox
Problem: Source command doesn't check for the sandbox. (Armin Razmjou)
Solution: Check for the sandbox when sourcing a file. |
static int hidpp10_enable_battery_reporting(struct hidpp_device *hidpp_dev)
{
return hidpp10_set_register(hidpp_dev, HIDPP_REG_ENABLE_REPORTS, 0,
HIDPP_ENABLE_BAT_REPORT, HIDPP_ENABLE_BAT_REPORT);
} | 0 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 223,702,237,932,135,550,000,000,000,000,000,000,000 | 5 | HID: Fix assumption that devices have inputs
The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
driver. The problem is caused by the driver's assumption that the
device must have an input report. While this will be true for all
normal HID input devices, a suitably malicious device can violate the... |
static int xen_cpu_dead_pv(unsigned int cpu)
{
xen_smp_intr_free(cpu);
xen_smp_intr_free_pv(cpu);
xen_teardown_timer(cpu);
return 0;
} | 0 | [
"CWE-703"
] | linux | 96e8fc5818686d4a1591bb6907e7fdb64ef29884 | 228,140,867,206,487,770,000,000,000,000,000,000,000 | 9 | x86/xen: Use clear_bss() for Xen PV guests
Instead of clearing the bss area in assembly code, use the clear_bss()
function.
This requires to pass the start_info address as parameter to
xen_start_kernel() in order to avoid the xen_start_info being zeroed
again.
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-of... |
parsev3rddirres(netdissect_options *ndo,
const uint32_t *dp, int verbose)
{
int er;
if (!(dp = parsestatus(ndo, dp, &er)))
return (0);
if (ndo->ndo_vflag)
ND_PRINT((ndo, " POST:"));
if (!(dp = parse_post_op_attr(ndo, dp, verbose)))
return (0);
if (er)
return dp;
if (ndo->ndo_vflag) {
ND... | 0 | [
"CWE-125",
"CWE-787"
] | tcpdump | 7a923447fd49a069a0fd3b6c3547438ab5ee2123 | 29,996,356,588,840,090,000,000,000,000,000,000,000 | 22 | CVE-2017-13001/NFS: Don't copy more data than is in the file handle.
Also, put the buffer on the stack; no reason to make it static. (65
bytes isn't a lot.)
This fixes a buffer over-read discovered by Kamil Frankowicz.
Add a test using the capture file supplied by the reporter(s). |
void ComputeEasyCases(OpKernelContext* context, bool* done,
std::vector<Tlen>* split_sizes_vec) {
const int32_t num_split = context->num_outputs();
const Tensor& input = context->input(0);
const TensorShape& input_shape = input.shape();
const Tensor& split_tensor = context->inp... | 0 | [
"CWE-703"
] | tensorflow | 25d622ffc432acc736b14ca3904177579e733cc6 | 246,328,078,065,637,500,000,000,000,000,000,000,000 | 117 | A negative size in one of the split sizes allowed the computed size of another
to exceed the total dimension, leading to a segfault and security vulnerability.
Adding a check for negative sizes prevents this.
PiperOrigin-RevId: 401035665
Change-Id: I79bbe329787dac82aa4bf60397a9129b716aedab |
swiotlb_late_init_with_default_size(size_t default_size)
{
unsigned long nslabs =
ALIGN(default_size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE);
unsigned long bytes;
unsigned char *vstart = NULL;
unsigned int order;
int rc = 0;
if (swiotlb_force == SWIOTLB_NO_FORCE)
return 0;
/*
* Get IO TLB memory from the low pa... | 0 | [
"CWE-200",
"CWE-401"
] | linux | aa6f8dcbab473f3a3c7454b74caa46d36cdc5d13 | 271,503,616,541,884,370,000,000,000,000,000,000,000 | 41 | swiotlb: rework "fix info leak with DMA_FROM_DEVICE"
Unfortunately, we ended up merging an old version of the patch "fix info
leak with DMA_FROM_DEVICE" instead of merging the latest one. Christoph
(the swiotlb maintainer), he asked me to create an incremental fix
(after I have pointed this out the mix up, and asked h... |
static int do_replace(struct net *net, const void __user *user,
unsigned int len)
{
int ret, countersize;
struct ebt_table_info *newinfo;
struct ebt_replace tmp;
if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
return -EFAULT;
if (len != sizeof(tmp) + tmp.entries_size) {
BUGPRINT("Wrong len argument... | 1 | [
"CWE-20"
] | linux | d846f71195d57b0bbb143382647c2c6638b04c5a | 165,236,094,426,470,920,000,000,000,000,000,000,000 | 55 | bridge: netfilter: fix information leak
Struct tmp is copied from userspace. It is not checked whether the "name"
field is NULL terminated. This may lead to buffer overflow and passing
contents of kernel stack as a module name to try_then_request_module() and,
consequently, to modprobe commandline. It would be seen... |
static int unsolicited_report_interval(struct inet6_dev *idev)
{
int iv;
if (mld_in_v1_mode(idev))
iv = idev->cnf.mldv1_unsolicited_report_interval;
else
iv = idev->cnf.mldv2_unsolicited_report_interval;
return iv > 0 ? iv : 1;
} | 0 | [
"CWE-703"
] | linux | 2d3916f3189172d5c69d33065c3c21119fe539fc | 118,531,281,752,585,920,000,000,000,000,000,000,000 | 11 | ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
While investigating on why a synchronize_net() has been added recently
in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report()
might drop skbs in some cases.
Discussion about removing synchronize_net() from ipv6_mc_down()
will ha... |
static int usbvision_v4l2_open(struct file *file)
{
struct usb_usbvision *usbvision = video_drvdata(file);
int err_code = 0;
PDEBUG(DBG_IO, "open");
if (mutex_lock_interruptible(&usbvision->v4l2_lock))
return -ERESTARTSYS;
if (usbvision->user) {
err_code = -EBUSY;
} else {
err_code = v4l2_fh_open(file);
... | 0 | [
"CWE-17"
] | media_tree | fa52bd506f274b7619955917abfde355e3d19ffe | 316,469,922,020,970,840,000,000,000,000,000,000,000 | 61 | [media] usbvision: fix crash on detecting device with invalid configuration
The usbvision driver crashes when a specially crafted usb device with invalid
number of interfaces or endpoints is detected. This fix adds checks that the
device has proper configuration expected by the driver.
Reported-by: Ralf Spenneberg <r... |
static void __net_exit ipv4_frags_exit_net(struct net *net)
{
ip4_frags_ns_ctl_unregister(net);
inet_frags_exit_net(&net->ipv4.frags);
} | 0 | [
"CWE-20"
] | linux | 5d407b071dc369c26a38398326ee2be53651cfe4 | 315,250,308,868,801,400,000,000,000,000,000,000,000 | 5 | ip: frags: fix crash in ip_do_fragment()
A kernel crash occurrs when defragmented packet is fragmented
in ip_do_fragment().
In defragment routine, skb_orphan() is called and
skb->ip_defrag_offset is set. but skb->sk and
skb->ip_defrag_offset are same union member. so that
frag->sk is not NULL.
Hence crash occurrs in s... |
TEST_F(QuicServerTransportTest, RecvStopSendingFrame) {
server->getNonConstConn().ackStates.appDataAckState.nextPacketNum = 3;
std::array<std::string, 4> words = {
"Hey Bob, this is Alice, for real.",
"What message did I send you last time?",
"You don't sound like Alice",
"You are a liar!",
... | 0 | [
"CWE-617",
"CWE-703"
] | mvfst | a67083ff4b8dcbb7ee2839da6338032030d712b0 | 112,666,533,472,840,660,000,000,000,000,000,000,000 | 43 | Close connection if we derive an extra 1-rtt write cipher
Summary: Fixes CVE-2021-24029
Reviewed By: mjoras, lnicco
Differential Revision: D26613890
fbshipit-source-id: 19bb2be2c731808144e1a074ece313fba11f1945 |
void VectorAddition(OpKernelContext* context, const quint8* x_data, float min_x,
float max_x, const quint8* y_data, float min_y, float max_y,
int64 num_elements, float output_min, float output_max,
qint32* output) {
const float x_0_float = QuantizedToFloat<q... | 0 | [
"CWE-369"
] | tensorflow | 744009c9e5cc5d0447f0dc39d055f917e1fd9e16 | 71,157,763,108,304,610,000,000,000,000,000,000,000 | 65 | Validate work in `QuantizedAdd`, ensure at least one element.
PiperOrigin-RevId: 370127996
Change-Id: I57c6f3e01afdeada84737820a131590137463855 |
static void test_bug36326()
{
int rc;
DBUG_ENTER("test_bug36326");
myheader("test_bug36326");
rc= mysql_autocommit(mysql, TRUE);
myquery(rc);
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE t1 (a INTEGER)");
myquery(rc);
rc= mysql_query(mysql, ... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 199,059,565,389,968,930,000,000,000,000,000,000,000 | 45 | 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... |
int gnutls_x509_crt_to_xml(gnutls_x509_crt_t cert, gnutls_datum_t * res,
int detail)
{
int result;
res->data = NULL;
res->size = 0;
result = _gnutls_asn1_get_structure_xml(cert->cert, res, detail);
if (result < 0) {
gnutls_assert();
return result;
}
return 0;
} | 0 | [] | gnutls | 112d537da5f3500f14316db26d18c37d678a5e0e | 185,799,704,354,624,400,000,000,000,000,000,000,000 | 16 | some changes for 64bit machines. |
static void tab(int n, struct seq_file *f) {
seq_printf(f, "%*s", n, "");
} | 0 | [
"CWE-835",
"CWE-787"
] | linux | 717adfdaf14704fd3ec7fa2c04520c0723247eac | 138,287,028,550,362,800,000,000,000,000,000,000,000 | 3 | HID: debug: check length before copy_to_user()
If our length is greater than the size of the buffer, we
overflow the buffer
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz> |
void *ping_seq_start(struct seq_file *seq, loff_t *pos, sa_family_t family)
{
struct ping_iter_state *state = seq->private;
state->bucket = 0;
state->family = family;
read_lock_bh(&ping_table.lock);
return *pos ? ping_get_idx(seq, *pos-1) : SEQ_START_TOKEN;
} | 0 | [
"CWE-20"
] | net | bceaa90240b6019ed73b49965eac7d167610be69 | 189,697,578,607,884,100,000,000,000,000,000,000,000 | 10 | inet: prevent leakage of uninitialized memory to user in recv syscalls
Only update *addr_len when we actually fill in sockaddr, otherwise we
can return uninitialized memory from the stack to the caller in the
recvfrom, recvmmsg and recvmsg syscalls. Drop the the (addr_len == NULL)
checks because we only get called wit... |
PHP_FUNCTION(imagepsencodefont)
{
zval *fnt;
char *enc, **enc_vector;
int enc_len, *f_ind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font);
if ((enc_vector = T1_LoadEncoding(enc)) ... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 31,176,276,878,108,920,000,000,000,000,000,000,000 | 28 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
static struct sk_buff **gre_gro_receive(struct sk_buff **head,
struct sk_buff *skb)
{
struct sk_buff **pp = NULL;
struct sk_buff *p;
const struct gre_base_hdr *greh;
unsigned int hlen, grehlen;
unsigned int off;
int flush = 1;
struct packet_offload *ptype;
__be16 type;
if (NAPI_GRO_CB(skb)->encap_mark)
... | 0 | [
"CWE-400",
"CWE-703"
] | linux | fac8e0f579695a3ecbc4d3cac369139d7f819971 | 340,166,294,097,501,540,000,000,000,000,000,000,000 | 111 | tunnels: Don't apply GRO to multiple layers of encapsulation.
When drivers express support for TSO of encapsulated packets, they
only mean that they can do it for one layer of encapsulation.
Supporting additional levels would mean updating, at a minimum,
more IP length fields and they are unaware of this.
No encapsul... |
static inline signed int ReadPropertyMSBLong(const unsigned char **p,
size_t *length)
{
union
{
unsigned int
unsigned_value;
signed int
signed_value;
} quantum;
int
c;
ssize_t
i;
unsigned char
buffer[4];
unsigned int
value;
if (*length < 4)
return(-1);
f... | 0 | [
"CWE-703",
"CWE-704"
] | ImageMagick | eac8ce4d873f28bb6a46aa3a662fb196b49b95d0 | 310,682,662,497,709,470,000,000,000,000,000,000,000 | 39 | fix #5033: runtime error: load of misaligned address (#5034)
* fix Division by zero in XMenuWidget() of MagickCore/widget.c
* Fix memory leak in AnimateImageCommand() of MagickWand/animate.c and DisplayImageCommand() of MagickWand/display.c
* fix Division by zero in ReadEnhMetaFile() of coders/emf.c
* Resolve... |
int try_to_release_page(struct page *page, gfp_t gfp_mask)
{
struct address_space * const mapping = page->mapping;
BUG_ON(!PageLocked(page));
if (PageWriteback(page))
return 0;
if (mapping && mapping->a_ops->releasepage)
return mapping->a_ops->releasepage(page, gfp_mask);
return try_to_free_buffers(page);
} | 0 | [
"CWE-193"
] | linux-2.6 | 94ad374a0751f40d25e22e036c37f7263569d24c | 29,515,515,496,039,927,000,000,000,000,000,000,000 | 12 | Fix off-by-one error in iov_iter_advance()
The iov_iter_advance() function would look at the iov->iov_len entry
even though it might have iterated over the whole array, and iov was
pointing past the end. This would cause DEBUG_PAGEALLOC to trigger a
kernel page fault if the allocation was at the end of a page, and th... |
static int __init drbg_init(void)
{
unsigned int i = 0; /* pointer to drbg_algs */
unsigned int j = 0; /* pointer to drbg_cores */
int ret = -EFAULT;
ret = drbg_healthcheck_sanity();
if (ret)
return ret;
if (ARRAY_SIZE(drbg_cores) * 2 > ARRAY_SIZE(drbg_algs)) {
pr_info("DRBG: Cannot register all DRBG types"... | 0 | [
"CWE-476"
] | linux | 8fded5925d0a733c46f8d0b5edd1c9b315882b1d | 108,315,020,377,856,690,000,000,000,000,000,000,000 | 32 | crypto: drbg - Convert to new rng interface
This patch converts the DRBG implementation to the new low-level
rng interface.
This allows us to get rid of struct drbg_gen by using the new RNG
API instead.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Stephan Mueller <smueller@chronox.de> |
virtual void update_null_value () { (void) val_int(); } | 0 | [] | mysql-server | f7316aa0c9a3909fc7498e7b95d5d3af044a7e21 | 279,757,026,741,374,700,000,000,000,000,000,000,000 | 1 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))
Backport of Bug#19143243 fix.
NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an a... |
static js_Ast *jsP_newstrnode(js_State *J, enum js_AstType type, const char *s)
{
js_Ast *node = jsP_newnode(J, type, 0, 0, 0, 0);
node->string = s;
return node;
} | 0 | [
"CWE-674"
] | mujs | 4d45a96e57fbabf00a7378b337d0ddcace6f38c1 | 264,354,518,593,995,800,000,000,000,000,000,000,000 | 6 | Guard binary expressions from too much recursion. |
void ip6_frag_init(struct inet_frag_queue *q, void *a)
{
struct frag_queue *fq = container_of(q, struct frag_queue, q);
struct ip6_create_arg *arg = a;
fq->id = arg->id;
fq->user = arg->user;
ipv6_addr_copy(&fq->saddr, arg->src);
ipv6_addr_copy(&fq->daddr, arg->dst);
} | 0 | [] | linux-2.6 | 70789d7052239992824628db8133de08dc78e593 | 86,024,463,236,599,970,000,000,000,000,000,000,000 | 10 | ipv6: discard overlapping fragment
RFC5722 prohibits reassembling fragments when some data overlaps.
Bug spotted by Zhang Zuotao <zuotao.zhang@6wind.com>.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
Http::Stream::doClose()
{
clientConnection->close();
} | 0 | [
"CWE-20"
] | squid | 6c9c44d0e9cf7b72bb233360c5308aa063af3d69 | 19,255,783,755,575,887,000,000,000,000,000,000,000 | 4 | Handle more partial responses (#791) |
ARN()
: partition(Partition::wildcard), service(Service::wildcard) {} | 0 | [
"CWE-617"
] | ceph | b3118cabb8060a8cc6a01c4e8264cb18e7b1745a | 75,617,959,844,221,530,000,000,000,000,000,000,000 | 2 | rgw: Remove assertions in IAM Policy
A couple of them could be triggered by user input.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com> |
WM_SYMBOL midi *WildMidi_Open(const char *midifile) {
uint8_t *mididata = NULL;
uint32_t midisize = 0;
uint8_t mus_hdr[] = { 'M', 'U', 'S', 0x1A };
uint8_t xmi_hdr[] = { 'F', 'O', 'R', 'M' };
midi * ret = NULL;
if (!WM_Initialized) {
_WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_I... | 0 | [
"CWE-200",
"CWE-119"
] | wildmidi | 814f31d8eceda8401eb812fc2e94ed143fdad0ab | 78,691,502,637,349,130,000,000,000,000,000,000,000 | 45 | wildmidi_lib.c (WildMidi_Open, WildMidi_OpenBuffer): refuse to proceed if less then 18 bytes of input
Fixes bug #178. |
heif_encoder::heif_encoder(std::shared_ptr<heif::HeifContext> _context,
const struct heif_encoder_plugin* _plugin)
: //context(_context),
plugin(_plugin)
{
} | 0 | [
"CWE-125"
] | libheif | f7399b62d7fbc596f1b2871578c1d2053bedf1dd | 277,176,037,578,664,950,000,000,000,000,000,000,000 | 7 | Handle case where referenced "iref" box doesn't exist (fixes #138). |
void SSL::storeKeys(const opaque* key_data)
{
int sz = secure_.get_parms().hash_size_;
memcpy(secure_.use_connection().client_write_MAC_secret_, key_data, sz);
int i = sz;
memcpy(secure_.use_connection().server_write_MAC_secret_,&key_data[i], sz);
i += sz;
sz = secure_.get_parms().key_size_;
... | 0 | [
"CWE-254"
] | mysql-server | e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69 | 171,591,786,891,307,750,000,000,000,000,000,000,000 | 21 | Bug #22738607: YASSL FUNCTION X509_NAME_GET_INDEX_BY_NID IS NOT WORKING AS EXPECTED. |
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_md,X509 *issuer,
STACK_OF(OCSP_CERTID) *ids)
{
OCSP_CERTID *id;
if(!issuer)
{
BIO_printf(bio_err, "No issuer certificate specified\n");
return 0;
}
if(!*req) *req = OCSP_REQUEST_new();
if(!*req) goto err;
id = OCSP_cert_to_... | 0 | [] | openssl | d65b8b2162f33ac0d53dace588a0847ed827626c | 267,295,415,563,324,600,000,000,000,000,000,000,000 | 20 | Backport OCSP fixes. |
static inline int sk_can_gso(const struct sock *sk)
{
return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type);
} | 0 | [
"CWE-400"
] | linux-2.6 | c377411f2494a931ff7facdbb3a6839b1266bcf6 | 231,617,359,493,489,240,000,000,000,000,000,000,000 | 4 | net: sk_add_backlog() take rmem_alloc into account
Current socket backlog limit is not enough to really stop DDOS attacks,
because user thread spend many time to process a full backlog each
round, and user might crazy spin on socket lock.
We should add backlog size and receive_queue size (aka rmem_alloc) to
pace writ... |
void FilterUtility::setTimeoutHeaders(uint64_t elapsed_time,
const FilterUtility::TimeoutData& timeout,
const RouteEntry& route,
Http::RequestHeaderMap& request_headers,
... | 0 | [
"CWE-703"
] | envoy | 5bf9b0f1e7f247a4eee7180849cb0823926f7fff | 65,389,883,569,284,950,000,000,000,000,000,000,000 | 44 | [1.21] CVE-2022-21655
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com> |
goa_utils_delete_credentials_sync (GoaProvider *provider,
GoaAccount *object,
GCancellable *cancellable,
GError **error)
{
gboolean ret;
gchar *password_key;
const gchar *identity;
GError *sec_er... | 0 | [
"CWE-310"
] | gnome-online-accounts | edde7c63326242a60a075341d3fea0be0bc4d80e | 14,221,115,471,746,030,000,000,000,000,000,000,000 | 49 | Guard against invalid SSL certificates
None of the branded providers (eg., Google, Facebook and Windows Live)
should ever have an invalid certificate. So set "ssl-strict" on the
SoupSession object being used by GoaWebView.
Providers like ownCloud and Exchange might have to deal with
certificates that are not up to th... |
h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
register JSA... | 1 | [
"CWE-476"
] | libjpeg-turbo | 9120a247436e84c0b4eea828cb11e8f665fcde30 | 316,486,228,593,008,050,000,000,000,000,000,000,000 | 64 | Fix jpeg_skip_scanlines() segfault w/merged upsamp
The additional segfault mentioned in #244 was due to the fact that
the merged upsamplers use a different private structure than the
non-merged upsamplers. jpeg_skip_scanlines() was assuming the latter, so
when merged upsampling was enabled, jpeg_skip_scanlines() clob... |
void upnpevents_selectfds(fd_set *readset, fd_set *writeset, int * max_fd)
{
struct upnp_event_notify * obj;
for(obj = notifylist.lh_first; obj != NULL; obj = obj->entries.le_next) {
syslog(LOG_DEBUG, "upnpevents_selectfds: %p %d %d",
obj, obj->state, obj->s);
if(obj->s >= 0) {
switch(obj->state) {
... | 0 | [
"CWE-200",
"CWE-252"
] | miniupnp | bec6ccec63cadc95655721bc0e1dd49dac759d94 | 152,456,355,929,270,900,000,000,000,000,000,000,000 | 29 | upnp_event_prepare(): check the return value of snprintf() |
static void iucv_callback_txdone(struct iucv_path *path,
struct iucv_message *msg)
{
struct sock *sk = path->private;
struct sk_buff *this = NULL;
struct sk_buff_head *list = &iucv_sk(sk)->send_skb_q;
struct sk_buff *list_skb = list->next;
unsigned long flags;
bh_lock_sock(sk);
if (!skb_queue_empty(list)) ... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 53,639,268,361,592,650,000,000,000,000,000,000,000 | 41 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
TEST(ExpressionFromAccumulators, Avg) {
assertExpectedResults("$avg",
{// $avg ignores non-numeric inputs.
{{Value("string"_sd), Value(BSONNULL), Value(), Value(3)}, Value(3.0)},
// $avg always returns a double.
... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 141,102,808,028,812,820,000,000,000,000,000,000,000 | 9 | SERVER-38070 fix infinite loop in agg expression |
evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
{
int res = -1;
va_list ap;
va_start(ap, fmt);
res = evbuffer_add_vprintf(buf, fmt, ap);
va_end(ap);
return (res);
} | 0 | [
"CWE-189"
] | libevent | 7b21c4eabf1f3946d3f63cce1319c490caab8ecf | 317,857,015,994,455,500,000,000,000,000,000,000,000 | 11 | Fix CVE-2014-6272 in Libevent 1.4
For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap. |
int crypt_header_is_detached(struct crypt_device *cd)
{
int r;
if (!cd || !isLUKS(cd->type))
return -EINVAL;
r = device_is_identical(crypt_data_device(cd), crypt_metadata_device(cd));
if (r < 0) {
log_dbg(cd, "Failed to compare data and metadata devices path.");
return r;
}
return r ? 0 : 1;
} | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 204,412,420,608,546,400,000,000,000,000,000,000,000 | 15 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
R_API char *r_bin_java_create_method_fq_str(const char *klass, const char *name, const char *signature) {
if (!klass) {
klass = "null_class";
}
if (!name) {
name = "null_name";
}
if (!signature) {
signature = "null_signature";
}
return r_str_newf ("%s.%s.%s", klass, name, signature);
} | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 302,726,092,330,900,120,000,000,000,000,000,000,000 | 12 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
static unsigned long source_load(int cpu, int type)
{
struct rq *rq = cpu_rq(cpu);
unsigned long total = weighted_cpuload(rq);
if (type == 0 || !sched_feat(LB_BIAS))
return total;
return min(rq->cpu_load[type-1], total);
} | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 327,991,489,203,837,600,000,000,000,000,000,000,000 | 10 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
static unsigned HuffmanTree_getCode(const HuffmanTree* tree, unsigned index)
{
return tree->tree1d[index];
} | 0 | [
"CWE-401"
] | FreeRDP | 9fee4ae076b1ec97b97efb79ece08d1dab4df29a | 301,404,839,040,821,880,000,000,000,000,000,000,000 | 4 | Fixed #5645: realloc return handling |
static GF_Err DumpIndexReplace(GF_SceneDumper *sdump, GF_Command *com)
{
char posname[20];
GF_Err e;
GF_FieldInfo field;
GF_CommandField *inf;
if (!gf_list_count(com->command_fields)) return GF_OK;
inf = (GF_CommandField *) gf_list_get(com->command_fields, 0);
e = gf_node_get_field(com->node, inf->fieldIndex, &... | 0 | [
"CWE-476"
] | gpac | 0102c5d4db7fdbf08b5b591b2a6264de33867a07 | 66,215,851,586,965,180,000,000,000,000,000,000,000 | 51 | fixed #2232 |
static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe,
size_t len, unsigned int flags)
{
int ret;
int page_nr = 0;
int do_wakeup = 0;
struct pipe_buffer *bufs;
struct fuse_copy_state cs;
struct fuse_conn *fc = fuse_get_conn(in);
if (!fc)
return -EPERM;
... | 0 | [
"CWE-120",
"CWE-119",
"CWE-787"
] | linux | c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae | 304,150,223,828,815,370,000,000,000,000,000,000,000 | 73 | fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message
FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the
message processing could overrun and result in a "kernel BUG at
fs/fuse/dev.c:629!"
Reported-by: Han-Wen Nienhuys <hanwenn@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@kern... |
static int muscle_list_files(sc_card_t *card, u8 *buf, size_t bufLen)
{
muscle_private_t* priv = MUSCLE_DATA(card);
mscfs_t *fs = priv->fs;
int x;
int count = 0;
mscfs_check_cache(priv->fs);
for(x = 0; x < fs->cache.size; x++) {
u8* oid = fs->cache.array[x].objectId.id;
if (bufLen < 2)
break;
sc_debug(... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 162,690,973,524,739,800,000,000,000,000,000,000,000 | 27 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
setup_call(Node* node, ScanEnv* env, int state)
{
int r;
switch (NODE_TYPE(node)) {
case NODE_LIST:
case NODE_ALT:
do {
r = setup_call(NODE_CAR(node), env, state);
} while (r == 0 && IS_NOT_NULL(node = NODE_CDR(node)));
break;
case NODE_QUANT:
if (QUANT_(node)->upper == 0)
state ... | 0 | [
"CWE-125"
] | oniguruma | 4d461376bd85e7994835677b2ff453a43c49cd28 | 171,665,511,580,333,500,000,000,000,000,000,000,000 | 68 | don't expand string case folds to alternatives if code length == 1 and byte length is same |
evbuffer_file_segment_new(
int fd, ev_off_t offset, ev_off_t length, unsigned flags)
{
struct evbuffer_file_segment *seg =
mm_calloc(sizeof(struct evbuffer_file_segment), 1);
if (!seg)
return NULL;
seg->refcnt = 1;
seg->fd = fd;
seg->flags = flags;
seg->file_offset = offset;
seg->cleanup_cb = NULL;
seg-... | 1 | [
"CWE-189"
] | libevent | 841ecbd96105c84ac2e7c9594aeadbcc6fb38bc4 | 201,896,907,423,150,170,000,000,000,000,000,000,000 | 53 | Fix CVE-2014-6272 in Libevent 2.1
For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap.
Also, lower the maximum chunk size to the lower of off_t, size_t maximum.
This is necessary since otherwise we could get into an infinite loop
if we ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.