func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
void ipv6_frag_exit(void)
{
inet_frags_fini(&ip6_frags);
ip6_frags_sysctl_unregister();
unregister_pernet_subsys(&ip6_frags_ops);
inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
} | 0 | [] | linux-2.6 | 70789d7052239992824628db8133de08dc78e593 | 268,827,189,445,949,800,000,000,000,000,000,000,000 | 7 | 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> |
void set_user_nice(struct task_struct *p, long nice)
{
int old_prio, delta, queued;
unsigned long flags;
struct rq *rq;
if (task_nice(p) == nice || nice < MIN_NICE || nice > MAX_NICE)
return;
/*
* We have to be careful, if called from sys_setpriority(),
* the task might be in the middle of scheduling on ano... | 0 | [
"CWE-119"
] | linux | 29d6455178a09e1dc340380c582b13356227e8df | 153,756,573,201,382,370,000,000,000,000,000,000,000 | 45 | sched: panic on corrupted stack end
Until now, hitting this BUG_ON caused a recursive oops (because oops
handling involves do_exit(), which calls into the scheduler, which in
turn raises an oops), which caused stuff below the stack to be
overwritten until a panic happened (e.g. via an oops in interrupt
context, cause... |
static int getFillIdx(SWFShape shape, SWFFillStyle fill)
{
int i;
for ( i=0; i<shape->nFills; ++i )
{
if ( SWFFillStyle_equals(fill, shape->fills[i]) )
return (i+1);
}
return 0; // no fill
} | 0 | [
"CWE-20",
"CWE-476"
] | libming | 6e76e8c71cb51c8ba0aa9737a636b9ac3029887f | 235,964,436,707,778,720,000,000,000,000,000,000,000 | 11 | SWFShape_setLeftFillStyle: prevent fill overflow |
static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base)
{
const char *baseptr = (char *)base->data;
const char *hostptr = (char *)uri->data;
const char *p = strchr(hostptr, ':');
int hostlen;
/* Check for foo:// and skip past it */
if (!p || (p[1] != '/') || (p[2] != '/'))
return X5... | 1 | [
"CWE-125"
] | openssl | 8393de42498f8be75cf0353f5c9f906a43a748d2 | 227,083,264,833,497,620,000,000,000,000,000,000,000 | 45 | Fix the name constraints code to not assume NUL terminated strings
ASN.1 strings may not be NUL terminated. Don't assume they are.
CVE-2021-3712
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org> |
resolve_augment(struct lys_node_augment *aug, struct lys_node *uses, struct unres_schema *unres)
{
int rc;
struct lys_node *sub;
struct lys_module *mod;
struct ly_set *set;
struct ly_ctx *ctx;
assert(aug);
mod = lys_main_module(aug->module);
ctx = mod->ctx;
/* set it as not applied... | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 27,130,996,700,018,720,000,000,000,000,000,000,000 | 103 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
fetch_indexed_value (dwarf_vma idx,
enum dwarf_section_display_enum sec_enum,
dwarf_vma base_address)
{
struct dwarf_section *section = &debug_displays [sec_enum].section;
if (section->start == NULL)
{
warn (_("Unable to locate %s section\n"), section->uncompressed_name);
return 0;
... | 0 | [
"CWE-703"
] | binutils-gdb | 695c6dfe7e85006b98c8b746f3fd5f913c94ebff | 122,433,477,731,201,200,000,000,000,000,000,000,000 | 43 | PR29370, infinite loop in display_debug_abbrev
The PR29370 testcase is a fuzzed object file with multiple
.trace_abbrev sections. Multiple .trace_abbrev or .debug_abbrev
sections are not a violation of the DWARF standard. The DWARF5
standard even gives an example of multiple .debug_abbrev sections
contained in group... |
static struct sock *__sco_get_sock_listen_by_addr(bdaddr_t *ba)
{
struct sock *sk;
sk_for_each(sk, &sco_sk_list.head) {
if (sk->sk_state != BT_LISTEN)
continue;
if (!bacmp(&sco_pi(sk)->src, ba))
return sk;
}
return NULL;
} | 0 | [
"CWE-200"
] | net | 5233252fce714053f0151680933571a2da9cbfb4 | 240,496,255,245,114,030,000,000,000,000,000,000,000 | 14 | bluetooth: Validate socket address length in sco_sock_bind().
Signed-off-by: David S. Miller <davem@davemloft.net> |
static int sev_es_sync_vmsa(struct vcpu_svm *svm)
{
struct vmcb_save_area *save = &svm->vmcb->save;
/* Check some debug related fields before encrypting the VMSA */
if (svm->vcpu.guest_debug || (save->dr7 & ~DR7_FIXED_1))
return -EINVAL;
/* Sync registgers */
save->rax = svm->vcpu.arch.regs[VCPU_REGS_RAX];
sa... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 52,907,169,830,075,070,000,000,000,000,000,000,000 | 45 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
GF_Err video_sample_entry_box_size(GF_Box *s)
{
GF_Box *b;
u32 pos=0;
GF_MPEGVisualSampleEntryBox *ptr = (GF_MPEGVisualSampleEntryBox *)s;
gf_isom_video_sample_entry_size((GF_VisualSampleEntryBox *)s);
/*make sure we write the config box first, we don't care about the rest*/
/*mp4v*/
gf_isom_check_position(s, ... | 0 | [
"CWE-476",
"CWE-787"
] | gpac | b8f8b202d4fc23eb0ab4ce71ae96536ca6f5d3f8 | 192,220,260,457,612,600,000,000,000,000,000,000,000 | 46 | fixed #1757 |
limit_screen_size(void)
{
if (Columns < MIN_COLUMNS)
Columns = MIN_COLUMNS;
else if (Columns > 10000)
Columns = 10000;
if (Rows > 1000)
Rows = 1000;
} | 0 | [
"CWE-125",
"CWE-787"
] | vim | e178af5a586ea023622d460779fdcabbbfac0908 | 200,710,225,679,221,660,000,000,000,000,000,000,000 | 9 | patch 8.2.5160: accessing invalid memory after changing terminal size
Problem: Accessing invalid memory after changing terminal size.
Solution: Adjust cmdline_row and msg_row to the value of Rows. |
static char *exif_get_tagname(int tag_num, tag_table_type tag_table)
{
return zend_hash_index_find_ptr(exif_get_tag_ht(tag_table), tag_num);
} | 0 | [
"CWE-125"
] | php-src | 0c77b4307df73217283a4aaf9313e1a33a0967ff | 92,960,598,009,271,370,000,000,000,000,000,000,000 | 4 | Fixed bug #79282 |
ext4_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
{
int ret, ret2;
down_read(&EXT4_I(d_inode(dentry))->xattr_sem);
ret = ret2 = ext4_xattr_ibody_list(dentry, buffer, buffer_size);
if (ret < 0)
goto errout;
if (buffer) {
buffer += ret;
buffer_size -= ret;
}
ret = ext4_xattr_block_list... | 0 | [] | linux | 54dd0e0a1b255f115f8647fc6fb93273251b01b9 | 108,183,666,922,274,900,000,000,000,000,000,000,000 | 20 | ext4: add extra checks to ext4_xattr_block_get()
Add explicit checks in ext4_xattr_block_get() just in case the
e_value_offs and e_value_size fields in the the xattr block are
corrupted in memory after the buffer_verified bit is set on the xattr
block.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.or... |
uint32_t ldub_phys(AddressSpace *as, hwaddr addr)
{
return address_space_ldub(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
} | 0 | [] | qemu | e4a511f8cc6f4a46d409fb5c9f72c38ba45f8d83 | 242,588,438,943,786,600,000,000,000,000,000,000,000 | 4 | exec: clamp accesses against the MemoryRegionSection
Because the clamping was done against the MemoryRegion,
address_space_rw was effectively broken if a write spanned
multiple sections that are not linear in underlying memory
(with the memory not being under an IOMMU).
This is visible with the MIPS rc4030 IOMMU, whi... |
static int __ntop_rrd_status(lua_State* vm, int status, char *filename, char *cf) {
char * err;
if(status != 0) {
err = rrd_get_error();
if(err != NULL) {
ntop->getTrace()->traceEvent(TRACE_ERROR,
"Error '%s' while calling rrd_fetch_r(%s, %s): is the RRD corrupted ... | 0 | [
"CWE-476"
] | ntopng | 01f47e04fd7c8d54399c9e465f823f0017069f8f | 113,772,698,489,888,420,000,000,000,000,000,000,000 | 20 | Security fix: prevents empty host from being used |
void jas_matrix_asl(jas_matrix_t *matrix, int n)
{
int i;
int j;
jas_seqent_t *rowstart;
int rowstep;
jas_seqent_t *data;
if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) {
assert(matrix->rows_);
rowstep = jas_matrix_rowstep(matrix);
for (i = matrix->numrows_, rowstart = matrix->rows_[... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 90,711,910,665,492,840,000,000,000,000,000,000,000 | 20 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
static void WriteProfile(j_compress_ptr jpeg_info,Image *image,
ExceptionInfo *exception)
{
const char
*name;
const StringInfo
*profile;
MagickBooleanType
iptc;
register ssize_t
i;
size_t
length,
tag_length;
StringInfo
*custom_profile;
/*
Save image profile as a APP... | 0 | [
"CWE-416"
] | ImageMagick | 39f226a9c137f547e12afde972eeba7551124493 | 115,978,033,905,618,200,000,000,000,000,000,000,000 | 141 | https://github.com/ImageMagick/ImageMagick/issues/1641 |
bool can_create_connection() {
return available_connections.size() < max_connections;
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 123,988,310,403,086,870,000,000,000,000,000,000,000 | 3 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
static __init int user_namespace_sysctl_init(void)
{
#ifdef CONFIG_SYSCTL
static struct ctl_table_header *user_header;
static struct ctl_table empty[1];
/*
* It is necessary to register the user directory in the
* default set so that registrations in the child sets work
* properly.
*/
user_header = register... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 040757f738e13caaa9c5078bca79aa97e11dde88 | 216,142,165,364,291,450,000,000,000,000,000,000,000 | 17 | ucount: Remove the atomicity from ucount->count
Always increment/decrement ucount->count under the ucounts_lock. The
increments are there already and moving the decrements there means the
locking logic of the code is simpler. This simplification in the
locking logic fixes a race between put_ucounts and get_ucounts t... |
static void StoreDataWithHuffmanCodes(const uint8_t* input,
size_t start_pos,
size_t mask,
const Command* commands,
size_t n_commands,
... | 0 | [
"CWE-120"
] | brotli | 223d80cfbec8fd346e32906c732c8ede21f0cea6 | 214,626,842,362,828,960,000,000,000,000,000,000,000 | 39 | Update (#826)
* IMPORTANT: decoder: fix potential overflow when input chunk is >2GiB
* simplify max Huffman table size calculation
* eliminate symbol duplicates (static arrays in .h files)
* minor combing in research/ code |
static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
const char
*comment;
int
bits;
MagickBooleanType
status;
PDBImage
pdb_image;
PDBInfo
pdb_info;
QuantumInfo
*quantum_info;
register const Quantum
*p;
register ... | 1 | [
"CWE-772"
] | ImageMagick | 74f8b6cb2d31651cd34d2830f570979f7db882e0 | 322,765,085,997,777,840,000,000,000,000,000,000,000 | 261 | https://github.com/ImageMagick/ImageMagick/issues/1050 |
nautilus_file_operations_move (GList *files,
GArray *relative_item_points,
GFile *target_dir,
GtkWindow *parent_window,
NautilusCopyCallback ... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 284,600,162,024,480,000,000,000,000,000,000,000,000 | 58 | mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission i... |
bool is_path_sep(char c)
{
static const path sep = path("/").make_preferred();
const std::string s = std::string(1, c);
return sep == path(s).make_preferred();
} | 0 | [
"CWE-200"
] | wesnoth | f8914468182e8d0a1551b430c0879ba236fe4d6d | 143,662,474,612,926,080,000,000,000,000,000,000,000 | 6 | Disallow inclusion of .pbl files from WML (bug #23504)
Note that this will also cause Lua wesnoth.have_file() to return false
on .pbl files. |
TfLiteStatus EvalHybridPerChannel(TfLiteContext* context, TfLiteNode* node,
TfLiteDepthwiseConvParams* params,
OpData* data, const TfLiteTensor* input,
const TfLiteTensor* filter,
cons... | 1 | [
"CWE-908"
] | tensorflow | 8933b8a21280696ab119b63263babdb54c298538 | 337,525,428,317,234,650,000,000,000,000,000,000,000 | 71 | Fix a null pointer exception caused by branching on uninitialized data.
This is due to not checking that the params for the quantization exists. If there is no quantization, we should not access the `.params` field.
PiperOrigin-RevId: 385173491
Change-Id: I8fc476c4b274fdb21ba741caa0fbc6d1b8840663 |
static inline __sum16 dccp_v4_csum_finish(struct sk_buff *skb,
__be32 src, __be32 dst)
{
return csum_tcpudp_magic(src, dst, skb->len, IPPROTO_DCCP, skb->csum);
} | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 206,310,443,967,463,440,000,000,000,000,000,000,000 | 5 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
static void hns_xgmac_exc_irq_en(struct mac_driver *drv, u32 en)
{
u32 clr_vlue = 0xfffffffful;
u32 msk_vlue = en ? 0xfffffffful : 0; /*1 is en, 0 is dis*/
dsaf_write_dev(drv, XGMAC_INT_STATUS_REG, clr_vlue);
dsaf_write_dev(drv, XGMAC_INT_ENABLE_REG, msk_vlue);
} | 0 | [
"CWE-119",
"CWE-703"
] | linux | 412b65d15a7f8a93794653968308fc100f2aa87c | 280,041,923,092,616,400,000,000,000,000,000,000,000 | 8 | net: hns: fix ethtool_get_strings overflow in hns driver
hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated
is not enough for ethtool_get_strings(), which will cause random memory
corruption.
When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the
the following can be observed ... |
static inline bool nested_vmx_prepare_msr_bitmap(struct kvm_vcpu *vcpu,
struct vmcs12 *vmcs12)
{
int msr;
struct page *page;
unsigned long *msr_bitmap_l1;
unsigned long *msr_bitmap_l0 = to_vmx(vcpu)->nested.vmcs02.msr_bitmap;
/*
* pred_cmd & spec_ctrl are trying to verify two things:
*
* 1. L0 gave a ... | 1 | [
"CWE-863"
] | kvm | acff78477b9b4f26ecdf65733a4ed77fe837e9dc | 229,655,181,204,672,040,000,000,000,000,000,000,000 | 89 | KVM: x86: nVMX: close leak of L0's x2APIC MSRs (CVE-2019-3887)
The nested_vmx_prepare_msr_bitmap() function doesn't directly guard the
x2APIC MSR intercepts with the "virtualize x2APIC mode" MSR. As a
result, we discovered the potential for a buggy or malicious L1 to get
access to L0's x2APIC MSRs, via an L2, as follo... |
static bool vmx_segment_cache_test_set(struct vcpu_vmx *vmx, unsigned seg,
unsigned field)
{
bool ret;
u32 mask = 1 << (seg * SEG_FIELD_NR + field);
if (!(vmx->vcpu.arch.regs_avail & (1 << VCPU_EXREG_SEGMENTS))) {
vmx->vcpu.arch.regs_avail |= (1 << VCPU_EXREG_SEGMENTS);
vmx->segment_cache.bitmask = 0... | 0 | [] | kvm | a642fc305053cc1c6e47e4f4df327895747ab485 | 337,293,917,691,121,500,000,000,000,000,000,000,000 | 14 | 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 ... |
PHPAPI char * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
if ((Z_TYPE_P(arg) != IS_LONG && Z_TYPE_P(arg) != IS_DOUBLE) || base < 2 || base > 36) {
return STR_EMPTY_ALLOC();
}
if (Z_TYPE_P(arg) == IS_DOUBLE) {
double fvalue = floor(Z_DVAL... | 0 | [] | php-src | 0d822f6df946764f3f0348b82efae2e1eaa83aa0 | 219,360,497,756,835,400,000,000,000,000,000,000,000 | 32 | Bug #71201 round() segfault on 64-bit builds |
*/
static int
kex_method_ecdh_key_exchange
(LIBSSH2_SESSION * session, key_exchange_state_low_t * key_state)
{
int ret = 0;
int rc = 0;
unsigned char *s;
libssh2_curve_type type;
if(key_state->state == libssh2_NB_state_idle) {
key_state->public_key_oct = NULL;
key_state->state = ... | 0 | [
"CWE-787"
] | libssh2 | dc109a7f518757741590bb993c0c8412928ccec2 | 286,363,469,856,241,150,000,000,000,000,000,000,000 | 104 | Security fixes (#315)
* Bounds checks
Fixes for CVEs
https://www.libssh2.org/CVE-2019-3863.html
https://www.libssh2.org/CVE-2019-3856.html
* Packet length bounds check
CVE
https://www.libssh2.org/CVE-2019-3855.html
* Response length check
CVE
https://www.libssh2.org/CVE-2019-3859.html
* Bounds ch... |
static int smack_key_permission(key_ref_t key_ref,
const struct cred *cred,
enum key_need_perm need_perm)
{
struct key *keyp;
struct smk_audit_info ad;
struct smack_known *tkp = smk_of_task(smack_cred(cred));
int request = 0;
int rc;
/*
* Validate requested permissions
*/
switch (need_perm) {
case ... | 0 | [
"CWE-416"
] | linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | 193,883,237,968,694,470,000,000,000,000,000,000,000 | 61 | selinux,smack: fix subjective/objective credential use mixups
Jann Horn reported a problem with commit eb1231f73c4d ("selinux:
clarify task subjective and objective credentials") where some LSM
hooks were attempting to access the subjective credentials of a task
other than the current task. Generally speaking, it is ... |
WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
const char **argv,Image **image,ExceptionInfo *exception)
{
CompositeOperator
compose;
const char
*format,
*option;
double
attenuate;
DrawInfo
*draw_info;
GeometryInfo
geometry_info;
ImageInfo
... | 0 | [
"CWE-617"
] | ImageMagick | 12f34b60564de1cbec08e23e2413dab5b64daeb7 | 12,385,367,087,054,182,000,000,000,000,000,000,000 | 2,725 | https://github.com/ImageMagick/ImageMagick/issues/802 |
suspend(int signo, struct sudo_conv_callback *callback)
{
int ret = 0;
debug_decl(suspend, SUDO_DEBUG_CONV);
if (callback != NULL && SUDO_API_VERSION_GET_MAJOR(callback->version) != SUDO_CONV_CALLBACK_VERSION_MAJOR) {
sudo_debug_printf(SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO,
"callback major version mismat... | 0 | [
"CWE-787"
] | sudo | fa8ffeb17523494f0e8bb49a25e53635f4509078 | 53,307,289,282,268,990,000,000,000,000,000,000,000 | 24 | Fix a buffer overflow when pwfeedback is enabled and input is a not a tty.
In getln() if the user enters ^U (erase line) and the write(2) fails,
the remaining buffer size is reset but the current pointer is not.
While here, fix an incorrect break for erase when write(2) fails.
Also disable pwfeedback when input is not ... |
mono_image_get_methodspec_token_for_generic_method_definition (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb)
{
MonoDynamicTable *table;
guint32 *values;
guint32 token, mtoken = 0;
token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->methodspec, mb));
if (token)
return token;
table = &a... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 202,384,943,825,578,800,000,000,000,000,000,000,000 | 37 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
bool LEX::sp_while_loop_expression(THD *thd, Item *expr)
{
sp_instr_jump_if_not *i= new (thd->mem_root)
sp_instr_jump_if_not(sphead->instructions(), spcont, expr, this);
return (unlikely(i == NULL) ||
/* Jumping forward */
unlikely(sphead->push_backpatch(thd, i, spcont->last_label())) ||
... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 293,475,548,521,810,830,000,000,000,000,000,000,000 | 10 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
rrinternal_get_owner(sldns_buffer* strbuf, uint8_t* rr, size_t* len,
size_t* dname_len, uint8_t* origin, size_t origin_len, uint8_t* prev,
size_t prev_len, char* token, size_t token_len)
{
/* split the rr in its parts -1 signals trouble */
if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
return RET... | 0 | [
"CWE-190"
] | unbound | a3545867fcdec50307c776ce0af28d07046a52dd | 146,132,373,878,334,030,000,000,000,000,000,000,000 | 55 | - Fix Integer Overflow to Buffer Overflow in
sldns_str2wire_dname_buf_origin(), reported by X41 D-Sec. |
CreateForeignServer(CreateForeignServerStmt *stmt)
{
Relation rel;
Datum srvoptions;
Datum values[Natts_pg_foreign_server];
bool nulls[Natts_pg_foreign_server];
HeapTuple tuple;
Oid srvId;
Oid ownerId;
AclResult aclresult;
ObjectAddress myself;
ObjectAddress referenced;
ForeignDataWrapper *fdw;
rel ... | 1 | [
"CWE-94"
] | postgres | 5919bb5a5989cda232ac3d1f8b9d90f337be2077 | 333,851,376,671,222,400,000,000,000,000,000,000,000 | 118 | In extensions, don't replace objects not belonging to the extension.
Previously, if an extension script did CREATE OR REPLACE and there was
an existing object not belonging to the extension, it would overwrite
the object and adopt it into the extension. This is problematic, first
because the overwrite is probably uni... |
rfbProcessClientNormalMessage(rfbClientPtr cl)
{
int n=0;
rfbClientToServerMsg msg;
char *str;
if ((n = ReadExact(cl, (char *)&msg, 1)) <= 0) {
if (n != 0)
rfbLogPerror("rfbProcessClientNormalMessage: read");
rfbCloseClient(cl);
return;
}
switch (msg.type) {... | 0 | [
"CWE-200"
] | vino | 9c8b9f81205203db6c31068babbfb8a734acacdb | 172,361,142,748,409,660,000,000,000,000,000,000,000 | 312 | Do not leak clipboard to unauthenticated clients
vino_server_clipboard_cb() in vino-server.c is the callback which is
triggered when a clipboard copy event is fired.
After doing some initial checks, (1. If there are any connected clients,
2. If the server is on hold etc), it converts the text to UTF-8 and then
passes... |
void controller::reload_range(unsigned int start, unsigned int end, unsigned int size, bool unattended) {
std::vector<unsigned int> v;
for (unsigned int i=start; i<=end; ++i)
v.push_back(i);
auto extract = [](std::string& s, const std::string& url) {
size_t p = url.find("//");
p = (p == std::string::npos) ? ... | 0 | [
"CWE-943",
"CWE-787"
] | newsbeuter | 96e9506ae9e252c548665152d1b8968297128307 | 91,365,516,080,685,770,000,000,000,000,000,000,000 | 30 | Sanitize inputs to bookmark-cmd (#591)
Newsbeuter didn't properly shell-escape the arguments passed to
bookmarking command, which allows a remote attacker to perform remote
code execution by crafting an RSS item whose title and/or URL contain
something interpretable by the shell (most notably subshell
invocations.)
T... |
MONGO_EXPORT const char *mongo_cursor_data( mongo_cursor *cursor ) {
return cursor->current.data;
} | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 16,779,476,533,397,036,000,000,000,000,000,000,000 | 3 | don't mix up int and size_t (first pass to fix that) |
TEST_P(Http2CodecImplFlowControlTest, TestFlowControlInPendingSendData) {
initialize();
MockStreamCallbacks callbacks;
request_encoder_->getStream().addCallbacks(callbacks);
TestRequestHeaderMapImpl request_headers;
HttpTestUtility::addDefaultHeaders(request_headers);
TestRequestHeaderMapImpl expected_head... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 3,270,631,891,305,131,000,000,000,000,000,000,000 | 104 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
ArgParser::argPages()
{
++cur_arg;
o.page_specs = parsePagesOptions();
if (o.page_specs.empty())
{
usage("--pages: no page specifications given");
}
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 273,536,643,655,054,970,000,000,000,000,000,000,000 | 9 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
struct net_device *netdev, u16 reason,
const u8 *ie, size_t ie_len, bool from_ap)
{
struct sk_buff *msg;
void *hdr;
msg = nlmsg_new(100 + ie_len, GFP_KERNEL);
if (!msg)
return;
hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 149,078,412,540,714,640,000,000,000,000,000,000,000 | 35 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
Value ExpressionMeta::serialize(bool explain) const {
const auto nameIter = kMetaTypeToMetaName.find(_metaType);
invariant(nameIter != kMetaTypeToMetaName.end());
return Value(DOC("$meta" << nameIter->second));
} | 0 | [] | mongo | 1772b9a0393b55e6a280a35e8f0a1f75c014f301 | 32,471,630,722,254,776,000,000,000,000,000,000,000 | 5 | SERVER-49404 Enforce additional checks in $arrayToObject |
to_callback_empty_output_buffer (j_compress_ptr cinfo)
{
ToFunctionDestinationManager *destmgr;
destmgr = (ToFunctionDestinationManager*) cinfo->dest;
to_callback_do_write (cinfo, TO_FUNCTION_BUF_SIZE);
destmgr->pub.next_output_byte = destmgr->buffer;
destmgr->pub.free_in_buffer = TO_FUNCTION_BUF_SIZE;
return TR... | 0 | [
"CWE-787"
] | gdk-pixbuf | c2a40a92fe3df4111ed9da51fe3368c079b86926 | 257,767,282,795,754,540,000,000,000,000,000,000,000 | 10 | jpeg: Throw error when number of color components is unsupported
Explicitly check "3" or "4" output color components.
gdk-pixbuf assumed that the value of output_components to be either
3 or 4, but not an invalid value (9) or an unsupported value (1).
The way the buffer size was deduced was using a naive "== 4" chec... |
MYSQL * STDCALL
CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag)
{
char buff[NAME_LEN+USERNAME_LENGTH+100];
int scramble_data_len, pkt_scramble_len= 0;
char *end,... | 1 | [] | mysql-server | bbc2e37fe4e0ca3a7cfa1437a763dc43829e98e2 | 171,400,388,660,020,100,000,000,000,000,000,000,000 | 566 | Bug#27759871: BACKRONYM ISSUE IS STILL IN MYSQL 5.7
Description:- Client applications establishes connection to
server, which does not support SSL, via TCP even when SSL is
enforced via MYSQL_OPT_SSL_MODE or MYSQL_OPT_SSL_ENFORCE or
MYSQL_OPT_SSL_VERIFY_SERVER_CERT.
Analysis:- There exist no error handling for catchi... |
int _yr_emit_inst(
RE_EMIT_CONTEXT* emit_context,
uint8_t opcode,
uint8_t** instruction_addr,
size_t* code_size)
{
FAIL_ON_ERROR(yr_arena_write_data(
emit_context->arena,
&opcode,
sizeof(uint8_t),
(void**) instruction_addr));
*code_size = sizeof(uint8_t);
return ERROR_SUC... | 0 | [
"CWE-674",
"CWE-787"
] | yara | 925bcf3c3b0a28b5b78e25d9efda5c0bf27ae699 | 134,501,657,688,905,430,000,000,000,000,000,000,000 | 16 | Fix issue #674. Move regexp limits to limits.h. |
void RGWListBuckets_ObjStore_SWIFT::send_response_data(RGWUserBuckets& buckets)
{
if (! sent_data) {
return;
}
/* Take care of the prefix parameter of Swift API. There is no business
* in applying the filter earlier as we really need to go through all
* entries regardless of it (the headers like X-Acco... | 0 | [
"CWE-617"
] | ceph | f44a8ae8aa27ecef69528db9aec220f12492810e | 55,277,790,542,689,240,000,000,000,000,000,000,000 | 17 | rgw: RGWSwiftWebsiteHandler::is_web_dir checks empty subdir_name
checking for empty name avoids later assertion in RGWObjectCtx::set_atomic
Fixes: CVE-2021-3531
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7196a469b4470f3c8628489df9a41ec8b... |
hfs_drive_compressor(struct archive_write_disk *a, const char *buff,
size_t size)
{
unsigned char *buffer_compressed;
size_t bytes_compressed;
size_t bytes_used;
int ret;
ret = hfs_reset_compressor(a);
if (ret != ARCHIVE_OK)
return (ret);
if (a->compressed_buffer == NULL) {
size_t block_size;
block_... | 0 | [
"CWE-703",
"CWE-22"
] | libarchive | 59357157706d47c365b2227739e17daba3607526 | 464,382,419,369,531,800,000,000,000,000,000,000 | 149 | Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option
This fixes a directory traversal in the cpio tool. |
void term_force_colors(int set)
{
terminfo_setup_colors(current_term, set);
} | 0 | [
"CWE-476"
] | irssi | 6c6c42e3d1b49d90aacc0b67f8540471cae02a1d | 203,564,782,349,220,400,000,000,000,000,000,000,000 | 4 | Merge branch 'security' into 'master'
See merge request !7 |
njs_generate_function_call_arguments(njs_vm_t *vm, njs_generator_t *generator,
njs_parser_node_t *node)
{
njs_int_t ret;
njs_jump_off_t func_offset;
njs_parser_node_t *name;
njs_vmcode_function_frame_t *func;
name = node;
if (node->left != NULL)... | 0 | [
"CWE-703",
"CWE-754"
] | njs | 404553896792b8f5f429dc8852d15784a59d8d3e | 70,533,293,441,713,440,000,000,000,000,000,000,000 | 40 | Fixed break instruction in a try-catch block.
Previously, JUMP offset for a break instruction inside a try-catch
block was not set to a correct offset during code generation
when a return instruction was present in inner try-catch block.
The fix is to update the JUMP offset appropriately.
This closes #553 issue on G... |
static struct dentry *proc_pident_lookup(struct inode *dir,
struct dentry *dentry,
const struct pid_entry *ents,
unsigned int nents)
{
int error;
struct task_struct *task = get_proc_task(dir);
const struct pid_entry *p, *last;
error = -ENOENT;
if (!task)
goto out_no_task;
/*
* Yes, it do... | 0 | [
"CWE-119"
] | linux | 7f7ccc2ccc2e70c6054685f5e3522efa81556830 | 295,602,976,273,495,400,000,000,000,000,000,000,000 | 34 | proc: do not access cmdline nor environ from file-backed areas
proc_pid_cmdline_read() and environ_read() directly access the target
process' VM to retrieve the command line and environment. If this
process remaps these areas onto a file via mmap(), the requesting
process may experience various issues such as extra de... |
_Unpickler_NewMemo(Py_ssize_t new_size)
{
PyObject **memo = PyMem_NEW(PyObject *, new_size);
if (memo == NULL) {
PyErr_NoMemory();
return NULL;
}
memset(memo, 0, new_size * sizeof(PyObject *));
return memo;
} | 0 | [
"CWE-190",
"CWE-369"
] | cpython | a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd | 188,949,251,728,996,370,000,000,000,000,000,000,000 | 10 | closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261) |
int_to_roman(int number)
{
int len = 0,
num = 0;
char *p = NULL,
*result,
numstr[5];
result = (char *) palloc(16);
*result = '\0';
if (number > 3999 || number < 1)
{
fill_str(result, '#', 15);
return result;
}
len = snprintf(numstr, sizeof(numstr), "%d", number);
for (p = numstr; *p !... | 0 | [
"CWE-120"
] | postgres | 0150ab567bcf5e5913e2b62a1678f84cc272441f | 292,502,499,470,320,930,000,000,000,000,000,000,000 | 41 | 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 |
static int userfaultfd_zeropage(struct userfaultfd_ctx *ctx,
unsigned long arg)
{
__s64 ret;
struct uffdio_zeropage uffdio_zeropage;
struct uffdio_zeropage __user *user_uffdio_zeropage;
struct userfaultfd_wake_range range;
user_uffdio_zeropage = (struct uffdio_zeropage __user *) arg;
ret = -EAGAIN;
if (REA... | 0 | [
"CWE-362",
"CWE-703",
"CWE-667"
] | linux | 04f5866e41fb70690e28397487d8bd8eea7d712a | 187,167,248,061,705,150,000,000,000,000,000,000,000 | 51 | coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
The core dumping code has always run without holding the mmap_sem for
writing, despite that is the only way to ensure that the entire vma
layout will not change from under it. Only using some signal
serialization on the processes bel... |
static void ResetPixelList(PixelList *pixel_list)
{
int
level;
register SkipNode
*root;
register SkipList
*p;
/*
Reset the skip-list.
*/
p=(&pixel_list->skip_list);
root=p->nodes+65536UL;
p->level=0;
for (level=0; level < 9; level++)
root->next[level]=65536UL;
pixel_list->seed... | 0 | [
"CWE-119",
"CWE-787"
] | ImageMagick | 025e77fcb2f45b21689931ba3bf74eac153afa48 | 219,285,301,301,037,960,000,000,000,000,000,000,000 | 21 | https://github.com/ImageMagick/ImageMagick/issues/1615 |
int DateGreaterThan(const struct tm* a, const struct tm* b)
{
if (a->tm_year > b->tm_year)
return 1;
if (a->tm_year == b->tm_year && a->tm_mon > b->tm_mon)
return 1;
if (a->tm_year == b->tm_year && a->tm_mon == b->tm_mon &&
a->tm_mday > b->tm_mday)
return 1;
if (a->... | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 181,677,997,017,112,200,000,000,000,000,000,000,000 | 28 | OCSP: improve handling of OCSP no check extension |
TEST_P(Http2RingHashIntegrationTest, CookieRoutingWithCookieWithTtlSet) {
config_helper_.addConfigModifier(
[&](envoy::config::filter::network::http_connection_manager::v2::HttpConnectionManager& hcm)
-> void {
auto* hash_policy = hcm.mutable_route_config()
->mu... | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 307,693,259,503,917,620,000,000,000,000,000,000,000 | 30 | 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 inline bool guest_inject_ac(struct kvm_vcpu *vcpu)
{
if (!boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT))
return true;
return vmx_get_cpl(vcpu) == 3 && kvm_read_cr0_bits(vcpu, X86_CR0_AM) &&
(kvm_get_rflags(vcpu) & X86_EFLAGS_AC);
} | 0 | [
"CWE-787"
] | linux | 04c4f2ee3f68c9a4bf1653d15f1a9a435ae33f7a | 164,293,823,925,212,800,000,000,000,000,000,000,000 | 8 | KVM: VMX: Don't use vcpu->run->internal.ndata as an array index
__vmx_handle_exit() uses vcpu->run->internal.ndata as an index for
an array access. Since vcpu->run is (can be) mapped to a user address
space with a writer permission, the 'ndata' could be updated by the
user process at anytime (the user process can set... |
static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem) { /* {{{ */
if (!Z_ISUNDEF(elem->data)) {
zval_ptr_dtor(&elem->data);
ZVAL_UNDEF(&elem->data);
}
} | 0 | [
"CWE-415"
] | php-src | 28a6ed9f9a36b9c517e4a8a429baf4dd382fc5d5 | 248,582,188,298,125,600,000,000,000,000,000,000,000 | 6 | Fix bug #71735: Double-free in SplDoublyLinkedList::offsetSet |
int ipt_register_table(struct net *net, const struct xt_table *table,
const struct ipt_replace *repl,
const struct nf_hook_ops *ops, struct xt_table **res)
{
int ret;
struct xt_table_info *newinfo;
struct xt_table_info bootstrap = {0};
void *loc_cpu_entry;
struct xt_table *new_table;
newinfo = ... | 0 | [
"CWE-787"
] | linux | b29c457a6511435960115c0f548c4360d5f4801d | 320,953,773,834,618,670,000,000,000,000,000,000,000 | 44 | netfilter: x_tables: fix compat match/target pad out-of-bound write
xt_compat_match/target_from_user doesn't check that zeroing the area
to start of next rule won't write past end of allocated ruleset blob.
Remove this code and zero the entire blob beforehand.
Reported-by: syzbot+cfc0247ac173f597aaaa@syzkaller.appsp... |
static void bar_reset(struct pci_dev *dev, int offset, void *data)
{
struct pci_bar_info *bar = data;
bar->which = 0;
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | af6fc858a35b90e89ea7a7ee58e66628c55c776b | 240,606,051,166,888,200,000,000,000,000,000,000,000 | 6 | xen-pciback: limit guest control of command register
Otherwise the guest can abuse that control to cause e.g. PCIe
Unsupported Request responses by disabling memory and/or I/O decoding
and subsequently causing (CPU side) accesses to the respective address
ranges, which (depending on system configuration) may be fatal ... |
Job *manager_get_job(Manager *m, uint32_t id) {
assert(m);
return hashmap_get(m->jobs, UINT32_TO_PTR(id));
} | 0 | [
"CWE-20"
] | systemd | 531ac2b2349da02acc9c382849758e07eb92b020 | 333,340,921,301,928,170,000,000,000,000,000,000,000 | 5 | If the notification message length is 0, ignore the message (#4237)
Fixes #4234.
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org> |
static void constInsert(
WhereConst *pConst, /* The WhereConst into which we are inserting */
Expr *pColumn, /* The COLUMN part of the constraint */
Expr *pValue, /* The VALUE part of the constraint */
Expr *pExpr /* Overall expression: COLUMN=VALUE or VALUE=COLUMN */
){
int i;
assert... | 0 | [
"CWE-125"
] | sqlite | 39df24a3f02495e5ef6bb5ea8ce029a2c1e377e6 | 246,627,192,045,639,050,000,000,000,000,000,000,000 | 42 | Do not allow the constant-propagation optimization to apple to ON/USING clause
terms as it does not help and it might cause downstream problems.
FossilOrigin-Name: 1bc783da63d58b05c690468b569cb2787846357b63c1100d11777666c5787bf4 |
TEST(LtOp, MatchesNull) {
BSONObj operand = BSON("$lt" << BSONNULL);
LTMatchExpression lt("a", operand["$lt"]);
ASSERT(!lt.matchesBSON(BSONObj(), NULL));
ASSERT(!lt.matchesBSON(BSON("a" << BSONNULL), NULL));
ASSERT(!lt.matchesBSON(BSON("a" << 4), NULL));
// A non-existent field is treated same w... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 217,947,705,643,999,720,000,000,000,000,000,000,000 | 9 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
static void free_segments(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(link.tx.buf); i++) {
struct net_buf *buf = link.tx.buf[i];
if (!buf) {
break;
}
link.tx.buf[i] = NULL;
/* Mark as canceled */
BT_MESH_ADV(buf)->busy = 0U;
net_buf_unref(buf);
}
} | 0 | [
"CWE-787"
] | zephyr | 6ec31c852049641095f2cdf25591f2e1bff86774 | 23,321,695,278,762,866,000,000,000,000,000,000,000 | 17 | Bluetooth: Mesh: Check SegN when receiving Transaction Start PDU
When receiving Transaction Start PDU, assure that number of segments
needed to send a Provisioning PDU with TotalLength size is equal to SegN
value provided in the Transaction Start PDU.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
(cher... |
PgUser *find_user(const char *name)
{
PgUser *user = NULL;
struct AANode *node;
node = aatree_search(&user_tree, (uintptr_t)name);
user = node ? container_of(node, PgUser, tree_node) : NULL;
return user;
} | 0 | [] | pgbouncer | 4b92112b820830b30cd7bc91bef3dd8f35305525 | 68,371,688,194,405,880,000,000,000,000,000,000,000 | 9 | add_database: fail gracefully if too long db name
Truncating & adding can lead to fatal() later.
It was not an issue before, but with audodb (* in [databases] section)
the database name can some from network, thus allowing remote shutdown.. |
static PresentationContext* PresentationContext_new(VideoClientContext* video, BYTE PresentationId,
UINT32 x, UINT32 y, UINT32 width, UINT32 height)
{
size_t s;
VideoClientContextPriv* priv = video->priv;
PresentationContext* ret;
s = width * height * 4ULL;
if (s... | 0 | [
"CWE-190"
] | FreeRDP | 06c32f170093a6ecde93e3bc07fed6a706bfbeb3 | 80,418,200,635,277,460,000,000,000,000,000,000,000 | 69 | Fixed int overflow in PresentationContext_new
Thanks to hac425 CVE-2020-11038 |
void pop_capture_scope() { capture_scope_stack_size--; } | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 168,541,599,468,771,440,000,000,000,000,000,000,000 | 1 | Fix #122 |
wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
{
int error;
error = wait_event_freezekillable(server->response_q,
midQ->mid_state != MID_REQUEST_SUBMITTED);
if (error < 0)
return -ERESTARTSYS;
return 0;
} | 0 | [
"CWE-362"
] | linux | ea702b80e0bbb2448e201472127288beb82ca2fe | 332,926,442,924,300,700,000,000,000,000,000,000,000 | 11 | cifs: move check for NULL socket into smb_send_rqst
Cai reported this oops:
[90701.616664] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
[90701.625438] IP: [<ffffffff814a343e>] kernel_setsockopt+0x2e/0x60
[90701.632167] PGD fea319067 PUD 103fda4067 PMD 0
[90701.637255] Oops: 0000 [#1] SMP
... |
static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
char *name, unsigned long fd, int subvol,
u64 *transid, bool readonly,
struct btrfs_qgroup_inherit **inherit)
{
int namelen;
int ret = 0;
ret = mnt_want_write_file(file);
if (ret)
goto out;
namelen = strlen(name);
if (strchr(na... | 0 | [
"CWE-310"
] | linux-2.6 | 9c52057c698fb96f8f07e7a4bcf4801a092bda89 | 38,691,782,957,275,170,000,000,000,000,000,000,000 | 52 | Btrfs: fix hash overflow handling
The handling for directory crc hash overflows was fairly obscure,
split_leaf returns EOVERFLOW when we try to extend the item and that is
supposed to bubble up to userland. For a while it did so, but along the
way we added better handling of errors and forced the FS readonly if we
hi... |
double ha_maria::scan_time()
{
if (file->s->data_file_type == BLOCK_RECORD)
return (ulonglong2double(stats.data_file_length - file->s->block_size) /
file->s->block_size) + 2;
return handler::scan_time();
} | 0 | [
"CWE-400"
] | server | 9e39d0ae44595dbd1570805d97c9c874778a6be8 | 217,982,744,865,630,000,000,000,000,000,000,000,000 | 7 | MDEV-25787 Bug report: crash on SELECT DISTINCT thousands_blob_fields
fix a debug assert to account for not opened temp tables |
START_TEST(evcode_prop_parser)
{
struct parser_test_tuple {
const char *prop;
bool success;
size_t ntuples;
int tuples[20];
} tests[] = {
{ "EV_KEY", true, 1, {EV_KEY, 0xffff} },
{ "EV_ABS;", true, 1, {EV_ABS, 0xffff} },
{ "ABS_X;", true, 1, {EV_ABS, ABS_X} },
{ "SW_TABLET_MODE;", true, 1, {EV_SW, SW_... | 0 | [
"CWE-134"
] | libinput | a423d7d3269dc32a87384f79e29bb5ac021c83d1 | 265,096,064,761,667,880,000,000,000,000,000,000,000 | 73 | 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... |
int server_supports_feature(const char *c, const char *feature,
int die_on_error)
{
int i;
for (i = 0; i < server_capabilities_v2.argc; i++) {
const char *out;
if (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&
(!*out || *(out++) == '=')) {
if (parse_feature_request(out, feature))
re... | 0 | [] | git | a02ea577174ab8ed18f847cf1693f213e0b9c473 | 177,702,202,284,296,570,000,000,000,000,000,000,000 | 21 | git_connect_git(): forbid newlines in host and path
When we connect to a git:// server, we send an initial request that
looks something like:
002dgit-upload-pack repo.git\0host=example.com
If the repo path contains a newline, then it's included literally, and
we get:
002egit-upload-pack repo
.git\0host=exampl... |
static inline u32 nfsd4_access_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
{
/* ac_supported, ac_resp_access */
return (op_encode_hdr_size + 2)* sizeof(__be32);
} | 0 | [
"CWE-20",
"CWE-129"
] | linux | b550a32e60a4941994b437a8d662432a486235a5 | 36,168,806,932,321,840,000,000,000,000,000,000,000 | 5 | nfsd: fix undefined behavior in nfsd4_layout_verify
UBSAN: Undefined behaviour in fs/nfsd/nfs4proc.c:1262:34
shift exponent 128 is too large for 32-bit type 'int'
Depending on compiler+architecture, this may cause the check for
layout_type to succeed for overly large values (which seems to be the
case with amd64)... |
static void FVMenuOpen(GWindow gw, struct gmenuitem *UNUSED(mi), GEvent *UNUSED(e)) {
FontView *fv = (FontView*) GDrawGetUserData(gw);
_FVMenuOpen(fv);
} | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 339,709,335,699,771,100,000,000,000,000,000,000,000 | 4 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
static void xemaclite_disable_interrupts(struct net_local *drvdata)
{
u32 reg_data;
/* Disable the Global Interrupt Enable */
xemaclite_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);
/* Disable the Tx interrupts for the first buffer */
reg_data = xemaclite_readl(drvdata->base_addr + XEL_TSR_OFF... | 0 | [
"CWE-703",
"CWE-824"
] | linux | d0d62baa7f505bd4c59cd169692ff07ec49dde37 | 157,501,197,766,250,910,000,000,000,000,000,000,000 | 17 | net: xilinx_emaclite: Do not print real IOMEM pointer
Printing kernel pointers is discouraged because they might leak kernel
memory layout. This fixes smatch warning:
drivers/net/ethernet/xilinx/xilinx_emaclite.c:1191 xemaclite_of_probe() warn:
argument 4 to %08lX specifier is cast from pointer
Signed-off-by: YueH... |
void run_with_new_reader() {
BundleReader reader(Env::Default(), reader_prefix);
if (!reader.status().ok()) {
status = reader.status();
return;
}
status = run(&reader);
} | 0 | [
"CWE-476"
] | tensorflow | 9e82dce6e6bd1f36a57e08fa85af213e2b2f2622 | 230,929,883,981,113,970,000,000,000,000,000,000,000 | 9 | Fix NPE in restoring code.
PiperOrigin-RevId: 388303253
Change-Id: Ia8c68568cb854bca538909a182b31a618d68ce55 |
R_API const char *r_sub_str_rchr(const char *str, int start, int end, char chr) {
while (str[start] != chr && start < end) {
start++;
}
return str[start] == chr ? str + start : NULL;
} | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 27,351,330,022,360,750,000,000,000,000,000,000,000 | 6 | Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being creat... |
struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len)
{
struct dma_pinned_list *local_list;
struct page **pages;
int i;
int ret;
int nr_iovecs = 0;
int iovec_len_used = 0;
int iovec_pages_used = 0;
/* don't pin down non-user-based iovecs */
if (segment_eq(get_fs(), KERNEL_DS))
return NU... | 1 | [] | linux | 7bced397510ab569d31de4c70b39e13355046387 | 253,672,037,937,125,040,000,000,000,000,000,000,000 | 73 | net_dma: simple removal
Per commit "77873803363c net_dma: mark broken" net_dma is no longer used
and there is no plan to fix it.
This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards.
Reverting the remainder of the net_dma induced changes is deferred to
subsequent patches.
Marked for stable due to Ro... |
static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_type *ImageInfo, int type, const char *format, ...)
{
va_list args;
va_start(args, format);
#ifdef EXIF_DEBUG
{
char *buf;
spprintf(&buf, 0, "%s(%d): %s", _file, _line, format);
php_verror(docref, ImageInfo && ImageInfo->FileName ?... | 0 | [
"CWE-416"
] | php-src | 3fdde65617e9f954e2c964768aac8831005497e5 | 328,825,840,101,241,200,000,000,000,000,000,000,000 | 18 | Fix #76409: heap use after free in _php_stream_free
We must not close the stream in exif_read_from_impl(), since it is the
responsibility of the (caller's) caller to do so, if it actually opened
the stream.
We simplify the reproduce script, which is actually about supplying a
path to a directory (opposed to a regular... |
static void Ins_IDEF( INS_ARG )
{
if (CUR.countIDefs >= CUR.numIDefs || args[0] > 255)
CUR.error = TT_Err_Storage_Overflow;
else
{
PDefRecord pTDR;
CUR.IDefPtr[(Byte)(args[0])] = CUR.countIDefs;
pTDR = &CUR.IDefs[CUR.countIDefs++];
pTDR->Opc = (Byte)(args[0... | 0 | [
"CWE-125"
] | ghostpdl | c7c55972758a93350882c32147801a3485b010fe | 66,381,889,591,886,520,000,000,000,000,000,000,000 | 17 | Bug 698024: bounds check zone pointer in Ins_MIRP() |
static int update_add_entry(struct libmnt_update *upd, struct libmnt_lock *lc)
{
FILE *f;
int rc = 0, u_lc = -1;
assert(upd);
assert(upd->fs);
DBG(UPDATE, mnt_debug_h(upd, "%s: add entry", upd->filename));
if (lc)
mnt_lock_file(lc);
else if (upd->userspace_only)
u_lc = utab_lock(upd->filename);
f = fope... | 1 | [
"CWE-399"
] | util-linux | 84ed14022e7d3d121bbcab60ebad11ed38d691b0 | 124,528,723,529,018,700,000,000,000,000,000,000,000 | 31 | libmount: more robust mtab and utab update (CVE-2011-1676, CVE-2011-1677)
http://thread.gmane.org/gmane.comp.security.oss.general/4374
Changes:
- always use temporary file
- use fflush() for the temporary file
- check fprintf() return value
Signed-off-by: Karel Zak <kzak@redhat.com> |
SWTPM_NVRAM_KeyParamCheck(uint32_t keylen,
enum encryption_mode encmode)
{
TPM_RESULT rc = 0;
if (keylen != SWTPM_AES128_BLOCK_SIZE &&
keylen != SWTPM_AES256_BLOCK_SIZE) {
rc = TPM_BAD_KEY_PROPERTY;
}
switch (encmode) {
case ENCRYPTION_MODE_AES_CBC:
... | 0 | [] | swtpm | cae5991423826f21b11f7a5bc7f7b2b538bde2a2 | 261,530,183,426,363,140,000,000,000,000,000,000,000 | 18 | swtpm: Do not follow symlinks when opening lockfile (CVE-2020-28407)
This patch addresses CVE-2020-28407.
Prevent us from following symliks when we open the lockfile
for writing.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
void log_close(void) {
if (LogFD != ERR) {
close(LogFD);
LogFD = ERR;
}
#if defined(SYSLOG)
closelog();
syslog_open = FALSE;
#endif /*SYSLOG*/
} | 0 | [
"CWE-476"
] | cronie | a6576769f01325303b11edc3e0cfb05ef382ce56 | 258,303,978,825,894,000,000,000,000,000,000,000,000 | 10 | Fix CVE-2019-9704 and CVE-2019-9705
The users can cause DoS of the crond by loading huge crontab files.
We now allow maximum 1000 environment variables and 1000 crontab entries.
Also the comments and whitespace between the entries and variables
are now limited to 32768 characters. |
void MatrixElemTypeFree(cmsStage* mpe)
{
_cmsStageMatrixData* Data = (_cmsStageMatrixData*) mpe ->Data;
if (Data ->Double)
_cmsFree(mpe ->ContextID, Data ->Double);
if (Data ->Offset)
_cmsFree(mpe ->ContextID, Data ->Offset);
_cmsFree(mpe ->ContextID, mpe ->Data);
} | 1 | [] | Little-CMS | 03f784fe8d5eaf8353e8521799a301b8a188388c | 210,548,044,789,289,750,000,000,000,000,000,000,000 | 11 | Memory squeezing bug: lcms2 MatrixElemTypeFree
Destructors should cope with NULL. |
static int sony_get_bt_devaddr(struct sony_sc *sc)
{
int ret;
/* HIDP stores the device MAC address as a string in the uniq field. */
ret = strlen(sc->hdev->uniq);
if (ret != 17)
return -EINVAL;
ret = sscanf(sc->hdev->uniq,
"%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
&sc->mac_address[5], &sc->mac_address[... | 0 | [
"CWE-787"
] | linux | d9d4b1e46d9543a82c23f6df03f4ad697dab361b | 65,208,633,579,375,760,000,000,000,000,000,000,000 | 19 | 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... |
OFBool DcmSCP::getRespondWithCalledAETitle() const
{
return m_cfg->getRespondWithCalledAETitle();
} | 0 | [
"CWE-264"
] | dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | 320,022,332,653,013,400,000,000,000,000,000,000,000 | 4 | Make sure to handle setuid() return code properly.
In some tools the return value of setuid() is not checked. In the worst
case this could lead to privilege escalation since the process does not
give up its root privileges and continue as root. |
fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst)
{
struct inet_frag_queue *q;
struct ip6_create_arg arg;
unsigned int hash;
arg.id = id;
arg.user = user;
arg.src = src;
arg.dst = dst;
read_lock_bh(&nf_frags.lock);
hash = inet6_hash_frag(id, src, dst, nf_frags.rnd);
q = inet_frag_fin... | 0 | [] | linux-2.6 | 9e2dcf72023d1447f09c47d77c99b0c49659e5ce | 281,389,985,905,987,880,000,000,000,000,000,000,000 | 25 | netfilter: nf_conntrack_reasm: properly handle packets fragmented into a single fragment
When an ICMPV6_PKT_TOOBIG message is received with a MTU below 1280,
all further packets include a fragment header.
Unlike regular defragmentation, conntrack also needs to "reassemble"
those fragments in order to obtain a packet ... |
SV*
Perl_reg_qr_package(pTHX_ REGEXP * const rx)
{
PERL_ARGS_ASSERT_REG_QR_PACKAGE;
PERL_UNUSED_ARG(rx);
if (0)
return NULL;
else
return newSVpvs("Regexp"); | 0 | [
"CWE-190",
"CWE-787"
] | perl5 | 897d1f7fd515b828e4b198d8b8bef76c6faf03ed | 283,096,751,166,801,450,000,000,000,000,000,000,000 | 9 | regcomp.c: Prevent integer overflow from nested regex quantifiers.
(CVE-2020-10543) On 32bit systems the size calculations for nested regular
expression quantifiers could overflow causing heap memory corruption.
Fixes: Perl/perl5-security#125
(cherry picked from commit bfd31397db5dc1a5c5d3e0a1f753a4f89a736e71) |
PHP_MSHUTDOWN_FUNCTION(curl)
{
curl_global_cleanup();
#ifdef PHP_CURL_NEED_OPENSSL_TSL
if (php_curl_openssl_tsl) {
int i, c = CRYPTO_num_locks();
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);
for (i = 0; i < c; ++i) {
tsrm_mutex_free(php_curl_openssl_tsl[i]);
}
free(php_curl_opens... | 0 | [] | php-src | 124fb22a13fafa3648e4e15b4f207c7096d8155e | 129,555,703,719,630,190,000,000,000,000,000,000,000 | 21 | Fixed bug #68739 #68740 #68741 |
equal_gen(VALUE self, VALUE other)
{
get_d1(self);
if (k_numeric_p(other))
return f_eqeq_p(m_real_local_jd(dat), other);
else if (k_date_p(other))
return f_eqeq_p(m_real_local_jd(dat), f_jd(other));
return rb_num_coerce_cmp(self, other, id_eqeq_p);
} | 0 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 185,305,479,370,249,680,000,000,000,000,000,000,000 | 10 | Add length limit option for methods that parses date strings
`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.
Not only `Date.parse`... |
static int ext4_ext_search_left(struct inode *inode,
struct ext4_ext_path *path,
ext4_lblk_t *logical, ext4_fsblk_t *phys)
{
struct ext4_extent_idx *ix;
struct ext4_extent *ex;
int depth, ee_len;
if (unlikely(path == NULL)) {
EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical);
return -EFSCO... | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 273,160,314,171,638,030,000,000,000,000,000,000,000 | 57 | ext4: fix races between page faults and hole punching
Currently, page faults and hole punching are completely unsynchronized.
This can result in page fault faulting in a page into a range that we
are punching after truncate_pagecache_range() has been called and thus
we can end up with a page mapped to disk blocks that... |
passGetDots(CharsString *passLine, int *passLinepos, CharsString *dots,
const FileInfo *file) {
CharsString collectDots;
collectDots.length = 0;
while (*passLinepos < passLine->length &&
(passLine->chars[*passLinepos] == '-' ||
(passLine->chars[*passLinepos] >= '0' &&
passLine->chars[*passLinepos] <... | 0 | [
"CWE-787"
] | liblouis | 2e4772befb2b1c37cb4b9d6572945115ee28630a | 91,326,465,665,645,170,000,000,000,000,000,000,000 | 14 | Prevent an invalid memory writes in compileRule
Thanks to Han Zheng for reporting it
Fixes #1214 |
static unsigned int xudc_read32_be(void __iomem *addr)
{
return ioread32be(addr);
} | 0 | [
"CWE-20",
"CWE-129"
] | linux | 7f14c7227f342d9932f9b918893c8814f86d2a0d | 313,072,026,680,618,740,000,000,000,000,000,000,000 | 4 | USB: gadget: validate endpoint index for xilinx udc
Assure that host may not manipulate the index to point
past endpoint array.
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
win_totop(int size, int flags)
{
int dir;
int height = curwin->w_height;
if (ONE_WINDOW)
{
beep_flush();
return;
}
if (check_split_disallowed() == FAIL)
return;
/* Remove the window and frame from the tree of frames. */
(void)winframe_remove(curwin, &dir, NULL);
win_remove(cur... | 0 | [
"CWE-416"
] | vim | ec66c41d84e574baf8009dbc0bd088d2bc5b2421 | 176,229,605,697,244,250,000,000,000,000,000,000,000 | 34 | patch 8.1.2136: using freed memory with autocmd from fuzzer
Problem: using freed memory with autocmd from fuzzer. (Dhiraj Mishra,
Dominique Pelle)
Solution: Avoid using "wp" after autocommands. (closes #5041) |
bool LEX::set_trigger_field(const LEX_CSTRING *name1, const LEX_CSTRING *name2,
Item *val)
{
DBUG_ASSERT(is_trigger_new_or_old_reference(name1));
if (unlikely(name1->str[0]=='O' || name1->str[0]=='o'))
{
my_error(ER_TRG_CANT_CHANGE_ROW, MYF(0), "OLD", "");
return true;
}
if... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 304,688,983,744,924,900,000,000,000,000,000,000,000 | 21 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
ccid_poll (ccid_driver_t handle)
{
int rc;
unsigned char msg[10];
size_t msglen;
int i, j;
if (handle->idev)
{
rc = usb_bulk_read (handle->idev,
handle->ep_intr,
(char*)msg, sizeof msg,
0 /* ms timeout */ );
if (rc ... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 142,059,412,251,350,400,000,000,000,000,000,000,000 | 56 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
static int tty_open(struct inode *inode, struct file *filp)
{
struct tty_struct *tty;
int noctty, retval;
dev_t device = inode->i_rdev;
unsigned saved_flags = filp->f_flags;
nonseekable_open(inode, filp);
retry_open:
retval = tty_alloc_file(filp);
if (retval)
return -ENOMEM;
tty = tty_open_current_tty(devi... | 0 | [
"CWE-416"
] | linux | c8bcd9c5be24fb9e6132e97da5a35e55a83e36b9 | 150,207,371,082,627,700,000,000,000,000,000,000,000 | 69 | tty: Fix ->session locking
Currently, locking of ->session is very inconsistent; most places
protect it using the legacy tty mutex, but disassociate_ctty(),
__do_SAK(), tiocspgrp() and tiocgsid() don't.
Two of the writers hold the ctrl_lock (because they already need it for
->pgrp), but __proc_set_tty() doesn't do tha... |
ofputil_port_stats_from_ofp10(struct ofputil_port_stats *ops,
const struct ofp10_port_stats *ps10)
{
ops->port_no = u16_to_ofp(ntohs(ps10->port_no));
ops->stats.rx_packets = ntohll(get_32aligned_be64(&ps10->rx_packets));
ops->stats.tx_packets = ntohll(get_32aligned_be64(&ps10-... | 0 | [
"CWE-772"
] | ovs | 77ad4225d125030420d897c873e4734ac708c66b | 127,397,068,298,811,140,000,000,000,000,000,000,000 | 22 | ofp-util: Fix memory leaks on error cases in ofputil_decode_group_mod().
Found by libFuzzer.
Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
alloc_invoke_arguments(argc, argv)
int argc;
VALUE *argv;
{
int i;
int thr_crit_bup;
#if TCL_MAJOR_VERSION >= 8
Tcl_Obj **av;
#else /* TCL_MAJOR_VERSION < 8 */
char **av;
#endif
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
/* memory allocation */
#if TCL_MAJOR_VE... | 1 | [] | tk | d098136e3f62a4879a7d7cd34bbd50f482ba3331 | 27,672,105,218,012,260,000,000,000,000,000,000,000 | 46 | tcltklib.c: use StringValueCStr [ci skip]
* ext/tk/tcltklib.c (set_max_block_time, tcl_protect_core,
ip_init, ip_create_slave_core, get_obj_from_str,
ip_cancel_eval_core, lib_set_system_encoding,
alloc_invoke_arguments, lib_merge_tklist): use StringValueCStr
instead of StringValuePtr for values to be passed to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.