func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
__acquires(&pool->lock)
{
struct pool_workqueue *pwq = get_work_pwq(work);
struct worker_pool *pool = worker->pool;
bool cpu_intensive = pwq->wq->flags & WQ_CPU_INTENSIVE;
int work_color;
struct worker *collision;
#ifdef CONFIG_LOCKDEP
/*
* It is permissible to free the struct work_struct from
* inside the fu... | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 269,138,518,408,811,220,000,000,000,000,000,000,000 | 119 | 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 setPragmaResultColumnNames(
Vdbe *v, /* The query under construction */
const PragmaName *pPragma /* The pragma */
){
u8 n = pPragma->nPragCName;
sqlite3VdbeSetNumCols(v, n==0 ? 1 : n);
if( n==0 ){
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, pPragma->zName, SQLITE_STATIC);... | 0 | [
"CWE-754"
] | sqlite | ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd | 91,011,621,805,564,020,000,000,000,000,000,000,000 | 15 | Fix the NOT NULL verification logic in PRAGMA integrity_check so that it
works for generated columns whose value is the result of a comparison operator.
Ticket [bd8c280671ba44a7]
FossilOrigin-Name: f3b39c71b88cb6721f443de56cdce4c08252453a5e340b00a2bd88dc10c42400 |
static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
struct mem_size_stats *mss = walk->private;
struct vm_area_struct *vma = mss->vma;
pte_t *pte;
spinlock_t *ptl;
spin_lock(&walk->mm->page_table_lock);
if (pmd_trans_huge(*pmd)) {
if (pmd_trans_splitting(... | 1 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 66,450,324,357,259,840,000,000,000,000,000,000,000 | 35 | 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(... |
MOBI_RET mobi_process_replica(unsigned char *pdf, const char *text, size_t *length) {
MOBI_RET ret = MOBI_SUCCESS;
MOBIBuffer *buf = mobi_buffer_init_null((unsigned char*) text, *length);
if (buf == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
... | 0 | [
"CWE-703",
"CWE-125"
] | libmobi | fb1ab50e448ddbed746fd27ae07469bc506d838b | 101,445,386,813,005,550,000,000,000,000,000,000,000 | 22 | Fix array boundary check when parsing inflections which could result in buffer over-read with corrupt input |
my_wsagetlasterror (void)
{
int wsaerr;
gpg_err_code_t ec;
wsaerr = WSAGetLastError ();
switch (wsaerr)
{
case WSAENOTSOCK: ec = GPG_ERR_EINVAL; break;
case WSAEWOULDBLOCK: ec = GPG_ERR_EAGAIN; break;
case ERROR_BROKEN_PIPE: ec = GPG_ERR_EPIPE; break;
case WSA... | 0 | [
"CWE-352"
] | gnupg | 4a4bb874f63741026bd26264c43bb32b1099f060 | 263,247,362,446,156,600,000,000,000,000,000,000,000 | 23 | dirmngr: Avoid possible CSRF attacks via http redirects.
* dirmngr/http.h (parsed_uri_s): Add fields off_host and off_path.
(http_redir_info_t): New.
* dirmngr/http.c (do_parse_uri): Set new fields.
(same_host_p): New.
(http_prepare_redirect): New.
* dirmngr/t-http-basic.c: New test.
* dirmngr/ks-engine-hkp.c (send_re... |
TIFFFdOpen(int ifd, const char* name, const char* mode)
{
TIFF* tif;
int fSuppressMap;
int m;
fSuppressMap=0;
for (m=0; mode[m]!=0; m++)
{
if (mode[m]=='u')
{
fSuppressMap=1;
break;
}
}
tif = TIFFClientOpen(name, mode, (thandle_t)ifd,
_tiffReadProc, _tiffWriteProc,
_tiffSeekProc, _tiffClosePro... | 0 | [
"CWE-369"
] | libtiff | 3c5eb8b1be544e41d2c336191bc4936300ad7543 | 82,517,959,615,271,690,000,000,000,000,000,000,000 | 23 | * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not
require malloc() to return NULL pointer if requested allocation
size is zero. Assure that _TIFFmalloc does. |
int cil_resolve_ast(struct cil_db *db, struct cil_tree_node *current)
{
int rc = SEPOL_ERR;
struct cil_args_resolve extra_args;
enum cil_pass pass = CIL_PASS_TIF;
uint32_t changed = 0;
if (db == NULL || current == NULL) {
return rc;
}
extra_args.db = db;
extra_args.pass = pass;
extra_args.changed = &change... | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 179,261,687,463,558,040,000,000,000,000,000,000,000 | 148 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
InputSu(w, up, name)
struct win *w;
struct acluser **up;
char *name;
{
struct inputsu *i;
if (!(i = (struct inputsu *)calloc(1, sizeof(struct inputsu))))
return -1;
i->up = up;
if (name && *name)
su_fin(name, (int)strlen(name), (char *)i); /* can also initialise stuff */
else
su_fin((char *)0, 0... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 316,415,202,183,867,360,000,000,000,000,000,000,000 | 17 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
nm_utils_get_reverse_dns_domains_ip_4(guint32 addr, guint8 plen, GPtrArray *domains)
{
guint32 ip, ip2, mask;
guchar *p;
guint octets;
guint i;
gsize len0, len;
char * str, *s;
g_return_if_fail(domains);
g_return_if_fail(plen <= 32);
if (!plen)
return;
octets = ... | 0 | [
"CWE-20"
] | NetworkManager | 420784e342da4883f6debdfe10cde68507b10d27 | 98,218,058,357,555,560,000,000,000,000,000,000,000 | 37 | core: fix crash in nm_wildcard_match_check()
It's not entirely clear how to treat %NULL.
Clearly "match.interface-name=eth0" should not
match with an interface %NULL. But what about
"match.interface-name=!eth0"? It's now implemented
that negative matches still succeed against %NULL.
What about "match.interface-name=*"... |
nbd_unlocked_set_strict_mode (struct nbd_handle *h, uint32_t flags)
{
h->strict = flags;
return 0;
} | 0 | [
"CWE-252"
] | libnbd | c79706af4e7475bf58861a143b77b77a54e7a1cd | 299,111,584,101,029,700,000,000,000,000,000,000,000 | 5 | api: Add new API nbd_set_pread_initialize()
The recent patch series for CVE-2022-0485 demonstrated that when
applications using libnbd are not careful about error checking, the
difference on whether a data leak is at least sanitized (all zeroes,
partial reads, or data leftover from a prior read) vs. a dangerous
inform... |
ResponseTrailerMap& ConnectionManagerImpl::ActiveStreamEncoderFilter::addEncodedTrailers() {
return parent_.addEncodedTrailers();
} | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 227,306,984,348,129,440,000,000,000,000,000,000,000 | 3 | 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... |
ZEND_VM_HELPER(zend_add_helper, ANY, ANY, zval *op_1, zval *op_2)
{
USE_OPLINE
SAVE_OPLINE();
if (UNEXPECTED(Z_TYPE_INFO_P(op_1) == IS_UNDEF)) {
op_1 = ZVAL_UNDEFINED_OP1();
}
if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) {
op_2 = ZVAL_UNDEFINED_OP2();
}
add_function(EX_VAR(opline->result.var), op_1, op_... | 0 | [
"CWE-787"
] | php-src | f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d | 282,963,648,124,396,850,000,000,000,000,000,000,000 | 20 | Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow. Since the recent fix for bug #74960 still doesn't catch all
possible overflows, we fix that right away. |
void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
/* Address WBINVD may be executed by guest */
if (need_emulate_wbinvd(vcpu)) {
if (kvm_x86_ops->has_wbinvd_exit())
cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask);
else if (vcpu->cpu != -1 && vcpu->cpu != cpu)
smp_call_function_single(vcpu->cpu,
... | 0 | [
"CWE-399"
] | kvm | 5b40572ed5f0344b9dbee486a17c589ce1abe1a3 | 334,131,310,256,794,330,000,000,000,000,000,000,000 | 40 | KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
If some vcpus are created before KVM_CREATE_IRQCHIP, then
irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading
to potential NULL pointer dereferences.
Fix by:
- ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called
... |
void fpm_scoreboard_proc_free(struct fpm_child_s *child) /* {{{ */
{
struct fpm_worker_pool_s *wp = child->wp;
struct fpm_scoreboard_s *scoreboard = wp->scoreboard;
int child_index = child->scoreboard_i;
if (!scoreboard) {
return;
}
if (child_index < 0 || child_index >= wp->config->pm_max_children) {
return... | 0 | [
"CWE-787"
] | php-src | fadb1f8c1d08ae62b4f0a16917040fde57a3b93b | 331,708,773,142,191,260,000,000,000,000,000,000,000 | 21 | Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.
Signed-off-by: Stanislav Malyshev <stas@php.net> |
string_extract_double_quoted (string, sindex, flags)
char *string;
int *sindex, flags;
{
size_t slen;
char *send;
int j, i, t;
unsigned char c;
char *temp, *ret; /* The new string we return. */
int pass_next, backquote, si; /* State variables for the machine. */
int dquote;
int stripdq;
DEC... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 75,908,970,931,337,300,000,000,000,000,000,000,000 | 157 | bash-4.4-rc2 release |
save_tc_inequality(char *bufptr, int c1, int c2)
{
bufptr = save_string(bufptr, "%>");
bufptr = save_tc_char(bufptr, c1);
bufptr = save_tc_char(bufptr, c2);
return bufptr;
} | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 115,254,462,914,175,400,000,000,000,000,000,000,000 | 7 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
mono_thread_current (void)
{
MonoDomain *domain = mono_domain_get ();
MonoInternalThread *internal = mono_thread_internal_current ();
MonoThread **current_thread_ptr;
g_assert (internal);
current_thread_ptr = get_current_thread_ptr_for_domain (domain, internal);
if (!*current_thread_ptr) {
g_assert (domain !=... | 0 | [
"CWE-399",
"CWE-264"
] | mono | 722f9890f09aadfc37ae479e7d946d5fc5ef7b91 | 73,785,422,754,492,780,000,000,000,000,000,000,000 | 15 | Fix access to freed members of a dead thread
* threads.c: Fix access to freed members of a dead thread. Found
and fixed by Rodrigo Kumpera <rkumpera@novell.com>
Ref: CVE-2011-0992 |
static DefragTracker *DefragTrackerGetUsedDefragTracker(void)
{
uint32_t idx = SC_ATOMIC_GET(defragtracker_prune_idx) % defrag_config.hash_size;
uint32_t cnt = defrag_config.hash_size;
while (cnt--) {
if (++idx >= defrag_config.hash_size)
idx = 0;
DefragTrackerHashRow *hb = &de... | 0 | [
"CWE-358"
] | suricata | 4a04f814b15762eb446a5ead4d69d021512df6f8 | 11,743,996,737,844,517,000,000,000,000,000,000,000 | 57 | defrag - take protocol into account during re-assembly
The IP protocol was not being used to match fragments with
their packets allowing a carefully constructed packet
with a different protocol to be matched, allowing re-assembly
to complete, creating a packet that would not be re-assembled
by the destination host. |
__i915_gem_userptr_set_active(struct drm_i915_gem_object *obj, bool value)
{
} | 0 | [
"CWE-362"
] | linux | 17839856fd588f4ab6b789f482ed3ffd7c403e1f | 98,595,246,572,602,280,000,000,000,000,000,000,000 | 3 | gup: document and work around "COW can break either way" issue
Doing a "get_user_pages()" on a copy-on-write page for reading can be
ambiguous: the page can be COW'ed at any time afterwards, and the
direction of a COW event isn't defined.
Yes, whoever writes to it will generally do the COW, but if the thread
that did... |
static int amd_gpio_remove(struct platform_device *pdev)
{
struct amd_gpio *gpio_dev;
gpio_dev = platform_get_drvdata(pdev);
gpiochip_remove(&gpio_dev->gc);
return 0;
} | 0 | [
"CWE-415"
] | linux | 251e22abde21833b3d29577e4d8c7aaccd650eee | 199,496,788,917,090,370,000,000,000,000,000,000,000 | 10 | pinctrl: amd: Use devm_pinctrl_register() for pinctrl registration
Use devm_pinctrl_register() for pin control registration and clean
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org> |
int user_auth_scheme_module_close(struct config_module * config, void * cls) {
UNUSED(config);
json_decref((json_t *)cls);
return G_OK;
} | 0 | [
"CWE-120",
"CWE-787"
] | glewlwyd | 0efd112bb62f566877750ad62ee828bff579b4e2 | 169,028,914,158,811,690,000,000,000,000,000,000,000 | 5 | Fix fido2 signature validation bug |
AddRoleMems(const char *rolename, Oid roleid,
List *memberNames, List *memberIds,
Oid grantorId, bool admin_opt)
{
Relation pg_authmem_rel;
TupleDesc pg_authmem_dsc;
ListCell *nameitem;
ListCell *iditem;
Assert(list_length(memberNames) == list_length(memberIds));
/* Skip permission check if nothing to... | 1 | [
"CWE-264"
] | postgres | fea164a72a7bfd50d77ba5fb418d357f8f2bb7d0 | 215,011,710,023,467,500,000,000,000,000,000,000,000 | 124 | Shore up ADMIN OPTION restrictions.
Granting a role without ADMIN OPTION is supposed to prevent the grantee
from adding or removing members from the granted role. Issuing SET ROLE
before the GRANT bypassed that, because the role itself had an implicit
right to add or remove members. Plug that hole by recognizing tha... |
static double mp_pow(_cimg_math_parser& mp) {
const double v = _mp_arg(2), p = _mp_arg(3);
return std::pow(v,p); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 37,415,885,725,828,940,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void pair_bool(const char *a, bool t, int mode, bool last) {
pair (a, r_str_bool (t), mode, last);
} | 0 | [
"CWE-125"
] | radare2 | 1f37c04f2a762500222dda2459e6a04646feeedf | 241,272,202,793,717,000,000,000,000,000,000,000,000 | 3 | Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923) |
static int vidioc_s_fmt_out(struct file *file, void *priv, struct v4l2_format *fmt)
{
struct v4l2_loopback_device *dev;
char buf[5];
int ret;
MARK();
dev = v4l2loopback_getdevice(file);
ret = vidioc_try_fmt_out(file, priv, fmt);
dprintk("s_fmt_out(%d) %d...%d\n", ret, dev->ready_for_capture, dev->pix_format.si... | 0 | [
"CWE-787"
] | v4l2loopback | 64a216af4c09c9ba9326057d7e78994271827eff | 199,398,163,619,877,260,000,000,000,000,000,000,000 | 25 | add explicit format specifier to printf() invocations
CWE-134 |
ostream& operator<<(ostream& out, const MonCapGrant& m)
{
out << "allow";
if (m.service.length()) {
out << " service " << maybe_quote_string(m.service);
}
if (m.command.length()) {
out << " command " << maybe_quote_string(m.command);
if (!m.command_args.empty()) {
out << " with";
for (ma... | 0 | [
"CWE-285"
] | ceph | a2acedd2a7e12d58af6db35edbd8a9d29c557578 | 113,351,431,125,857,130,000,000,000,000,000,000,000 | 39 | mon/config-key: limit caps allowed to access the store
Henceforth, we'll require explicit `allow` caps for commands, or for the
config-key service. Blanket caps are no longer allowed for the
config-key service, except for 'allow *'.
(for luminous and mimic, we're also ensuring MonCap's parser is able to
understand fo... |
static GF_Err set_chapter_track(GF_ISOFile *file, u32 track, u32 chapter_ref_trak)
{
u64 ref_duration, chap_duration;
Double scale;
GF_Err e;
e = gf_isom_set_track_reference(file, chapter_ref_trak, GF_ISOM_REF_CHAP, gf_isom_get_track_id(file, track) );
if (e) return e;
e = gf_isom_set_track_enabled(file, track, ... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 63,180,005,825,847,590,000,000,000,000,000,000,000 | 61 | fixed crashes for very long path - cf #1908 |
static unsigned long *alloc_thread_stack_node(struct task_struct *tsk,
int node)
{
return kmem_cache_alloc_node(thread_stack_cache, THREADINFO_GFP, node);
} | 0 | [
"CWE-416",
"CWE-703"
] | linux | 2b7e8665b4ff51c034c55df3cff76518d1a9ee3a | 232,780,042,563,220,100,000,000,000,000,000,000,000 | 5 | fork: fix incorrect fput of ->exe_file causing use-after-free
Commit 7c051267931a ("mm, fork: make dup_mmap wait for mmap_sem for
write killable") made it possible to kill a forking task while it is
waiting to acquire its ->mmap_sem for write, in dup_mmap().
However, it was overlooked that this introduced an new erro... |
int rsa_rsassa_pkcs1_v15_sign( rsa_context *ctx,
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng,
int mode,
int hash_id,
unsigned int hashlen,
... | 0 | [
"CWE-310"
] | polarssl | 43f9799ce61c6392a014d0a2ea136b4b3a9ee194 | 235,751,930,739,719,400,000,000,000,000,000,000,000 | 117 | RSA blinding on CRT operations to counter timing attacks |
static int readfull(AVFormatContext *s, AVIOContext *pb, uint8_t *dst, int n) {
int ret = avio_read(pb, dst, n);
if (ret != n) {
if (ret >= 0) memset(dst + ret, 0, n - ret);
else memset(dst , 0, n);
av_log(s, AV_LOG_ERROR, "Failed to fully read block\n");
}
return r... | 0 | [
"CWE-399",
"CWE-834"
] | FFmpeg | 124eb202e70678539544f6268efc98131f19fa49 | 99,996,929,803,101,940,000,000,000,000,000,000,000 | 9 | avformat/rmdec: Fix DoS due to lack of eof check
Fixes: loop.ivr
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static nio_t *open_tap_device(const char *dev_name)
{
nio_t *nio;
printf("Opening TAP device %s\n", dev_name);
nio = create_nio_tap((char *)dev_name);
if (!nio)
fprintf(stderr, "unable to open TAP device\n");
return nio;
} | 0 | [
"CWE-200",
"CWE-269"
] | ubridge | 2eb0d1dab6a6de76cf3556130a2d52af101077db | 150,039,563,167,426,710,000,000,000,000,000,000,000 | 10 | Hide errored line content during parsing configuration INI file on default |
Event_basic::load_string_fields(Field **fields, ...)
{
bool ret= FALSE;
va_list args;
enum enum_events_table_field field_name;
LEX_STRING *field_value;
DBUG_ENTER("Event_basic::load_string_fields");
va_start(args, fields);
field_name= (enum enum_events_table_field) va_arg(args, int);
while (field_name... | 0 | [
"CWE-284"
] | server | 0b5a5258abbeaf8a0c3a18c7e753699787fdf46e | 103,570,924,294,367,060,000,000,000,000,000,000,000 | 27 | MW-416 DDL replication moved after acl checking
galera_events test shows a regression with the original fix for MW-416
Reason was that Events::drop_event() can be called also from inside event
execution, and there we have a speacial treatment for event, which executes
"DROP EVENT" statement, and runs TOI replication i... |
size_t smb1cli_req_wct_ofs(struct tevent_req **reqs, int num_reqs)
{
size_t wct_ofs;
int i;
wct_ofs = HDR_WCT;
for (i=0; i<num_reqs; i++) {
struct smbXcli_req_state *state;
state = tevent_req_data(reqs[i], struct smbXcli_req_state);
wct_ofs += smbXcli_iov_len(state->smb1.iov+2,
state->smb1.iov_count... | 0 | [
"CWE-20"
] | samba | a819d2b440aafa3138d95ff6e8b824da885a70e9 | 273,295,447,819,983,000,000,000,000,000,000,000,000 | 16 | CVE-2015-5296: libcli/smb: make sure we require signing when we demand encryption on a session
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org> |
static uint32_t sm501_palette_read(void *opaque, hwaddr addr)
{
SM501State *s = (SM501State *)opaque;
SM501_DPRINTF("sm501 palette read addr=%x\n", (int)addr);
/* TODO : consider BYTE/WORD access */
/* TODO : consider endian */
assert(range_covers_byte(0, 0x400 * 3, addr));
return *(uint32_t *... | 0 | [
"CWE-190"
] | qemu | b15a22bbcbe6a78dc3d88fe3134985e4cdd87de4 | 219,073,864,600,972,750,000,000,000,000,000,000,000 | 11 | sm501: Replace hand written implementation with pixman where possible
Besides being faster this should also prevent malicious guests to
abuse 2D engine to overwrite data or cause a crash.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-id: 58666389b6cae256e4e972a32c05cf8aa51bffc0.1590089984.git.balaton@eik... |
http_process(struct vtclog *vl, const char *spec, int sock, int *sfd)
{
struct http *hp;
char *s, *q;
int retval;
(void)sfd;
ALLOC_OBJ(hp, HTTP_MAGIC);
AN(hp);
hp->fd = sock;
hp->timeout = 15000;
hp->nrxbuf = 2048*1024;
hp->vsb = VSB_new_auto();
hp->rxbuf = malloc(hp->nrxbuf); /* XXX */
hp->sfd = sfd;
hp... | 0 | [
"CWE-269"
] | Varnish-Cache | 85e8468bec9416bd7e16b0d80cb820ecd2b330c3 | 256,612,578,119,491,000,000,000,000,000,000,000,000 | 32 | Do not consider a CR by itself as a valid line terminator
Varnish (prior to version 4.0) was not following the standard with
regard to line separator.
Spotted and analyzed by: Régis Leroy [regilero] regis.leroy@makina-corpus.com |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteSVDFParams*>(node->builtin_data);
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input));
const T... | 1 | [
"CWE-476",
"CWE-369"
] | tensorflow | 5b048e87e4e55990dae6b547add4dae59f4e1c76 | 48,006,172,578,674,890,000,000,000,000,000,000,000 | 123 | Fix a null pointer exception in SVDF
This is due to not checking that `GetVariableInput` returns non-null tensor.
Also fix a potential null pointer exception in `GetVariableInput`.
PiperOrigin-RevId: 385160147
Change-Id: Iadf3f0705b036a9014d27caa5a8bbd91f4c4c401 |
operator T () const throw() {return be::swap<T>(_v); } | 0 | [
"CWE-476"
] | graphite | db132b4731a9b4c9534144ba3a18e65b390e9ff6 | 91,736,630,065,815,320,000,000,000,000,000,000,000 | 1 | Deprecate and make ineffective gr_face_dumbRendering |
int fit_get_node_from_config(bootm_headers_t *images, const char *prop_name,
ulong addr)
{
int cfg_noffset;
void *fit_hdr;
int noffset;
debug("* %s: using config '%s' from image at 0x%08lx\n",
prop_name, images->fit_uname_cfg, addr);
/* Check whether configuration has this property defined */
fit_hdr... | 0 | [] | u-boot | 6f3c2d8aa5e6cbd80b5e869bbbddecb66c329d01 | 67,269,165,981,019,860,000,000,000,000,000,000,000 | 26 | image: Add an option to do a full check of the FIT
Some strange modifications of the FIT can introduce security risks. Add an
option to check it thoroughly, using libfdt's fdt_check_full() function.
Enable this by default if signature verification is enabled.
CVE-2021-27097
Signed-off-by: Simon Glass <sjg@chromium.... |
read_dot_hidden_file (NautilusDirectory *directory)
{
gsize file_size;
char *file_contents;
GFile *child;
GFileInfo *info;
GFileType type;
int i;
/* FIXME: We only support .hidden on file: uri's for the moment.
* Need to figure out if we should do this async or sync to extend
* it to all types of uris.
*... | 0 | [] | nautilus | 7632a3e13874a2c5e8988428ca913620a25df983 | 183,596,816,517,410,040,000,000,000,000,000,000,000 | 70 | Check for trusted desktop file launchers.
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
Check for trusted desktop file launchers.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
* libnautilus-... |
pgp_get_info_by_tag(sc_card_t *card, unsigned int tag)
{
struct pgp_priv_data *priv = DRVDATA(card);
struct do_info *info;
for (info = priv->pgp_objects; (info != NULL) && (info->id > 0); info++)
if (tag == info->id)
return info;
return NULL;
} | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 160,435,079,730,222,300,000,000,000,000,000,000,000 | 11 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
TfLiteStatus CosEval(TfLiteContext* context, TfLiteNode* node) {
return EvalNumeric(context, node, std::cos);
} | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 77,326,883,706,557,920,000,000,000,000,000,000,000 | 3 | [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... |
xmlSchemaIsDerivedFromBuiltInType(xmlSchemaTypePtr type, int valType)
{
if (type == NULL)
return (0);
if (WXS_IS_COMPLEX(type))
return (0);
if (type->type == XML_SCHEMA_TYPE_BASIC) {
if (type->builtInType == valType)
return(1);
if ((type->builtInType == XML_SCHEMAS_ANYSIMPLETYPE) ||
(type->bui... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 55,440,695,394,400,790,000,000,000,000,000,000,000 | 16 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
apr_status_t h2_session_rcreate(h2_session **psession,
request_rec *r, h2_ctx *ctx, h2_workers *workers)
{
return h2_session_create_int(psession, r->connection, r, ctx, workers);
} | 0 | [] | mod_h2 | 5e75e5685dd043fe93a5a08a15edd087a43f6968 | 328,876,975,080,469,500,000,000,000,000,000,000,000 | 5 | v1.11.0
--------------------------------------------------------------------------------
* connection IO event handling reworked. Instead of reacting on incoming bytes, the
state machine now acts on incoming frames that are affecting it. This reduces
state transitions.
* pytest suite now covers some basic tests... |
void isor_check_producer_ref_time(ISOMReader *read)
{
GF_ISOTrackID trackID;
u64 ntp;
u64 timestamp;
if (gf_sys_is_test_mode()) {
return;
}
if (gf_isom_get_last_producer_time_box(read->mov, &trackID, &ntp, ×tamp, GF_TRUE)) {
#if !defined(_WIN32_WCE) && !defined(GPAC_DISABLE_LOG)
if (gf_log_tool_level_... | 0 | [
"CWE-703",
"CWE-835"
] | gpac | 71460d72ec07df766dab0a4d52687529f3efcf0a | 30,124,526,996,184,934,000,000,000,000,000,000,000 | 30 | fixed #1876 |
bool CModules::OnVoice2(const CNick* pOpNick, const CNick& Nick, CChan& Channel,
bool bNoChange) {
MODUNLOADCHK(OnVoice2(pOpNick, Nick, Channel, bNoChange));
return false;
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 136,061,720,657,056,130,000,000,000,000,000,000,000 | 5 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
checkrlimits(struct config_file* cfg)
{
#ifndef S_SPLINT_S
#ifdef HAVE_GETRLIMIT
/* list has number of ports to listen to, ifs number addresses */
int list = ((cfg->do_udp?1:0) + (cfg->do_tcp?1 +
(int)cfg->incoming_num_tcp:0));
size_t listen_ifs = (size_t)(cfg->num_ifs==0?
((cfg->do_ip4 && !cfg->if_automatic?1... | 0 | [
"CWE-59"
] | unbound | ad387832979b6ce4c93f64fe706301cd7d034e87 | 163,728,261,002,949,130,000,000,000,000,000,000,000 | 95 | - Fix for #303 CVE-2020-28935 : Fix that symlink does not interfere
with chown of pidfile. |
void SSL_SESSION_get0_ticket(const SSL_SESSION *s, unsigned char **tick,
size_t *len)
{
*len = s->tlsext_ticklen;
if (tick != NULL)
*tick = s->tlsext_tick;
} | 0 | [
"CWE-362"
] | openssl | 708cf593587e2fda67dae9782991ff9fccc781eb | 243,282,239,979,774,500,000,000,000,000,000,000,000 | 7 | More ssl_session_dup fixes
Fix error handling in ssl_session_dup, as well as incorrect setting up of
the session ticket. Follow on from CVE-2015-1791.
Thanks to LibreSSL project for reporting these issues.
Reviewed-by: Tim Hudson <tjh@openssl.org> |
static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
u32 exec_control;
vmcs_write16(GUEST_ES_SELECTOR, vmcs12->guest_es_selector);
vmcs_write16(GUEST_CS_SELECTOR, vmcs12->guest_cs_selector);
vmcs_write16(GUEST_SS_SELECTOR, vmcs12->guest_ss_selector);
vmc... | 0 | [
"CWE-399"
] | linux | 54a20552e1eae07aa240fa370a0293e006b5faed | 34,279,273,745,954,424,000,000,000,000,000,000,000 | 323 | KVM: x86: work around infinite loop in microcode when #AC is delivered
It was found that a guest can DoS a host by triggering an infinite
stream of "alignment check" (#AC) exceptions. This causes the
microcode to enter an infinite loop where the core never receives
another interrupt. The host kernel panics pretty qu... |
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
array_init(&EX_T(opline->result.u.var).tmp_var);
if (IS_UNUSED == IS_UNUSED) {
ZEND_VM_NEXT_OPCODE();
#if 0 || IS_UNUSED != IS_UNUSED
} else {
return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TM... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 39,370,262,862,548,695,000,000,000,000,000,000,000 | 13 | - 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 int slab_memory_callback(struct notifier_block *self,
unsigned long action, void *arg)
{
int ret = 0;
switch (action) {
case MEM_GOING_ONLINE:
ret = slab_mem_going_online_callback(arg);
break;
case MEM_GOING_OFFLINE:
ret = slab_mem_going_offline_callback(arg);
break;
case MEM_OFFLINE:
case MEM... | 0 | [] | linux | fd4d9c7d0c71866ec0c2825189ebd2ce35bd95b8 | 72,248,129,425,065,560,000,000,000,000,000,000,000 | 26 | mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
When kmem_cache_alloc_bulk() attempts to allocate N objects from a percpu
freelist of length M, and N > M > 0, it will first remove the M elements
from the percpu freelist, then call ___slab_alloc() to allocate the next
element and repopulate the percpu freelis... |
TIFFOpen(const char* name, const char* mode)
{
static const char module[] = "TIFFOpen";
int m, fd;
m = _TIFFgetMode(mode, module);
if (m == -1)
return ((TIFF*)0);
if (m&O_TRUNC){
/*
* There is a bug in open in VAXC. If you use
* open w/ m=O_RDWR|O_CREAT|O_TRUNC the
* wrong thing ... | 0 | [
"CWE-369"
] | libtiff | 3c5eb8b1be544e41d2c336191bc4936300ad7543 | 309,866,896,535,307,360,000,000,000,000,000,000,000 | 29 | * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not
require malloc() to return NULL pointer if requested allocation
size is zero. Assure that _TIFFmalloc does. |
static PHP_FUNCTION(session_id)
{
char *name = NULL;
int name_len, argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
return;
}
if (PS(id)) {
RETVAL_STRING(PS(id), 1);
} else {
RETVAL_EMPTY_STRING();
}
if (name) {
if (PS(use_strict_mode) && argc) {... | 1 | [
"CWE-264"
] | php-src | b80d73ce154e7f740f9ada446f45dbcdac38a64b | 227,375,192,458,452,600,000,000,000,000,000,000,000 | 25 | fix crash, enable session_id and fix test |
const char *setup_git_directory_gently(int *nongit_ok)
{
static struct strbuf cwd = STRBUF_INIT;
struct strbuf dir = STRBUF_INIT, gitdir = STRBUF_INIT;
const char *prefix = NULL;
struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
/*
* We may have read an incomplete configuration before
* setting-up t... | 0 | [
"CWE-22"
] | git | 3b0bf2704980b1ed6018622bdf5377ec22289688 | 110,067,347,822,260,300,000,000,000,000,000,000,000 | 134 | setup: tighten ownership checks post CVE-2022-24765
8959555cee7 (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if nee... |
irc_server_check_away (struct t_irc_server *server)
{
struct t_irc_channel *ptr_channel;
if (server->is_connected)
{
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
... | 0 | [
"CWE-20"
] | weechat | c265cad1c95b84abfd4e8d861f25926ef13b5d91 | 107,118,610,612,847,040,000,000,000,000,000,000,000 | 15 | Fix verification of SSL certificates by calling gnutls verify callback (patch #7459) |
cherokee_validator_ldap_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_module_props_t **_props)
{
ret_t ret;
cherokee_list_t *i;
cherokee_validator_ldap_props_t *props;
UNUSED(srv);
if (*_props == NULL) {
CHEROKEE_NEW_STRUCT (n, validator_ld... | 0 | [
"CWE-287"
] | webserver | fbda667221c51f0aa476a02366e0cf66cb012f88 | 271,652,586,765,335,200,000,000,000,000,000,000,000 | 88 | Prevent the LDAP validator from accepting an empty password. |
void trigger_load_balance(struct rq *rq)
{
/* Don't need to rebalance while attached to NULL domain */
if (unlikely(on_null_domain(rq)))
return;
if (time_after_eq(jiffies, rq->next_balance))
raise_softirq(SCHED_SOFTIRQ);
nohz_balancer_kick(rq);
} | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 165,678,460,875,184,440,000,000,000,000,000,000,000 | 11 | 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... |
njs_vm_del_event(njs_vm_t *vm, njs_vm_event_t vm_event)
{
njs_event_t *event;
event = (njs_event_t *) vm_event;
njs_del_event(vm, event, NJS_EVENT_RELEASE | NJS_EVENT_DELETE);
} | 0 | [
"CWE-416"
] | njs | 6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6 | 188,173,781,232,028,640,000,000,000,000,000,000,000 | 8 | Fixed recursive async function calls.
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with c... |
describe_pid (pid)
pid_t pid;
{
int job;
sigset_t set, oset;
BLOCK_CHILD (set, oset);
job = find_job (pid, 0, NULL);
if (job != NO_JOB)
fprintf (stderr, "[%d] %ld\n", job + 1, (long)pid);
else
programming_error (_("describe_pid: %ld: no such pid"), (long)pid);
UNBLOCK_CHILD (oset);
} | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 110,115,980,304,864,860,000,000,000,000,000,000,000 | 17 | bash-4.4-rc2 release |
initializePrivilegedWorkingObjects(WorkingObjects &wo) {
wo.serverSocketFd = createServer(socketAddress.c_str());
if (getSocketAddressType(socketAddress) == SAT_UNIX) {
int ret;
do {
ret = chmod(parseUnixSocketAddress(socketAddress).c_str(),
S_ISVTX |
S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IWGR... | 0 | [
"CWE-59"
] | passenger | 9dda49f4a3ebe9bafc48da1bd45799f30ce19566 | 160,228,013,136,556,320,000,000,000,000,000,000,000 | 19 | Fixed a problem with graceful web server restarts.
This problem was introduced in 4.0.6 during the attempt to fix issue #910. |
linetabsize_col(int startcol, char_u *s)
{
colnr_T col = startcol;
char_u *line = s; // pointer to start of line, for breakindent
while (*s != NUL)
col += lbr_chartabsize_adv(line, &s, col);
return (int)col;
} | 0 | [
"CWE-125",
"CWE-787"
] | vim | 94f3192b03ed27474db80b4d3a409e107140738b | 27,775,647,866,099,583,000,000,000,000,000,000,000 | 9 | patch 8.2.3950: going beyond the end of the line with /\%V
Problem: Going beyond the end of the line with /\%V.
Solution: Check for valid column in getvcol(). |
void
mono_reflection_initialize_generic_parameter (MonoReflectionGenericParam *gparam)
{
MonoGenericParamFull *param;
MonoImage *image;
MonoClass *pklass;
MONO_ARCH_SAVE_REGS;
param = g_new0 (MonoGenericParamFull, 1);
if (gparam->mbuilder) {
if (!gparam->mbuilder->generic_container) {
MonoReflectionTypeBu... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 100,340,250,083,025,850,000,000,000,000,000,000,000 | 46 | 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 |
void tls1_clear(SSL *s)
{
ssl3_clear(s);
if (s->method->version == TLS_ANY_VERSION)
s->version = TLS_MAX_VERSION;
else
s->version = s->method->version;
} | 0 | [
"CWE-20"
] | openssl | 4ad93618d26a3ea23d36ad5498ff4f59eff3a4d2 | 144,633,113,339,316,850,000,000,000,000,000,000,000 | 8 | Don't change the state of the ETM flags until CCS processing
Changing the ciphersuite during a renegotiation can result in a crash
leading to a DoS attack. ETM has not been implemented in 1.1.0 for DTLS
so this is TLS only.
The problem is caused by changing the flag indicating whether to use ETM
or not immediately on... |
static void nft_validate_state_update(struct net *net, u8 new_validate_state)
{
struct nftables_pernet *nft_net = nft_pernet(net);
switch (nft_net->validate_state) {
case NFT_VALIDATE_SKIP:
WARN_ON_ONCE(new_validate_state == NFT_VALIDATE_DO);
break;
case NFT_VALIDATE_NEED:
break;
case NFT_VALIDATE_DO:
if ... | 0 | [
"CWE-665"
] | linux | ad9f151e560b016b6ad3280b48e42fa11e1a5440 | 106,871,953,944,363,900,000,000,000,000,000,000,000 | 17 | netfilter: nf_tables: initialize set before expression setup
nft_set_elem_expr_alloc() needs an initialized set if expression sets on
the NFT_EXPR_GC flag. Move set fields initialization before expression
setup.
[4512935.019450] ==================================================================
[4512935.019456] BUG: ... |
ar6000_update_bdaddr(struct ar6_softc *ar)
{
if (setupbtdev != 0) {
u32 address;
if (BMIReadMemory(ar->arHifDevice,
HOST_INTEREST_ITEM_ADDRESS(ar, hi_board_data), (u8 *)&address, 4) != 0)
{
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for hi_board_data failed\n... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 274,407,388,050,587,550,000,000,000,000,000,000,000 | 25 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
bool DaemonServer::ms_dispatch(Message *m)
{
// Note that we do *not* take ::lock here, in order to avoid
// serializing all message handling. It's up to each handler
// to take whatever locks it needs.
switch (m->get_type()) {
case MSG_PGSTATS:
cluster_state.ingest_pgstats(static_cast<MPGStats*>(m))... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 53,527,563,500,283,520,000,000,000,000,000,000,000 | 22 | 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 void reset_drbg_hook_ctx(void)
{
reset_hook_ctx(&master_ctx);
reset_hook_ctx(&public_ctx);
reset_hook_ctx(&private_ctx);
} | 0 | [
"CWE-330"
] | openssl | 1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be | 36,609,070,503,715,824,000,000,000,000,000,000,000 | 6 | drbg: ensure fork-safety without using a pthread_atfork handler
When the new OpenSSL CSPRNG was introduced in version 1.1.1,
it was announced in the release notes that it would be fork-safe,
which the old CSPRNG hadn't been.
The fork-safety was implemented using a fork count, which was
incremented by a pthread_atfork... |
static int _regulator_get_current_limit(struct regulator_dev *rdev)
{
int ret;
mutex_lock(&rdev->mutex);
/* sanity check */
if (!rdev->desc->ops->get_current_limit) {
ret = -EINVAL;
goto out;
}
ret = rdev->desc->ops->get_current_limit(rdev);
out:
mutex_unlock(&rdev->mutex);
return ret;
} | 0 | [
"CWE-416"
] | linux | 60a2362f769cf549dc466134efe71c8bf9fbaaba | 157,982,358,508,633,650,000,000,000,000,000,000,000 | 17 | regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
After freeing pin from regulator_ena_gpio_free, loop can access
the pin. So this patch fixes not to access pin after freeing.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org> |
put_record_into_cache( ulong recno, const char *data )
{
CACHE_CTRL r, unused;
int dirty_count = 0;
int clean_count = 0;
/* see whether we already cached this one */
for( unused = NULL, r = cache_list; r; r = r->next ) {
if( !r->flags.used ) {
if( !unused )
unused = r;
}
else if( r->recno... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 11,479,331,077,216,559,000,000,000,000,000,000,000 | 139 | 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 ... |
void mem_cgroup_sockets_destroy(struct cgroup *cgrp)
{
struct proto *proto;
mutex_lock(&proto_list_mutex);
list_for_each_entry_reverse(proto, &proto_list, node)
if (proto->destroy_cgroup)
proto->destroy_cgroup(cgrp);
mutex_unlock(&proto_list_mutex);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 82981930125abfd39d7c8378a9cfdf5e1be2002b | 87,328,609,951,305,520,000,000,000,000,000,000,000 | 10 | net: cleanups in sock_setsockopt()
Use min_t()/max_t() macros, reformat two comments, use !!test_bit() to
match !!sock_flag()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
asn1_octet_decode(struct asn1_ctx *ctx, unsigned char *ch)
{
if (ctx->pointer >= ctx->end) {
ctx->error = ASN1_ERR_DEC_EMPTY;
return 0;
}
*ch = *(ctx->pointer)++;
return 1;
} | 0 | [
"CWE-119"
] | linux-2.6 | ddb2c43594f22843e9f3153da151deaba1a834c5 | 37,719,404,547,481,230,000,000,000,000,000,000,000 | 9 | asn1: additional sanity checking during BER decoding
- Don't trust a length which is greater than the working buffer.
An invalid length could cause overflow when calculating buffer size
for decoding oid.
- An oid length of zero is invalid and allows for an off-by-one error when
decoding oid because the first su... |
void RGWDeleteMultiObj_ObjStore_S3::send_partial_response(rgw_obj_key& key,
bool delete_marker,
const string& marker_version_id, int ret)
{
if (!key.empty()) {
if (op_ret == 0 && !quiet) {
s->formatter->open_object_section("Deleted");
s->formatter->dump_string("Key", key.name);
... | 0 | [
"CWE-79"
] | ceph | ba0790a01ba5252db1ebc299db6e12cd758d0ff9 | 39,976,696,274,975,283,000,000,000,000,000,000,000 | 35 | rgw: reject unauthenticated response-header actions
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d8dd5e513c0c62bbd7d3044d7e2eddcd897bd400) |
CNF_GetNtpSigndSocket(void)
{
return ntp_signd_socket;
} | 0 | [
"CWE-59"
] | chrony | e18903a6b56341481a2e08469c0602010bf7bfe3 | 200,538,953,629,346,740,000,000,000,000,000,000,000 | 4 | switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util
functions. |
static void pdftex_fail(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
fputs("\nError: module writet1", stderr);
if (cur_file_name)
fprintf(stderr, " (file %s)", cur_file_name);
fputs(": ", stderr);
vsprintf(print_buf, fmt, args);
fputs(print_buf, stderr);
fputs("\n =... | 0 | [
"CWE-119"
] | texlive-source | 6ed0077520e2b0da1fd060c7f88db7b2e6068e4c | 298,760,150,299,263,470,000,000,000,000,000,000,000 | 14 | writet1 protection against buffer overflow
git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a301751 |
static char *lxclock_name(const char *p, const char *n)
{
int ret;
int len;
char *dest;
char *rundir;
/* lockfile will be:
* "/run" + "/lxc/lock/$lxcpath/$lxcname + '\0' if root
* or
* $XDG_RUNTIME_DIR + "/lxc/lock/$lxcpath/$lxcname + '\0' if non-root
*/
/* length of "/lxc/lock/" + $lxcpath + "/" + "." ... | 0 | [
"CWE-59",
"CWE-61"
] | lxc | 72cf81f6a3404e35028567db2c99a90406e9c6e6 | 222,962,095,049,998,820,000,000,000,000,000,000,000 | 46 | CVE-2015-1331: lxclock: use /run/lxc/lock rather than /run/lock/lxc
This prevents an unprivileged user to use LXC to create arbitrary file
on the filesystem.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com> |
static timelib_long timelib_get_month(char **ptr)
{
while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
++*ptr;
}
return timelib_lookup_month(ptr);
} | 0 | [
"CWE-125"
] | php-src | 5c0455bf2c8cd3c25401407f158e820aa3b239e1 | 248,483,245,014,036,930,000,000,000,000,000,000,000 | 7 | Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Fixed bug #75055 Out-Of-Bounds Read in timelib_meridian()
Apply upstream patch for CVE-2016-1283 |
get_function_line(
exarg_T *eap,
garray_T *lines_to_free,
int indent,
getline_opt_T getline_options)
{
char_u *theline;
if (eap->getline == NULL)
theline = getcmdline(':', 0L, indent, 0);
else
theline = eap->getline(':', eap->cookie, indent, getline_options);
if (theline != NULL)
{
if (lin... | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 120,110,087,176,744,760,000,000,000,000,000,000,000 | 23 | patch 8.2.4040: keeping track of allocated lines is too complicated
Problem: Keeping track of allocated lines in user functions is too
complicated.
Solution: Instead of freeing individual lines keep them all until the end. |
void TLSWrap::Receive(const FunctionCallbackInfo<Value>& args) {
TLSWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
CHECK(Buffer::HasInstance(args[0]));
char* data = Buffer::Data(args[0]);
size_t len = Buffer::Length(args[0]);
Debug(wrap, "Receiving %zu bytes injected from JS", len);
// Copy ... | 0 | [
"CWE-416"
] | node | 7f178663ebffc82c9f8a5a1b6bf2da0c263a30ed | 13,457,494,721,212,660,000,000,000,000,000,000,000 | 21 | src: use unique_ptr for WriteWrap
This commit attempts to avoid a use-after-free error by using unqiue_ptr
and passing a reference to it.
CVE-ID: CVE-2020-8265
Fixes: https://github.com/nodejs-private/node-private/issues/227
PR-URL: https://github.com/nodejs-private/node-private/pull/238
Reviewed-By: Michael Dawson <... |
resolveTable (const char *tableList, const char *base)
{
return (*tableResolver) (tableList, base);
} | 0 | [] | liblouis | dc97ef791a4fae9da11592c79f9f79e010596e0c | 277,351,636,352,457,840,000,000,000,000,000,000,000 | 4 | Merge branch 'table_resolver' |
static int sctp_setsockopt_auth_key(struct sock *sk,
char __user *optval,
unsigned int optlen)
{
struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authkey *authkey;
struct sctp_association *asoc;
int ret;
if (!ep->auth_enable)
return -EACCES;
if (optlen <= sizeof(struct sctp_authkey))
... | 0 | [
"CWE-617",
"CWE-362"
] | linux | 2dcab598484185dea7ec22219c76dcdd59e3cb90 | 232,164,074,655,363,440,000,000,000,000,000,000,000 | 35 | sctp: avoid BUG_ON on sctp_wait_for_sndbuf
Alexander Popov reported that an application may trigger a BUG_ON in
sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
waiting on it to queue more data and meanwhile another thread peels off
the association being used by the first thread.
This patch replaces ... |
bcon_error_t bson_append_bcon(bson *b, const bcon *bc) {
return bson_append_bcon_with_state(b, bc, State_Element);
} | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 296,960,786,912,801,600,000,000,000,000,000,000,000 | 3 | don't mix up int and size_t (first pass to fix that) |
ebb_ews_func_beginswith (struct _ESExp *f,
gint argc,
struct _ESExpResult **argv,
gpointer data)
{
ESExpResult *r;
const gchar *propname, *str;
EBookBackendEwsSExpData *sdata = data;
if (argc != 2 ||
argv[0]->type != ESEXP_RES_STRING ||
argv[1]->type != ESEXP_RES_STRING) {
e_sexp_fatal_erro... | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 135,649,289,494,504,560,000,000,000,000,000,000,000 | 30 | I#27 - SSL Certificates are not validated
This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too.
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27 |
guchar getRruleCount (guchar a, guchar b) {
return ((a << 8) | b);
} | 0 | [] | evolution | a9fb511ced4cfaffb7109e58a9db66e6279e309c | 179,042,696,570,037,500,000,000,000,000,000,000,000 | 3 | bug #641069 - tnef plugin vulnerabilities
Resolves directory traversal and buffer overflow vulnerabilities. |
psg_json_value_set_ngx_flag(PsgJsonValue *doc, const char *name, ngx_flag_t value) {
if (value != NGX_CONF_UNSET) {
return psg_json_value_set_bool(doc, name, value);
} else {
return NULL;
}
} | 0 | [
"CWE-362"
] | passenger | 207870f5b7f5cc240587ab0977d6046782ae1d86 | 34,240,149,899,581,880,000,000,000,000,000,000,000 | 7 | Fix privilege escalation in the Nginx module
The vulnerability is exploitable with a non-standard
passenger_instance_registry_dir, via a race condition where after a file
was created, it was chowned via the path not the file descriptor.
The chown entered the code in 2010, so Passenger 4 + 5 all affected. |
static int afiucv_pm_freeze(struct device *dev)
{
struct iucv_sock *iucv;
struct sock *sk;
int err = 0;
#ifdef CONFIG_PM_DEBUG
printk(KERN_WARNING "afiucv_pm_freeze\n");
#endif
read_lock(&iucv_sk_list.lock);
sk_for_each(sk, &iucv_sk_list.head) {
iucv = iucv_sk(sk);
switch (sk->sk_state) {
case IUCV_DISCONN... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 198,157,605,226,479,940,000,000,000,000,000,000,000 | 31 | 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... |
CImg<Tfloat> get_sRGBtoRGB() const {
return CImg<Tfloat>(*this,false).sRGBtoRGB();
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 2,976,006,768,316,448,300,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
uint32_t readFloat(float& flt) {
T_VIRTUAL_CALL();
return readFloat_virt(flt);
} | 0 | [
"CWE-20",
"CWE-755"
] | fbthrift | 01686e15ec77ccb4d49a77d5bce3a01601e54d64 | 256,326,770,764,056,560,000,000,000,000,000,000,000 | 4 | Throw on skipping an invalid type.
Summary:
Certain values (e.g.) T_STOP should not appear as a skip type. Allowing them to
can cause thrift to loop unboundedly.
Reviewed By: spalamarchuk
Differential Revision: D15102451
fbshipit-source-id: c08d52f44f37e9c212d3480233ac217105586c9f |
TEST(ArrayOpsTest, GatherV2_ShapeFn) {
ShapeInferenceTestOp op("GatherV2");
AddNodeAttr("batch_dims", 0, &op.node_def);
// Tests when axis is unknown.
INFER_OK(op, "?;?;?", "?");
INFER_OK(op, "[1,2,3];[3];[]", "[?,?,?]");
INFER_ERROR("Shape must be at least rank 1 but is rank 0", op,
"[];[1,2... | 0 | [
"CWE-125"
] | tensorflow | 7cf73a2274732c9d82af51c2bc2cf90d13cd7e6d | 260,190,409,652,652,480,000,000,000,000,000,000,000 | 65 | Address QuantizeAndDequantizeV* heap oob. Added additional checks for the 'axis' attribute.
PiperOrigin-RevId: 402446942
Change-Id: Id2f6b82e4e740d0550329be02621c46466b5a5b9 |
l2rgb(UINT8 *out, const UINT8 *in, int xsize) {
int x;
for (x = 0; x < xsize; x++) {
UINT8 v = *in++;
*out++ = v;
*out++ = v;
*out++ = v;
*out++ = 255;
}
} | 0 | [
"CWE-120"
] | Pillow | 518ee3722a99d7f7d890db82a20bd81c1c0327fb | 227,314,486,774,382,980,000,000,000,000,000,000,000 | 10 | Use snprintf instead of sprintf |
void fillFieldTraitsFromName() {
throw std::logic_error("NimbleProtocol doesn't support field names");
} | 0 | [
"CWE-703",
"CWE-770"
] | fbthrift | 3f156207e8a6583d88999487e954320dc18955e6 | 187,407,252,732,783,900,000,000,000,000,000,000,000 | 3 | Better handling of truncated data when reading containers
Summary:
Currently we read the container size and blindly pre-allocate the container of that size. This allows malicious attacker to send few bytes message and cause server to allocate GBs of memory.
This diff changes the logic to check if we have at least 1b/... |
bool IsSupported(const NodeDef* node) const override {
return IsBitcast(*node);
} | 0 | [
"CWE-476"
] | tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | 267,449,131,463,477,700,000,000,000,000,000,000,000 | 3 | Handle a special grappler case resulting in crash.
It might happen that a malformed input could be used to trick Grappler into trying to optimize a node with no inputs. This, in turn, would produce a null pointer dereference and a segfault.
PiperOrigin-RevId: 369242852
Change-Id: I2e5cbe7aec243d34a6d60220ac8ac9b16f13... |
static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info,
const Image *image,ExceptionInfo *exception)
{
#define ClassifyImageTag "Classify/Image"
CacheView
*image_view;
DoublePixelPacket
error,
mid,
midpoint,
pixel;
MagickBooleanType
proceed;
double
bisect;
NodeInf... | 0 | [
"CWE-125"
] | ImageMagick | 5294966898532a6bd54699fbf04edf18902513ac | 7,938,453,060,191,283,000,000,000,000,000,000,000 | 264 | https://github.com/ImageMagick/ImageMagick/issues/1156 |
irc_server_reconnect_schedule (struct t_irc_server *server)
{
int minutes, seconds;
if (IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_AUTORECONNECT))
{
/* growing reconnect delay */
if (server->reconnect_delay == 0)
server->reconnect_delay = IRC_SERVER_OPTION_INTEGER(serve... | 0 | [
"CWE-120",
"CWE-787"
] | weechat | 40ccacb4330a64802b1f1e28ed9a6b6d3ca9197f | 83,781,110,206,516,830,000,000,000,000,000,000,000 | 58 | irc: fix crash when a new message 005 is received with longer nick prefixes
Thanks to Stuart Nevans Locke for reporting the issue. |
size_t streamReplyWithRange(client *c, stream *s, streamID *start, streamID *end, size_t count, int rev, streamCG *group, streamConsumer *consumer, int flags, streamPropInfo *spi) {
void *arraylen_ptr = NULL;
size_t arraylen = 0;
streamIterator si;
int64_t numfields;
streamID id;
/* If a group ... | 0 | [
"CWE-125",
"CWE-704"
] | redis | c04082cf138f1f51cedf05ee9ad36fb6763cafc6 | 83,587,119,162,573,350,000,000,000,000,000,000,000 | 96 | Abort in XGROUP if the key is not a stream |
static int mailimf_no_fold_quote_parse(const char * message, size_t length,
size_t * indx, char ** result)
{
size_t cur_token;
size_t begin;
char ch;
char * no_fold_quote;
int r;
int res;
begin = cur_token;
r = mailimf_dquote_parse(message, length, &cur_token);
if (r != MAILIMF_NO_ERROR) {... | 0 | [
"CWE-476"
] | libetpan | 1fe8fbc032ccda1db9af66d93016b49c16c1f22d | 64,810,078,963,539,920,000,000,000,000,000,000,000 | 53 | Fixed crash #274 |
png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit,
const void *buffer, png_int_32 row_stride, const void *colormap)
{
/* Write the image to the given (FILE*). */
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{
if (file != NULL)
{
if (png_image_write_... | 0 | [
"CWE-120"
] | libpng | 81f44665cce4cb1373f049a76f3904e981b7a766 | 284,259,040,014,603,330,000,000,000,000,000,000,000 | 47 | [libpng16] Reject attempt to write over-length PLTE chunk |
static int dccp_feat_propagate_ccid(struct list_head *fn, u8 id, bool is_local)
{
const struct ccid_dependency *table = dccp_feat_ccid_deps(id, is_local);
int i, rc = (table == NULL);
for (i = 0; rc == 0 && table[i].dependent_feat != DCCPF_RESERVED; i++)
if (dccp_feat_type(table[i].dependent_feat) == FEAT_SP)
... | 0 | [
"CWE-401"
] | linux | 1d3ff0950e2b40dc861b1739029649d03f591820 | 205,975,317,427,726,300,000,000,000,000,000,000,000 | 17 | dccp: Fix memleak in __feat_register_sp
If dccp_feat_push_change fails, we forget free the mem
which is alloced by kmemdup in dccp_feat_clone_sp_val.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: e8ef967a54f4 ("dccp: Registration routines for changing feature values")
Reviewed-by: Mukesh Ojha <mojha@codeaurora.o... |
static void free_segment_list(struct playlist *pls)
{
int i;
for (i = 0; i < pls->n_segments; i++) {
av_free(pls->segments[i]->key);
av_free(pls->segments[i]->url);
av_free(pls->segments[i]);
}
av_freep(&pls->segments);
pls->n_segments = 0;
} | 0 | [
"CWE-703"
] | FFmpeg | 7ba100d3e6e8b1e5d5342feb960a7f081d6e15af | 72,765,656,042,518,210,000,000,000,000,000,000,000 | 11 | avformat/hls: Fix DoS due to infinite loop
Fixes: loop.m3u
The default max iteration count of 1000 is arbitrary and ideas for a better solution are welcome
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Previous version reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <... |
static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
{
if (up_flag)
return;
if (value >= ARRAY_SIZE(fn_handler))
return;
if ((kbd->kbdmode == VC_RAW ||
kbd->kbdmode == VC_MEDIUMRAW ||
kbd->kbdmode == VC_OFF) &&
value != KVAL(K_SAK))
return; /* SAK is allowed even in raw ... | 0 | [
"CWE-416"
] | linux | 6ca03f90527e499dd5e32d6522909e2ad390896b | 149,252,858,092,405,760,000,000,000,000,000,000,000 | 13 | vt: keyboard, simplify vt_kdgkbsent
Use 'strlen' of the string, add one for NUL terminator and simply do
'copy_to_user' instead of the explicit 'for' loop. This makes the
KDGKBSENT case more compact.
The only thing we need to take care about is NULL 'func_table[i]'. Use
an empty string in that case.
The original che... |
ZEND_API zval* ZEND_FASTCALL _zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC)
{
return _zend_hash_index_add_or_update_i(ht, h, pData, HASH_UPDATE ZEND_FILE_LINE_RELAY_CC);
} | 0 | [
"CWE-190"
] | php-src | 4cc0286f2f3780abc6084bcdae5dce595daa3c12 | 85,614,743,909,809,870,000,000,000,000,000,000,000 | 4 | Fix #73832 - leave the table in a safe state if the size is too big. |
static u16 ath10k_usb_hif_get_free_queue_number(struct ath10k *ar, u8 pipe_id)
{
struct ath10k_usb *ar_usb = ath10k_usb_priv(ar);
return ar_usb->pipes[pipe_id].urb_cnt;
} | 0 | [
"CWE-476"
] | linux | bfd6e6e6c5d2ee43a3d9902b36e01fc7527ebb27 | 183,470,784,565,477,000,000,000,000,000,000,000,000 | 6 | ath10k: Fix a NULL-ptr-deref bug in ath10k_usb_alloc_urb_from_pipe
The `ar_usb` field of `ath10k_usb_pipe_usb_pipe` objects
are initialized to point to the containing `ath10k_usb` object
according to endpoint descriptors read from the device side, as shown
below in `ath10k_usb_setup_pipe_resources`:
for (i = 0; i < i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.