func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
inline void ClampWithRangeAndStore(int8_t* output_dst, int8x16_t input_val,
uint8x16x2_t masks_clamp) {
static const int8x16_t max_dup = vdupq_n_s8(127);
static const int8x16_t min_dup = vdupq_n_s8(-128);
// Store back to memory
vst1q_s8(output_dst,
vbslq_s8(masks_c... | 0 | [
"CWE-476",
"CWE-369"
] | tensorflow | 15691e456c7dc9bd6be203b09765b063bf4a380c | 279,707,406,012,759,380,000,000,000,000,000,000,000 | 9 | Prevent dereferencing of null pointers in TFLite's `add.cc`.
PiperOrigin-RevId: 387244946
Change-Id: I56094233327fbd8439b92e1dbb1262176e00eeb9 |
TEST(HeaderMapImplTest, SetRemovesAllValues) {
TestRequestHeaderMapImpl headers;
LowerCaseString key1("hello");
LowerCaseString key2("olleh");
std::string ref_value1("world");
std::string ref_value2("planet");
std::string ref_value3("globe");
std::string ref_value4("earth");
std::string ref_value5("blu... | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 29,038,879,434,301,716,000,000,000,000,000,000,000 | 40 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
static int nf_ct_frag6_sysctl_register(struct net *net)
{
struct ctl_table *table;
struct ctl_table_header *hdr;
table = nf_ct_frag6_sysctl_table;
if (!net_eq(net, &init_net)) {
table = kmemdup(table, sizeof(nf_ct_frag6_sysctl_table),
GFP_KERNEL);
if (table == NULL)
goto err_alloc;
table[0].data = &n... | 0 | [] | linux | 3ef0eb0db4bf92c6d2510fe5c4dc51852746f206 | 7,361,234,174,757,046,000,000,000,000,000,000,000 | 30 | net: frag, move LRU list maintenance outside of rwlock
Updating the fragmentation queues LRU (Least-Recently-Used) list,
required taking the hash writer lock. However, the LRU list isn't
tied to the hash at all, so we can use a separate lock for it.
Original-idea-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Je... |
spell_cat_line(char_u *buf, char_u *line, int maxlen)
{
char_u *p;
int n;
p = skipwhite(line);
while (vim_strchr((char_u *)"*#/\"\t", *p) != NULL)
p = skipwhite(p + 1);
if (*p != NUL)
{
// Only worth concatenating if there is something else than spaces to
// concatenate.
n = (int)(p - lin... | 0 | [
"CWE-416"
] | vim | 2813f38e021c6e6581c0c88fcf107e41788bc835 | 230,741,979,840,102,800,000,000,000,000,000,000,000 | 21 | patch 8.2.5072: using uninitialized value and freed memory in spell command
Problem: Using uninitialized value and freed memory in spell command.
Solution: Initialize "attr". Check for empty line early. |
char *mkprints(unsigned char *src, size_t len) {
char *dst = malloc(len * 4 + 1);
if (dst)
mkprint(dst, src, len);
return (dst);
} | 0 | [
"CWE-476"
] | cronie | a6576769f01325303b11edc3e0cfb05ef382ce56 | 46,626,001,567,742,570,000,000,000,000,000,000,000 | 8 | 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. |
static int rsync_xal_get(const char *fname, item_list *xalp)
{
ssize_t list_len, name_len;
size_t datum_len, name_offset;
char *name, *ptr;
#ifdef HAVE_LINUX_XATTRS
int user_only = am_sender ? 0 : !am_root;
#endif
rsync_xa *rxa;
int count;
/* This puts the name list into the "namebuf" buffer. */
if ((list_len ... | 0 | [
"CWE-125"
] | rsync | 47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 | 140,099,629,900,988,180,000,000,000,000,000,000,000 | 72 | Enforce trailing \0 when receiving xattr name values.
Fixes bug 13112. |
static bool ack_pending(void)
{
return atomic_test_bit(link.flags, ADV_ACK_PENDING);
} | 0 | [
"CWE-787"
] | zephyr | 6ec31c852049641095f2cdf25591f2e1bff86774 | 328,851,813,321,532,040,000,000,000,000,000,000,000 | 4 | 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... |
process(struct Interface *ifacel, unsigned char *msg, int len,
struct sockaddr_in6 *addr, struct in6_pktinfo *pkt_info, int hoplimit)
{
struct Interface *iface;
struct icmp6_hdr *icmph;
char addr_str[INET6_ADDRSTRLEN];
print_addr(&addr->sin6_addr, addr_str);
if ( ! pkt_info )
{
flog(LOG_WARNING, "received pa... | 0 | [
"CWE-119"
] | radvd | 9dfaaaf740ce784541e76e68de4ae04dce2c0921 | 85,422,220,546,333,520,000,000,000,000,000,000,000 | 115 | In process_ra() ND_OPT_DNSSL_INFORMATION option parsing "label_len"
is not checked for negativeness; it leads to "suffix" buffer overflow,
which leads to privilege escalation (at least with -fno-stack-protector,
I didn't discover whether it's possible with -fstack-protector). |
void tcp_v4_early_demux(struct sk_buff *skb)
{
const struct iphdr *iph;
const struct tcphdr *th;
struct sock *sk;
if (skb->pkt_type != PACKET_HOST)
return;
if (!pskb_may_pull(skb, skb_transport_offset(skb) + sizeof(struct tcphdr)))
return;
iph = ip_hdr(skb);
th = tcp_hdr(skb);
if (th->doff < sizeof(stru... | 0 | [] | linux | 7bced397510ab569d31de4c70b39e13355046387 | 266,850,773,950,518,700,000,000,000,000,000,000,000 | 36 | 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... |
JNIid::JNIid(Klass* holder, int offset, JNIid* next) {
_holder = holder;
_offset = offset;
_next = next;
debug_only(_is_static_field_id = false;)
} | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 33,571,310,609,818,180,000,000,000,000,000,000,000 | 6 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
cmsBool RegisterTypesPlugin(cmsContext id, cmsPluginBase* Data, _cmsTagTypeLinkedList* LinkedList, cmsUInt32Number DefaultListCount)
{
cmsPluginTagType* Plugin = (cmsPluginTagType*) Data;
_cmsTagTypeLinkedList *pt, *Anterior = NULL;
// Calling the function with NULL as plug-in would unregister the plug in.... | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 192,446,668,177,334,350,000,000,000,000,000,000,000 | 38 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
qboolean FS_IsDemoExt(const char *filename, int namelen)
{
char *ext_test;
int index, protocol;
ext_test = strrchr(filename, '.');
if(ext_test && !Q_stricmpn(ext_test + 1, DEMOEXT, ARRAY_LEN(DEMOEXT) - 1))
{
protocol = atoi(ext_test + ARRAY_LEN(DEMOEXT));
if(protocol == com_protocol->integer)
return qtrue... | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 121,848,704,526,894,480,000,000,000,000,000,000,000 | 27 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
void seq_copy_to_input(unsigned char *event_rec, int len)
{
unsigned long flags;
/*
* Verify that the len is valid for the current mode.
*/
if (len != 4 && len != 8)
return;
if ((seq_mode == SEQ_1) != (len == 4))
return;
if (iqlen >= (SEQ_MAX_QUEUE - 1))
return; /* Overflow */
spin_lock_irqsave(&lo... | 0 | [
"CWE-703",
"CWE-189"
] | linux | b769f49463711205d57286e64cf535ed4daf59e9 | 297,505,548,220,271,700,000,000,000,000,000,000,000 | 23 | sound/oss: remove offset from load_patch callbacks
Was: [PATCH] sound/oss/midi_synth: prevent underflow, use of
uninitialized value, and signedness issue
The offset passed to midi_synth_load_patch() can be essentially
arbitrary. If it's greater than the header length, this will result in
a copy_from_user(dst, src, n... |
_gcry_mpi_powm (gcry_mpi_t res,
gcry_mpi_t base, gcry_mpi_t expo, gcry_mpi_t mod)
{
/* Pointer to the limbs of the arguments, their size and signs. */
mpi_ptr_t rp, ep, mp, bp;
mpi_size_t esize, msize, bsize, rsize;
int msign, bsign, rsign;
/* Flags telling the secure allocation... | 1 | [
"CWE-310"
] | libgcrypt | 78130828e9a140a9de4dafadbc844dbb64cb709a | 30,515,234,729,967,230,000,000,000,000,000,000,000 | 299 | Same computation for square and multiply.
* mpi/mpi-pow.c (_gcry_mpi_powm): Compare msize for max_u_size. Move
the assignment to base_u into the loop. Copy content refered by RP to
BASE_U except the last of the loop.
--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> |
void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) {
LIRItem value(x->argument_at(0), this);
value.set_destroys_register();
LIR_Opr calc_result = rlock_result(x);
LIR_Opr result_reg = result_register_for(x->type());
CallingConvention* cc = NULL;
if (x->id() == vmIntrinsics::_dpow) {
LIRItem value1(x->... | 0 | [] | jdk17u | 268c0159253b3de5d72eb826ef2329b27bb33fea | 258,859,470,206,242,670,000,000,000,000,000,000,000 | 138 | 8272014: Better array indexing
Reviewed-by: thartmann
Backport-of: 937c31d896d05aa24543b74e98a2ea9f05b5d86f |
void doreply(void)
{
struct reply *scannedentry;
struct reply *nextentry;
if ((scannedentry = firstreply) == NULL) {
return;
}
do {
nextentry = scannedentry->next;
#ifdef WITH_TLS
if (tls_cnx != NULL) {
char buf[MAX_SERVER_REPLY_LEN];
snprintf(buf, s... | 0 | [
"CWE-434"
] | pure-ftpd | 37ad222868e52271905b94afea4fc780d83294b4 | 175,690,749,999,805,430,000,000,000,000,000,000,000 | 37 | Initialize the max upload file size when quotas are enabled
Due to an unwanted check, files causing the quota to be exceeded
were deleted after the upload, but not during the upload.
The bug was introduced in 2009 in version 1.0.23
Spotted by @DroidTest, thanks! |
static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
struct shmem_inode_info *info, pgoff_t index)
{
struct vm_area_struct pvma;
struct page *page;
/* Create a pseudo vma that just contains the policy */
pvma.vm_start = 0;
/* Bias interleave by inode number to distribute better across nodes */
pvma.v... | 0 | [
"CWE-399"
] | linux | 5f00110f7273f9ff04ac69a5f85bb535a4fd0987 | 10,107,997,405,893,050,000,000,000,000,000,000,000 | 20 | tmpfs: fix use-after-free of mempolicy object
The tmpfs remount logic preserves filesystem mempolicy if the mpol=M
option is not specified in the remount request. A new policy can be
specified if mpol=M is given.
Before this patch remounting an mpol bound tmpfs without specifying
mpol= mount option in the remount re... |
int dump_body(struct req_state* const s, const std::string& str)
{
return dump_body(s, str.c_str(), str.length());
} | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 112,446,671,449,161,760,000,000,000,000,000,000,000 | 4 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
static int cieabcvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_comps)
{
os_ptr op = osp;
int i;
if (num_comps < 3)
return_error(gs_error_stackunderflow);
op -= 2;
for (i=0;i<3;i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
return_error... | 0 | [] | ghostpdl | b326a71659b7837d3acde954b18bda1a6f5e9498 | 278,757,417,030,219,340,000,000,000,000,000,000,000 | 17 | Bug 699655: Properly check the return value....
...when getting a value from a dictionary |
static void handle_CLNT(ctrl_t *ctrl, char *arg)
{
send_msg(ctrl->sd, "200 CLNT\r\n");
} | 0 | [
"CWE-120",
"CWE-787"
] | uftpd | 0fb2c031ce0ace07cc19cd2cb2143c4b5a63c9dd | 154,415,905,295,932,150,000,000,000,000,000,000,000 | 4 | FTP: Fix buffer overflow in PORT parser, reported by Aaron Esau
Signed-off-by: Joachim Nilsson <troglobit@gmail.com> |
PJ_DEF(int) pjmedia_sdp_print( const pjmedia_sdp_session *desc,
char *buf, pj_size_t size)
{
return print_session(desc, buf, size);
} | 0 | [
"CWE-121",
"CWE-120",
"CWE-787"
] | pjproject | 560a1346f87aabe126509bb24930106dea292b00 | 276,959,091,510,145,200,000,000,000,000,000,000,000 | 5 | Merge pull request from GHSA-f5qg-pqcg-765m |
S3BootScriptSmmAtRuntimeCallBack (
IN CONST EFI_GUID *Protocol,
IN VOID *Interface,
IN EFI_HANDLE Handle
)
{
if (!mS3BootScriptTablePtr->AtRuntime) {
mS3BootScriptTablePtr->BootTimeScriptLength = (UINT32) (mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMIN... | 0 | [
"CWE-787"
] | edk2 | 322ac05f8bbc1bce066af1dabd1b70ccdbe28891 | 186,644,355,260,425,250,000,000,000,000,000,000,000 | 16 | MdeModulePkg/PiDxeS3BootScriptLib: Fix potential numeric truncation (CVE-2019-14563)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2001
For S3BootScriptLib APIs:
S3BootScriptSaveIoWrite
S3BootScriptSaveMemWrite
S3BootScriptSavePciCfgWrite
S3BootScriptSavePciCfg2Write
S3BootScriptSaveSmbusExecute
S3BootScriptSav... |
int wvlan_uil_get_info(struct uilreq *urq, struct wl_private *lp)
{
int result = 0;
int i;
/*------------------------------------------------------------------------*/
DBG_FUNC("wvlan_uil_get_info");
DBG_ENTER(DbgInfo);
if (urq->hcfCtx == &(lp->hcfCtx)) {
if ((urq->data != NULL) && (urq->len != 0)) {
ltv_t... | 0 | [
"CWE-119",
"CWE-787"
] | linux | b5e2f339865fb443107e5b10603e53bbc92dc054 | 58,355,132,206,794,410,000,000,000,000,000,000,000 | 329 | staging: wlags49_h2: buffer overflow setting station name
We need to check the length parameter before doing the memcpy(). I've
actually changed it to strlcpy() as well so that it's NUL terminated.
You need CAP_NET_ADMIN to trigger these so it's not the end of the
world.
Reported-by: Nico Golde <nico@ngolde.de>
Rep... |
static MagickBooleanType WriteDDSImage(const ImageInfo *image_info,
Image *image, ExceptionInfo *exception)
{
const char
*option;
size_t
compression,
columns,
maxMipmaps,
mipmaps,
pixelFormat,
rows;
MagickBooleanType
clusterFit,
status,
weightByAlpha;
assert(image_in... | 0 | [
"CWE-20",
"CWE-617"
] | ImageMagick | 0c5b1e430a83ef793a7334bbbee408cf3c628699 | 28,116,967,095,143,800,000,000,000,000,000,000,000 | 99 | Added check to prevent image being 0x0 (reported in #489). |
deliver_merge_pollstatus(icalcomponent *ical __attribute__((unused)),
icalcomponent *request __attribute__((unused)))
{
return 0;
} | 0 | [
"CWE-787"
] | cyrus-imapd | a5779db8163b99463e25e7c476f9cbba438b65f3 | 255,960,834,735,565,940,000,000,000,000,000,000,000 | 5 | HTTP: don't overrun buffer when parsing strings with sscanf() |
int x509_time_expired( const x509_time *to )
{
x509_time now;
x509_get_current_time( &now );
return( x509_check_time( &now, to ) );
} | 0 | [
"CWE-310"
] | polarssl | 5d8618539f8e186c1b2c1b5a548d6f85936fe41f | 269,121,577,435,732,050,000,000,000,000,000,000,000 | 8 | Fix memory leak while parsing some X.509 certs |
static bool is_finite(const unsigned int) { return true; } | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 265,234,057,453,427,540,000,000,000,000,000,000,000 | 1 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static void release_maps(struct verifier_env *env)
{
int i;
for (i = 0; i < env->used_map_cnt; i++)
bpf_map_put(env->used_maps[i]);
} | 0 | [
"CWE-200"
] | linux | a1b14d27ed0965838350f1377ff97c93ee383492 | 152,518,346,306,699,750,000,000,000,000,000,000,000 | 7 | bpf: fix branch offset adjustment on backjumps after patching ctx expansion
When ctx access is used, the kernel often needs to expand/rewrite
instructions, so after that patching, branch offsets have to be
adjusted for both forward and backward jumps in the new eBPF program,
but for backward jumps it fails to account ... |
int nghttp2_session_client_new(nghttp2_session **session_ptr,
const nghttp2_session_callbacks *callbacks,
void *user_data) {
return nghttp2_session_client_new3(session_ptr, callbacks, user_data, NULL,
NULL);
} | 0 | [] | nghttp2 | 0a6ce87c22c69438ecbffe52a2859c3a32f1620f | 123,258,131,578,617,170,000,000,000,000,000,000,000 | 6 | Add nghttp2_option_set_max_outbound_ack |
idr_start(struct archive_write *a, struct idr *idr, int cnt, int ffmax,
int num_size, int null_size, const struct archive_rb_tree_ops *rbt_ops)
{
int r;
(void)ffmax; /* UNUSED */
r = idr_ensure_poolsize(a, idr, cnt);
if (r != ARCHIVE_OK)
return (r);
__archive_rb_tree_init(&(idr->rbtree), rbt_ops);
idr->wa... | 0 | [
"CWE-190"
] | libarchive | 3014e19820ea53c15c90f9d447ca3e668a0b76c6 | 35,588,819,050,212,650,000,000,000,000,000,000,000 | 18 | Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives
* Don't cast size_t to int, since this can lead to overflow
on machines where sizeof(int) < sizeof(size_t)
* Check a + b > limit by writing it as
a > limit || b > limit || a + b > limit
to avoid problems when a + b wraps... |
CImg<T>& assign(const CImg<t>& img, const char *const dimensions) {
if (!dimensions || !*dimensions) return assign(img._width,img._height,img._depth,img._spectrum);
unsigned int siz[4] = { 0,1,1,1 }, k = 0;
CImg<charT> item(256);
for (const char *s = dimensions; *s && k<4; ++k) {
if ... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 63,952,919,486,528,530,000,000,000,000,000,000,000 | 28 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
TPM2B_DATA_Marshal(TPM2B_DATA *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | 1 | [
"CWE-787"
] | libtpms | 3ef9b26cb9f28bd64d738bff9505a20d4eb56acd | 194,101,337,698,194,500,000,000,000,000,000,000,000 | 6 | tpm2: Add maxSize parameter to TPM2B_Marshal for sanity checks
Add maxSize parameter to TPM2B_Marshal and assert on it checking
the size of the data intended to be marshaled versus the maximum
buffer size.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
static int set_altname_dns(X509 *crt, const char *name)
{
return set_altname(crt, GEN_DNS, name, 0);
} | 0 | [
"CWE-476"
] | openssl | 97ab3c4b538840037812c8d9164d09a1f4bf11a1 | 35,630,405,649,128,125,000,000,000,000,000,000,000 | 4 | Add a test for GENERAL_NAME_cmp
Based on a boringssl test contributed by David Benjamin
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> |
LogSetDisplay(void)
{
if (saved_log_fname && strstr(saved_log_fname, "%s")) {
char *logFileName;
logFileName = LogFilePrep(saved_log_fname, saved_log_backup, display);
if (rename(saved_log_tempname, logFileName) == 0) {
LogMessageVerb(X_PROBED, 0,
"Lo... | 0 | [
"CWE-863"
] | xserver | da15c7413916f754708c62c2089265528cd661e2 | 26,130,875,789,501,800,000,000,000,000,000,000,000 | 28 | LogFilePrep: add a comment to the unsafe format string.
CVE-2018-14665 also made it possible to exploit this to access
memory. With -logfile forbidden when running with elevated privileges
this is no longer an issue.
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry... |
static inline int cap_limit_ptraced_target(void) { return 1; } | 0 | [] | linux-2.6 | 3318a386e4ca68c76e0294363d29bdc46fcad670 | 255,372,357,844,967,300,000,000,000,000,000,000,000 | 1 | file caps: always start with clear bprm->caps_*
While Linux doesn't honor setuid on scripts. However, it mistakenly
behaves differently for file capabilities.
This patch fixes that behavior by making sure that get_file_caps()
begins with empty bprm->caps_*. That way when a script is loaded,
its bprm->caps_* may be ... |
PHP_FUNCTION(imagecopy)
{
zval *SIM, *DIM;
zend_long SX, SY, SW, SH, DX, DY;
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
return;
}
if ((im_dst = (gdImagePtr)zend_fetch_resourc... | 0 | [
"CWE-787"
] | php-src | 28022c9b1fd937436ab67bb3d61f652c108baf96 | 132,158,646,592,461,300,000,000,000,000,000,000,000 | 29 | Fix bug#72697 - select_colors write out-of-bounds
(cherry picked from commit b6f13a5ef9d6280cf984826a5de012a32c396cd4)
Conflicts:
ext/gd/gd.c |
builtin_chr_impl(PyObject *module, int i)
/*[clinic end generated code: output=c733afcd200afcb7 input=3f604ef45a70750d]*/
{
return PyUnicode_FromOrdinal(i);
} | 0 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 23,695,251,311,387,813,000,000,000,000,000,000,000 | 5 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
bool AuthorizationSession::isAuthorizedToRevokeRole(const RoleName& role) {
return isAuthorizedForActionsOnResource(ResourcePattern::forDatabaseName(role.getDB()),
ActionType::revokeRole);
} | 0 | [
"CWE-613"
] | mongo | db19e7ce84cfd702a4ba9983ee2ea5019f470f82 | 296,215,116,792,454,430,000,000,000,000,000,000,000 | 4 | SERVER-38984 Validate unique User ID on UserCache hit
(cherry picked from commit e55d6e2292e5dbe2f97153251d8193d1cc89f5d7) |
count_chars_to_escape (const char *str,
const char *meta_chars)
{
int meta_chars_n = strlen (meta_chars);
const char *s;
int n = 0;
for (s = str; *s != 0; s++) {
int i;
for (i = 0; i < meta_chars_n; i++)
if (*s == meta_chars[i]) {
n++;
break;
}
}
return n;
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 4,210,123,841,827,565,400,000,000,000,000,000,000 | 18 | libarchive: sanitize filenames before extracting |
static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l)
{
struct bpf_map *map = &htab->map;
void *ptr;
if (map->ops->map_fd_put_ptr) {
ptr = fd_htab_map_get_ptr(map, l);
map->ops->map_fd_put_ptr(ptr);
}
} | 0 | [
"CWE-787"
] | bpf | c4eb1f403243fc7bbb7de644db8587c03de36da6 | 230,340,797,068,498,900,000,000,000,000,000,000,000 | 10 | bpf: Fix integer overflow involving bucket_size
In __htab_map_lookup_and_delete_batch(), hash buckets are iterated
over to count the number of elements in each bucket (bucket_size).
If bucket_size is large enough, the multiplication to calculate
kvmalloc() size could overflow, resulting in out-of-bounds write
as repor... |
static sd_bus* bus_free(sd_bus *b) {
sd_bus_slot *s;
assert(b);
assert(!b->track_queue);
assert(!b->tracks);
b->state = BUS_CLOSED;
sd_bus_detach_event(b);
while ((s = b->slots)) {
/* At this point only floating slots can still be
... | 0 | [
"CWE-416"
] | systemd | 1068447e6954dc6ce52f099ed174c442cb89ed54 | 256,845,507,968,988,400,000,000,000,000,000,000,000 | 65 | sd-bus: introduce API for re-enqueuing incoming messages
When authorizing via PolicyKit we want to process incoming method calls
twice: once to process and figure out that we need PK authentication,
and a second time after we aquired PK authentication to actually execute
the operation. With this new call sd_bus_enqueu... |
Stream *Http2Handler::get_stream(int32_t stream_id) {
auto itr = id2stream_.find(stream_id);
if (itr == std::end(id2stream_)) {
return nullptr;
} else {
return (*itr).second.get();
}
} | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 179,886,691,754,630,500,000,000,000,000,000,000,000 | 8 | Don't read too greedily |
void __fastcall TNullConsole::WaitBeforeExit()
{
DebugFail();
// noop
}
| 0 | [
"CWE-787"
] | winscp | faa96e8144e6925a380f94a97aa382c9427f688d | 217,368,139,580,449,900,000,000,000,000,000,000,000 | 5 | Bug 1943: Prevent loading session settings that can lead to remote code execution from handled URLs
https://winscp.net/tracker/1943
(cherry picked from commit ec584f5189a856cd79509f754722a6898045c5e0)
Source commit: 0f4be408b3f01132b00682da72d925d6c4ee649b |
XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request) {
return request ? &request->output : NULL;
} | 0 | [
"CWE-119"
] | php-src | 88412772d295ebf7dd34409534507dc9bcac726e | 109,314,675,671,857,180,000,000,000,000,000,000,000 | 3 | Fix bug #68027 - fix date parsing in XMLRPC lib |
void do_handle_bootstrap(THD *thd)
{
/* The following must be called before DBUG_ENTER */
thd->thread_stack= (char*) &thd;
if (my_thread_init() || thd->store_globals())
{
#ifndef EMBEDDED_LIBRARY
close_connection(thd, ER_OUT_OF_RESOURCES);
#endif
thd->fatal_error();
goto end;
}
handle_bootstrap... | 0 | [] | server | ba4927e520190bbad763bb5260ae154f29a61231 | 299,067,343,585,868,100,000,000,000,000,000,000,000 | 30 | MDEV-19398: Assertion `item1->type() == Item::FIELD_ITEM ...
Window Functions code tries to minimize the number of times it
needs to sort the select's resultset by finding "compatible"
OVER (PARTITION BY ... ORDER BY ...) clauses.
This employs compare_order_elements(). That function assumed that
the order expressions... |
START_TEST(virgl_test_transfer_res_write_valid)
{
virgl_test_transfer_res(_i, true, false);
} | 0 | [
"CWE-909"
] | virglrenderer | b05bb61f454eeb8a85164c8a31510aeb9d79129c | 308,565,449,380,146,700,000,000,000,000,000,000,000 | 4 | vrend: clear memory when allocating a host-backed memory resource
Closes: #249
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
static int _r_rsa_oaep_encrypt(gnutls_pubkey_t g_pub, jwa_alg alg, uint8_t * cleartext, size_t cleartext_len, uint8_t * ciphertext, size_t * cyphertext_len) {
struct rsa_public_key pub;
gnutls_datum_t m = {NULL, 0}, e = {NULL, 0};
int ret = RHN_OK;
mpz_t gibberish;
rsa_public_key_init(&pub);
mpz_init(gibbe... | 0 | [
"CWE-787"
] | rhonabwy | b4c2923a1ba4fabf9b55a89244127e153a3e549b | 29,630,355,225,329,315,000,000,000,000,000,000,000 | 43 | Fix buffer overflow on r_jwe_aesgcm_key_unwrap |
int wolfSSH_SFTP_RecvWrite(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz)
#ifndef USE_WINDOWS_API
{
WFD fd;
word32 sz;
int ret = WS_SUCCESS;
word32 idx = 0;
word32 ofst[2] = {0,0};
word32 outSz = 0;
byte* out = NULL;
char suc[] = "Write File Success";
char err[] = ... | 0 | [
"CWE-190"
] | wolfssh | edb272e35ee57e7b89f3e127222c6981b6a1e730 | 78,620,749,846,525,750,000,000,000,000,000,000,000 | 84 | ASAN SFTP Fixes
When decoding SFTP messages, fix the size checks so they don't wrap. (ZD12766) |
pkinit_server_get_edata(krb5_context context,
krb5_kdc_req *request,
krb5_kdcpreauth_callbacks cb,
krb5_kdcpreauth_rock rock,
krb5_kdcpreauth_moddata moddata,
krb5_preauthtype pa_type,
... | 0 | [
"CWE-476"
] | krb5 | db64ca25d661a47b996b4e2645998b5d7f0eb52c | 16,173,831,097,664,610,000,000,000,000,000,000,000 | 25 | PKINIT (draft9) null ptr deref [CVE-2012-1016]
Don't check for an agility KDF identifier in the non-draft9 reply
structure when we're building a draft9 reply, because it'll be NULL.
The KDC plugin for PKINIT can dereference a null pointer when handling
a draft9 request, leading to a crash of the KDC process. An atta... |
PHP_METHOD(Phar, __destruct)
{
zval *zobj = getThis();
phar_archive_object *phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
if (phar_obj->archive && phar_obj->archive->is_persistent) {
zend_hash_str_del(&PHAR_G(phar_persist_map), (const char *) phar_obj->archive, sizeof(... | 0 | [
"CWE-20"
] | php-src | 1e9b175204e3286d64dfd6c9f09151c31b5e099a | 86,472,510,745,464,460,000,000,000,000,000,000,000 | 9 | Fix bug #71860: Require valid paths for phar filenames |
static int handle_incoming_request(h2o_http2_conn_t *conn, h2o_http2_stream_t *stream, const uint8_t *src, size_t len,
const char **err_desc)
{
int ret, header_exists_map;
assert(stream->state == H2O_HTTP2_STREAM_STATE_RECV_HEADERS);
header_exists_map = 0;
if ((ret =... | 0 | [
"CWE-703"
] | h2o | 1c0808d580da09fdec5a9a74ff09e103ea058dd4 | 51,307,262,717,807,070,000,000,000,000,000,000,000 | 38 | h2: use after free on premature connection close #920
lib/http2/connection.c:on_read() calls parse_input(), which might free
`conn`. It does so in particular if the connection preface isn't
the expected one in expect_preface(). `conn` is then used after the free
in `if (h2o_timeout_is_linked(&conn->_write.timeout_entr... |
const Magick::Quantum *Magick::Image::getConstPixels(const ssize_t x_,
const ssize_t y_,const size_t columns_,const size_t rows_) const
{
const Quantum
*p;
GetPPException;
p=GetVirtualPixels(constImage(),x_, y_,columns_, rows_,exceptionInfo);
ThrowImageException;
return(p);
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 12,460,449,112,123,158,000,000,000,000,000,000,000 | 11 | Added missing return to avoid use after free. |
static inline void clear_AC(struct kernel_vm86_regs *regs)
{
regs->pt.flags &= ~X86_EFLAGS_AC;
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 45,647,841,355,684,330,000,000,000,000,000,000,000 | 4 | 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(... |
ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
const struct in6_addr *peer_addr, int pfxlen,
int scope, u32 flags, u32 valid_lft, u32 prefered_lft)
{
struct inet6_ifaddr *ifa = NULL;
struct rt6_info *rt;
unsigned int hash;
int err = 0;
int addr_type = ipv6_addr_type(addr);
if (a... | 0 | [
"CWE-20"
] | linux | 77751427a1ff25b27d47a4c36b12c3c8667855ac | 123,387,338,225,620,730,000,000,000,000,000,000,000 | 107 | ipv6: addrconf: validate new MTU before applying it
Currently we don't check if the new MTU is valid or not and this allows
one to configure a smaller than minimum allowed by RFCs or even bigger
than interface own MTU, which is a problem as it may lead to packet
drops.
If you have a daemon like NetworkManager running... |
int dtls1_send_hello_request(SSL *s)
{
unsigned char *p;
if (s->state == SSL3_ST_SW_HELLO_REQ_A)
{
p=(unsigned char *)s->init_buf->data;
p = dtls1_set_message_header(s, p, SSL3_MT_HELLO_REQUEST, 0, 0, 0);
s->state=SSL3_ST_SW_HELLO_REQ_B;
/* number of bytes to write */
s->init_num=DTLS1_HM_HEADER_LENGTH... | 0 | [] | openssl | 4817504d069b4c5082161b02a22116ad75f822b1 | 11,065,185,486,610,940,000,000,000,000,000,000,000 | 21 | PR: 2658
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve
Support for TLS/DTLS heartbeats. |
deep_count_got_info (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GFileInfo *info;
const char *id;
GFile *file = (GFile *) source_object;
DeepCountState *state = (DeepCountState *) user_data;
info = g_file_query_info_finish (fi... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 67,118,591,905,190,660,000,000,000,000,000,000,000 | 18 | 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... |
pgp_get_blob(sc_card_t *card, pgp_blob_t *blob, unsigned int id,
pgp_blob_t **ret)
{
pgp_blob_t *child;
int r;
if ((r = pgp_enumerate_blob(card, blob)) < 0)
return r;
for (child = blob->files; child; child = child->next) {
if (child->id == id) {
(void) pgp_read_blob(card, child);
*ret = child;
r... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 135,052,666,225,043,660,000,000,000,000,000,000,000 | 38 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
BGD_DECLARE(void *) gdImageBmpPtr(gdImagePtr im, int *size, int compression)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
if (out == NULL) return NULL;
gdImageBmpCtx(im, out, compression);
rv = gdDPExtractData(out, size);
out->gd_free(out);
return rv;
} | 1 | [
"CWE-415"
] | libgd | ac16bdf2d41724b5a65255d4c28fb0ec46bc42f5 | 218,360,437,072,092,030,000,000,000,000,000,000,000 | 10 | bmp: check return value in gdImageBmpPtr
Closes #447. |
do_list_or_revoke_temp_authz (gboolean revoke)
{
gint ret;
PolkitAuthority *authority;
PolkitSubject *session;
GError *error;
ret = 1;
authority = NULL;
session = NULL;
error = NULL;
authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error);
if (authority == NULL)
{
g_prin... | 0 | [
"CWE-787"
] | polkit | a2bf5c9c83b6ae46cbd5c779d3055bff81ded683 | 282,301,252,871,403,060,000,000,000,000,000,000,000 | 129 | pkexec: local privilege escalation (CVE-2021-4034) |
purgeEntriesByHeader(HttpRequest *req, const char *reqUrl, Http::Message *rep, Http::HdrType hdr)
{
const auto hdrUrl = rep->header.getStr(hdr);
if (!hdrUrl)
return;
/*
* If the URL is relative, make it absolute so we can find it.
* If it's absolute, make sure the host parts match to avoi... | 0 | [
"CWE-20"
] | squid | 6c9c44d0e9cf7b72bb233360c5308aa063af3d69 | 20,010,363,504,014,090,000,000,000,000,000,000,000 | 37 | Handle more partial responses (#791) |
PHP_FUNCTION(xml_parser_create_ns)
{
php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
} | 0 | [
"CWE-787"
] | php-src | 7d163e8a0880ae8af2dd869071393e5dc07ef271 | 43,998,073,411,828,940,000,000,000,000,000,000,000 | 4 | truncate results at depth of 255 to prevent corruption |
static void fts3StartNode(Blob *pNode, int iHeight, sqlite3_int64 iChild){
pNode->a[0] = (char)iHeight;
if( iChild ){
assert( pNode->nAlloc>=1+sqlite3Fts3VarintLen(iChild) );
pNode->n = 1 + sqlite3Fts3PutVarint(&pNode->a[1], iChild);
}else{
assert( pNode->nAlloc>=1 );
pNode->n = 1;
}
} | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 89,794,411,093,694,500,000,000,000,000,000,000,000 | 10 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
ns_client_shuttingdown(ns_client_t *client) {
return (client->shuttingdown);
} | 0 | [
"CWE-617"
] | bind9 | 15996f0cb15631b95a801e3e88928494a69ad6ee | 302,699,468,163,483,450,000,000,000,000,000,000,000 | 3 | ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.
More recently, it was used in a3ba95116ed04594ea59a8124bf781b30367a7a2
commit (part of GL #2790) to force the... |
static int unit_set(struct idr *p, void *ptr, int n)
{
int unit;
unit = idr_alloc(p, ptr, n, n + 1, GFP_KERNEL);
if (unit == -ENOSPC)
unit = -EINVAL;
return unit;
} | 0 | [] | linux | 4ab42d78e37a294ac7bc56901d563c642e03c4ae | 204,884,778,175,096,440,000,000,000,000,000,000,000 | 9 | ppp, slip: Validate VJ compression slot parameters completely
Currently slhc_init() treats out-of-range values of rslots and tslots
as equivalent to 0, except that if tslots is too large it will
dereference a null pointer (CVE-2015-7799).
Add a range-check at the top of the function and make it return an
ERR_PTR() on... |
static void annotate_refs_with_symref_info(struct ref *ref)
{
struct string_list symref = STRING_LIST_INIT_DUP;
const char *feature_list = server_capabilities_v1;
while (feature_list) {
int len;
const char *val;
val = parse_feature_value(feature_list, "symref", &len);
if (!val)
break;
parse_one_symref... | 0 | [] | git | a02ea577174ab8ed18f847cf1693f213e0b9c473 | 24,326,174,078,942,160,000,000,000,000,000,000,000 | 26 | 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... |
unserialize_uep(bufinfo_T *bi, int *error, char_u *file_name)
{
int i;
u_entry_T *uep;
char_u **array;
char_u *line;
int line_len;
uep = (u_entry_T *)U_ALLOC_LINE(sizeof(u_entry_T));
if (uep == NULL)
return NULL;
vim_memset(uep, 0, sizeof(u_entry_T));
#ifdef U_DEBUG
uep->ue_magic... | 1 | [
"CWE-190"
] | vim | 0c8485f0e4931463c0f7986e1ea84a7d79f10c75 | 220,930,485,853,172,660,000,000,000,000,000,000,000 | 52 | patch 8.0.0378: possible overflow when reading corrupted undo file
Problem: Another possible overflow when reading corrupted undo file.
Solution: Check if allocated size is not too big. (King) |
*/
static inline void skb_postpull_rcsum(struct sk_buff *skb,
const void *start, unsigned int len)
{
__skb_postpull_rcsum(skb, start, len, 0); | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 62,837,673,882,329,045,000,000,000,000,000,000,000 | 5 | net: create skb_gso_validate_mac_len()
If you take a GSO skb, and split it into packets, will the MAC
length (L2 + L3 + L4 headers + payload) of those packets be small
enough to fit within a given length?
Move skb_gso_mac_seglen() to skbuff.h with other related functions
like skb_gso_network_seglen() so we can use it... |
int __init calipso_init(void)
{
int ret_val;
ret_val = calipso_cache_init();
if (!ret_val)
netlbl_calipso_ops_register(&ops);
return ret_val;
} | 0 | [
"CWE-416"
] | linux | ad5d07f4a9cd671233ae20983848874731102c08 | 277,355,784,863,500,450,000,000,000,000,000,000,000 | 9 | cipso,calipso: resolve a number of problems with the DOI refcounts
The current CIPSO and CALIPSO refcounting scheme for the DOI
definitions is a bit flawed in that we:
1. Don't correctly match gets/puts in netlbl_cipsov4_list().
2. Decrement the refcount on each attempt to remove the DOI from the
DOI list, only re... |
static int parse_options(char *options, struct super_block *sb,
unsigned long *journal_devnum,
unsigned int *journal_ioprio,
int is_remount)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
char *p;
substring_t args[MAX_OPT_ARGS];
int token;
if (!options)
return 1;
while ((p = strsep(&options, ",")) != N... | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 232,877,861,714,054,900,000,000,000,000,000,000,000 | 71 | 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... |
static int check_resource_valid(struct vrend_renderer_resource_create_args *args,
char errmsg[256])
{
/* do not accept handle 0 */
if (args->handle == 0) {
snprintf(errmsg, 256, "Invalid handle");
return -1;
}
/* limit the target */
if (args->target >= PIPE_MA... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 23,801,583,780,214,123,000,000,000,000,000,000,000 | 225 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
init_device (u2fh_devs * devs, struct u2fdevice *dev)
{
unsigned char resp[1024];
unsigned char nonce[8];
if (obtain_nonce(nonce) != 0)
{
return U2FH_TRANSPORT_ERROR;
}
size_t resplen = sizeof (resp);
dev->cid = CID_BROADCAST;
if (u2fh_sendrecv
(devs, dev->id, U2FHID_INIT, nonce, sizeof... | 0 | [
"CWE-119",
"CWE-908",
"CWE-22"
] | libu2f-host | e4bb58cc8b6202a421e65f8230217d8ae6e16eb5 | 89,340,063,168,017,900,000,000,000,000,000,000,000 | 45 | fix filling out of initresp |
static int nft_value_init(const struct nft_ctx *ctx,
struct nft_data *data, struct nft_data_desc *desc,
const struct nlattr *nla)
{
unsigned int len;
len = nla_len(nla);
if (len == 0)
return -EINVAL;
if (len > desc->size)
return -EOVERFLOW;
if (desc->len) {
if (len != desc->len)
return -EINVAL;... | 0 | [
"CWE-400",
"CWE-703"
] | linux | e02f0d3970404bfea385b6edb86f2d936db0ea2b | 268,851,999,178,843,560,000,000,000,000,000,000,000 | 22 | netfilter: nf_tables: disallow binding to already bound chain
Update nft_data_init() to report EINVAL if chain is already bound.
Fixes: d0e2c7de92c7 ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
Reported-by: Gwangun Jung <exsociety@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |
static int __each_dev(struct device *dev, void *data)
{
struct each_dev_arg *arg = (struct each_dev_arg *)data;
/* There are struct usb_interface on the same bus, filter them out */
if (!is_usb_device(dev))
return 0;
return arg->fn(to_usb_device(dev), arg->data);
} | 0 | [
"CWE-400",
"CWE-703"
] | linux | 704620afc70cf47abb9d6a1a57f3825d2bca49cf | 288,578,668,201,549,020,000,000,000,000,000,000,000 | 10 | USB: check usb_get_extra_descriptor for proper size
When reading an extra descriptor, we need to properly check the minimum
and maximum size allowed, to prevent from invalid data being sent by a
device.
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Co-developed-by... |
static void dwc3_gadget_interrupt(struct dwc3 *dwc,
const struct dwc3_event_devt *event)
{
switch (event->type) {
case DWC3_DEVICE_EVENT_DISCONNECT:
dwc3_gadget_disconnect_interrupt(dwc);
break;
case DWC3_DEVICE_EVENT_RESET:
dwc3_gadget_reset_interrupt(dwc);
break;
case DWC3_DEVICE_EVENT_CONNECT_DONE:
d... | 0 | [
"CWE-703",
"CWE-667",
"CWE-189"
] | linux | c91815b596245fd7da349ecc43c8def670d2269e | 80,756,895,619,369,290,000,000,000,000,000,000,000 | 47 | usb: dwc3: gadget: never call ->complete() from ->ep_queue()
This is a requirement which has always existed but, somehow, wasn't
reflected in the documentation and problems weren't found until now
when Tuba Yavuz found a possible deadlock happening between dwc3 and
f_hid. She described the situation as follows:
spin_... |
XML_SetUserData(XML_Parser parser, void *p) {
if (parser == NULL)
return;
if (parser->m_handlerArg == parser->m_userData)
parser->m_handlerArg = parser->m_userData = p;
else
parser->m_userData = p;
} | 0 | [
"CWE-611",
"CWE-776",
"CWE-415",
"CWE-125"
] | libexpat | c20b758c332d9a13afbbb276d30db1d183a85d43 | 147,907,619,442,665,940,000,000,000,000,000,000,000 | 8 | xmlparse.c: Deny internal entities closing the doctype |
GDHCPClientError g_dhcp_client_set_request(GDHCPClient *dhcp_client,
unsigned int option_code)
{
if (!g_list_find(dhcp_client->request_list,
GINT_TO_POINTER((int)option_code)))
dhcp_client->request_list = g_list_prepend(
dhcp_client->request_list,
(GINT_TO_POINTER((int) option_code)));
return G... | 0 | [] | connman | a74524b3e3fad81b0fd1084ffdf9f2ea469cd9b1 | 244,681,426,407,443,400,000,000,000,000,000,000,000 | 11 | gdhcp: Avoid leaking stack data via unitiialized variable
Fixes: CVE-2021-26676 |
void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
{
struct vrend_sub_context *sub;
struct virgl_gl_ctx_param ctx_params;
GLuint i;
LIST_FOR_EACH_ENTRY(sub, &ctx->sub_ctxs, head) {
if (sub->sub_ctx_id == sub_ctx_id) {
return;
}
}
sub = CALLOC_STRUCT(vr... | 0 | [
"CWE-787"
] | virglrenderer | 95e581fd181b213c2ed7cdc63f2abc03eaaa77ec | 24,292,405,123,320,287,000,000,000,000,000,000,000 | 60 | vrend: Add test to resource OOB write and fix it
v2: Also check that no depth != 1 has been send when none is due
Closes: #250
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
{
int signr;
WARN_ON_ONCE(tsk != current);
/* We only dequeue private signals from ourselves, we don't let
* signalfd steal them
*/
signr = __dequeue_signal(&tsk->pending, mask, info);
if (!signr) {
signr = __dequeue_signal(&tsk->... | 0 | [
"CWE-400"
] | linux-stable-rt | bcf6b1d78c0bde228929c388978ed3af9a623463 | 157,878,309,769,592,590,000,000,000,000,000,000,000 | 70 | signal/x86: Delay calling signals in atomic
On x86_64 we must disable preemption before we enable interrupts
for stack faults, int3 and debugging, because the current task is using
a per CPU debug stack defined by the IST. If we schedule out, another task
can come in and use the same stack and cause the stack to be co... |
static int selinux_sock_rcv_skb_compat(struct sock *sk, struct sk_buff *skb,
u16 family)
{
int err = 0;
struct sk_security_struct *sksec = sk->sk_security;
u32 sk_sid = sksec->sid;
struct common_audit_data ad;
struct selinux_audit_data sad = {0,};
struct lsm_network_audit net = {0,};
char *addrp;
CO... | 0 | [
"CWE-264"
] | linux | 259e5e6c75a910f3b5e656151dc602f53f9d7548 | 121,091,097,583,584,330,000,000,000,000,000,000,000 | 34 | Add PR_{GET,SET}_NO_NEW_PRIVS to prevent execve from granting privs
With this change, calling
prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)
disables privilege granting operations at execve-time. For example, a
process will not be able to execute a setuid binary to change their uid
or gid if this bit is set. The same is t... |
flow_compose(struct dp_packet *p, const struct flow *flow, size_t size)
{
flow_compose_minimal(p, flow);
if (size && size < dp_packet_size(p)) {
return false;
}
if (size > dp_packet_size(p)) {
packet_expand(p, flow, size);
}
return true;
} | 0 | [
"CWE-400"
] | ovs | 48ceca0446b1c2c2c03e7551048c5b19ed23cc97 | 201,940,281,822,114,000,000,000,000,000,000,000,000 | 14 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
int kvm_arch_init(void *opaque)
{
struct kvm_x86_init_ops *ops = opaque;
int r;
if (kvm_x86_ops.hardware_enable) {
pr_err("kvm: already loaded vendor module '%s'\n", kvm_x86_ops.name);
r = -EEXIST;
goto out;
}
if (!ops->cpu_has_kvm_support()) {
pr_err_ratelimited("kvm: no hardware support for '%s'\n",
... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 251,381,555,924,414,100,000,000,000,000,000,000,000 | 85 | 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... |
mrb_malloc_simple(mrb_state *mrb, size_t len)
{
return mrb_realloc_simple(mrb, 0, len);
} | 0 | [
"CWE-415"
] | mruby | 97319697c8f9f6ff27b32589947e1918e3015503 | 121,178,969,452,623,900,000,000,000,000,000,000,000 | 4 | Cancel 9cdf439
Should not free the pointer in `realloc` since it can cause
use-after-free problem. |
static int dwa_uncompress(EXRContext *s, const uint8_t *src, int compressed_size,
int uncompressed_size, EXRThreadData *td)
{
int64_t version, lo_usize, lo_size;
int64_t ac_size, dc_size, rle_usize, rle_csize, rle_raw_size;
int64_t ac_count, dc_count, ac_compression;
const int ... | 0 | [
"CWE-20",
"CWE-129"
] | FFmpeg | 26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777 | 64,835,961,090,131,630,000,000,000,000,000,000,000 | 185 | avcodec/exr: More strictly check dc_count
Fixes: out of array access
Fixes: exr/deneme
Found-by: Burak Çarıkçı <burakcarikci@crypttech.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
void DL_Dxf::addMText(DL_CreationInterface* creationInterface) {
double angle = 0.0;
if (hasValue(50)) {
if (libVersion<=0x02000200) {
// wrong but compatible with dxflib <=2.0.2.0 (angle stored in rad):
angle = getRealValue(50, 0.0);
} else {
angle = (getRea... | 0 | [
"CWE-191"
] | qcad | 1eeffc5daf5a06cf6213ffc19e95923cdebb2eb8 | 46,338,429,322,259,660,000,000,000,000,000,000,000 | 54 | check vertexIndex which might be -1 for broken DXF |
DEFUN (ipv6_nd_suppress_ra,
ipv6_nd_suppress_ra_cmd,
"ipv6 nd suppress-ra",
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Suppress Router Advertisement\n")
{
struct interface *ifp;
struct zebra_if *zif;
struct zebra_vrf *zvrf;
ifp = vty->index;
zif = ifp->info;... | 0 | [
"CWE-119",
"CWE-787"
] | quagga | cfb1fae25f8c092e0d17073eaf7bd428ce1cd546 | 147,440,930,441,299,430,000,000,000,000,000,000,000 | 35 | zebra: stack overrun in IPv6 RA receive code (CVE-2016-1245)
The IPv6 RA code also receives ICMPv6 RS and RA messages.
Unfortunately, by bad coding practice, the buffer size specified on
receiving such messages mixed up 2 constants that in fact have
different values.
The code itself has:
#define RTADV_MSG_SIZE 4096
... |
static apr_byte_t oidc_refresh_access_token(request_rec *r, oidc_cfg *c,
oidc_session_t *session, oidc_provider_t *provider,
char **new_access_token) {
oidc_debug(r, "enter");
/* get the refresh token that was stored in the session */
const char *refresh_token = oidc_session_get_refresh_token(r, session);
if ... | 0 | [
"CWE-79"
] | mod_auth_openidc | 55ea0a085290cd2c8cdfdd960a230cbc38ba8b56 | 333,040,089,781,698,980,000,000,000,000,000,000,000 | 46 | Add a function to escape Javascript characters |
MagickPrivate void XUserPreferences(XResourceInfo *resource_info)
{
#if defined(X11_PREFERENCES_PATH)
char
cache[MagickPathExtent],
filename[MagickPathExtent],
specifier[MagickPathExtent];
const char
*client_name,
*value;
XrmDatabase
preferences_database;
/*
Save user preferences ... | 0 | [] | ImageMagick | f391a5f4554fe47eb56d6277ac32d1f698572f0e | 322,647,766,338,054,230,000,000,000,000,000,000,000 | 60 | https://github.com/ImageMagick/ImageMagick/issues/1531 |
void ImapModelOpenConnectionTest::testOkStartTlsDiscardCaps()
{
cleanup(); init(true); // yuck, but I can't come up with anything better...
QCoreApplication::processEvents();
QCoreApplication::processEvents();
QVERIFY(SOCK->writtenStuff().isEmpty());
SOCK->fakeReading( "* OK [Capability imap4rev1 s... | 0 | [
"CWE-200"
] | trojita | 25fffa3e25cbad85bbca804193ad336b090a9ce1 | 28,312,920,987,758,340,000,000,000,000,000,000,000 | 40 | IMAP: refuse to work when STARTTLS is required but server sends PREAUTH
Oops, we cannot send STARTTLS when the connection is already authenticated.
This is serious enough to warrant an error; an attacker might be going after a
plaintext of a message we're going to APPEND, etc.
Thanks to Arnt Gulbrandsen on the imap-p... |
inline void LibxsmmSparseMatMul<TL, TR>::Compute(
typename LibxsmmSparseMatMul<TL, TR>::TensorInfoCache* cache,
const typename LibxsmmSparseMatMul<TL, TR>::ConstMatrixMapL& left,
const typename LibxsmmSparseMatMul<TL, TR>::ConstMatrixMapR& right,
bool transpose_left, const DeviceBase::CpuWorkerThreads* ... | 0 | [
"CWE-125"
] | tensorflow | e6cf28c72ba2eb949ca950d834dd6d66bb01cfae | 128,444,073,653,486,640,000,000,000,000,000,000,000 | 68 | Validate that matrix dimension sizes in SparseMatMul are positive.
PiperOrigin-RevId: 401149683
Change-Id: Ib33eafc561a39c8741ece80b2edce6d4aae9a57d |
void CIRCSock::ConnectionRefused() {
DEBUG(GetSockName() << " == ConnectionRefused()");
if (!m_pNetwork->GetUser()->IsBeingDeleted()) {
m_pNetwork->PutStatus(t_s("Connection Refused. Reconnecting..."));
}
m_pNetwork->ClearRawBuffer();
m_pNetwork->ClearMotdBuffer();
} | 0 | [
"CWE-20",
"CWE-284"
] | znc | d22fef8620cdd87490754f607e7153979731c69d | 203,708,136,375,564,300,000,000,000,000,000,000,000 | 8 | Better cleanup lines coming from network.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this. |
int ha_repartition_key_cache(KEY_CACHE *key_cache)
{
DBUG_ENTER("ha_repartition_key_cache");
if (key_cache->key_cache_inited)
{
mysql_mutex_lock(&LOCK_global_system_variables);
size_t tmp_buff_size= (size_t) key_cache->param_buff_size;
long tmp_block_size= (long) key_cache->param_block_size;
uint... | 0 | [
"CWE-416"
] | server | af810407f78b7f792a9bb8c47c8c532eb3b3a758 | 105,214,423,980,676,120,000,000,000,000,000,000,000 | 22 | MDEV-28098 incorrect key in "dup value" error after long unique
reset errkey after using it, so that it wouldn't affect
the next error message in the next statement |
static void __exit hci_uart_exit(void)
{
int err;
#ifdef CONFIG_BT_HCIUART_H4
h4_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_BCSP
bcsp_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_LL
ll_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_ATH3K
ath_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_3WIRE
h5_deinit();
#endif
#ifdef CONFI... | 0 | [
"CWE-416"
] | linux | 56897b217a1d0a91c9920cb418d6b3fe922f590a | 271,909,995,154,533,400,000,000,000,000,000,000,000 | 40 | Bluetooth: hci_ldisc: Postpone HCI_UART_PROTO_READY bit set in hci_uart_set_proto()
task A: task B:
hci_uart_set_proto flush_to_ldisc
- p->open(hu) -> h5_open //alloc h5 - receive_buf
- set_bit HCI_UART_PROTO_READY - tty_port_default_receive_buf
- hci_uar... |
static u16 cgroup_ss_mask(struct cgroup *cgrp)
{
struct cgroup *parent = cgroup_parent(cgrp);
if (parent) {
u16 ss_mask = parent->subtree_ss_mask;
/* threaded cgroups can only have threaded controllers */
if (cgroup_is_threaded(cgrp))
ss_mask &= cgrp_dfl_threaded_ss_mask;
return ss_mask;
}
return cgrp... | 0 | [
"CWE-416"
] | linux | a06247c6804f1a7c86a2e5398a4c1f1db1471848 | 42,172,556,034,325,254,000,000,000,000,000,000,000 | 15 | psi: Fix uaf issue when psi trigger is destroyed while being polled
With write operation on psi files replacing old trigger with a new one,
the lifetime of its waitqueue is totally arbitrary. Overwriting an
existing trigger causes its waitqueue to be freed and pending poll()
will stumble on trigger->event_wait which w... |
ins_compl_enter_selects(void)
{
return compl_enter_selects;
} | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 121,232,087,608,414,700,000,000,000,000,000,000,000 | 4 | patch 9.0.0020: with some completion reading past end of string
Problem: With some completion reading past end of string.
Solution: Check the length of the string. |
void Compute(OpKernelContext* context) override {
const Tensor& input_sizes = context->input(0);
const Tensor& filter = context->input(1);
OP_REQUIRES(
context, TensorShapeUtils::IsVector(input_sizes.shape()),
errors::InvalidArgument(
"Conv2DBackpropInput: input_sizes input mus... | 1 | [
"CWE-703"
] | tensorflow | 3796cc4fcd93ae55812a457abc96dcd55fbb854b | 260,305,667,593,116,340,000,000,000,000,000,000,000 | 81 | Fix tf.raw_ops.DepthwiseConv2dNativeBackpropInput vulnerability with large input sizes.
Use AddDimWithStatus rather than AddDim in order to catch and report integer overflow gracefully.
PiperOrigin-RevId: 444989983 |
int register_netdevice_notifier(struct notifier_block *nb)
{
struct net_device *dev;
struct net_device *last;
struct net *net;
int err;
/* Close race with setup_net() and cleanup_net() */
down_write(&pernet_ops_rwsem);
rtnl_lock();
err = raw_notifier_chain_register(&netdev_chain, nb);
if (err)
goto unlock;
... | 0 | [
"CWE-416"
] | linux | a4270d6795b0580287453ea55974d948393e66ef | 245,105,974,003,701,800,000,000,000,000,000,000,000 | 54 | net-gro: fix use-after-free read in napi_gro_frags()
If a network driver provides to napi_gro_frags() an
skb with a page fragment of exactly 14 bytes, the call
to gro_pull_from_frag0() will 'consume' the fragment
by calling skb_frag_unref(skb, 0), and the page might
be freed and reused.
Reading eth->h_proto at the en... |
int ssh_scp_response(ssh_scp scp, char **response){
unsigned char code;
int r;
char msg[128];
if(scp==NULL)
return SSH_ERROR;
r=ssh_channel_read(scp->channel,&code,1,0);
if(r == SSH_ERROR)
return SSH_ERROR;
if(code == 0)
return 0;
if(code > 2){
ssh_set_error(scp->session,SSH_FATAL, "SCP: invalid stat... | 1 | [] | libssh | 4aea835974996b2deb011024c53f4ff4329a95b5 | 249,604,857,206,493,100,000,000,000,000,000,000,000 | 36 | CVE-2019-14889: scp: Reformat scp.c
Fixes T181
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 42c727d0c186a1e2fa84a31ab40e16e58b404ab3) |
static int git_pack_config(const char *k, const char *v, void *cb)
{
if (!strcmp(k, "pack.window")) {
window = git_config_int(k, v);
return 0;
}
if (!strcmp(k, "pack.windowmemory")) {
window_memory_limit = git_config_ulong(k, v);
return 0;
}
if (!strcmp(k, "pack.depth")) {
depth = git_config_int(k, v);
... | 0 | [
"CWE-119",
"CWE-787"
] | git | de1e67d0703894cb6ea782e36abb63976ab07e60 | 267,911,876,462,914,040,000,000,000,000,000,000,000 | 62 | list-objects: pass full pathname to callbacks
When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and ... |
int ssl3_connect(SSL *s)
{
BUF_MEM *buf=NULL;
unsigned long Time=(unsigned long)time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
int new_state,state,skip=0;
RAND_add(&Time,sizeof(Time),0);
ERR_clear_error();
clear_sys_error();
if (s->info_callback != NULL)
cb=s->info_callback;
e... | 1 | [] | openssl | 4817504d069b4c5082161b02a22116ad75f822b1 | 42,281,343,868,361,664,000,000,000,000,000,000,000 | 445 | PR: 2658
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve
Support for TLS/DTLS heartbeats. |
static int doAssignAddress(struct nc_state_t *nc, ncMetadata * pMeta, char *instanceId, char *publicIp)
{
ncInstance *instance = NULL;
if (instanceId == NULL || publicIp == NULL) {
LOGERROR("[%s] internal error (bad input parameters to doAssignAddress)\n", instanceId);
return (EUCA_INVALID_ERRO... | 0 | [] | eucalyptus | c252889a46f41b4c396b89e005ec89836f2524be | 62,856,875,537,835,550,000,000,000,000,000,000,000 | 21 | Input validation, shellout hardening on back-end
- validating bucketName and bucketPath in BundleInstance
- validating device name in Attach and DetachVolume
- removed some uses of system() and popen()
Fixes EUCA-7572, EUCA-7520 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.