func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
//! Return stream line of a 2d or 3d vector field.
CImg<floatT> get_streamline(const float x, const float y, const float z,
const float L=256, const float dl=0.1f,
const unsigned int interpolation_type=2, const bool is_backward_tracking=false,
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 237,667,482,793,293,770,000,000,000,000,000,000,000 | 28 | Fix other issues in 'CImg<T>::load_bmp()'. |
nautilus_application_startup (NautilusApplication *application,
gboolean kill_shell,
gboolean no_default_window,
gboolean no_desktop,
gboolean browser_window,
const char *geometry,
char **urls)
{
UniqueMessageData *message;
/* Check the user's ~/.nautilus direct... | 0 | [] | nautilus | 1e1c916f5537eb5e4144950f291f4a3962fc2395 | 136,308,332,993,044,700,000,000,000,000,000,000,000 | 86 | Add "interactive" argument to nautilus_file_mark_desktop_file_trusted.
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
* libnautilus-private/nautilus-file-operations.h:
* libnautilus-private/nautilus-mime-actions.c:
Add "interactive" ... |
slap_modrdn2mods(
Operation *op,
SlapReply *rs )
{
int a_cnt, d_cnt;
LDAPRDN old_rdn = NULL;
LDAPRDN new_rdn = NULL;
assert( !BER_BVISEMPTY( &op->oq_modrdn.rs_newrdn ) );
/* if requestDN is empty, silently reset deleteOldRDN */
if ( BER_BVISEMPTY( &op->o_req_dn ) ) op->orr_deleteoldrdn = 0;
if ( ldap_bv2... | 1 | [
"CWE-476"
] | openldap | 4c774220a752bf8e3284984890dc0931fe73165d | 98,924,267,316,692,140,000,000,000,000,000,000,000 | 162 | ITS#9370 check for equality rule on old_rdn
Just skip normalization if there's no equality rule. We accept
DNs without equality rules already. |
PJ_DEF(int) pj_scan_get_char( pj_scanner *scanner )
{
register char *s = scanner->curptr;
int chr;
if (s >= scanner->end || !*s) {
pj_scan_syntax_err(scanner);
return 0;
}
chr = *s;
++s;
scanner->curptr = s;
if (PJ_SCAN_CHECK_EOF(s) && PJ_SCAN_IS_PROBABLY_SPACE(*s) &&
scanner->... | 0 | [
"CWE-125"
] | pjproject | 077b465c33f0aec05a49cd2ca456f9a1b112e896 | 184,006,368,736,890,300,000,000,000,000,000,000,000 | 21 | Merge pull request from GHSA-7fw8-54cv-r7pm |
static int __init xen_blkif_init(void)
{
int rc = 0;
if (!xen_domain())
return -ENODEV;
if (xen_blkif_max_ring_order > XENBUS_MAX_RING_GRANT_ORDER) {
pr_info("Invalid max_ring_order (%d), will use default max: %d.\n",
xen_blkif_max_ring_order, XENBUS_MAX_RING_GRANT_ORDER);
xen_blkif_max_ring_order = XENBU... | 0 | [
"CWE-200"
] | linux | 089bc0143f489bd3a4578bdff5f4ca68fb26f341 | 326,995,858,249,293,300,000,000,000,000,000,000,000 | 27 | xen-blkback: don't leak stack data via response ring
Rather than constructing a local structure instance on the stack, fill
the fields directly on the shared ring, just like other backends do.
Build on the fact that all response structure flavors are actually
identical (the old code did make this assumption too).
Thi... |
bool HtmlOutputDev::dumpDocOutline(PDFDoc* doc)
{
FILE * output = nullptr;
bool bClose = false;
if (!ok)
return false;
Outline *outline = doc->getOutline();
if (!outline)
return false;
const std::vector<OutlineItem*> *outlines = outline->getItems();
if (!outlines)
return false;
if (... | 0 | [
"CWE-824"
] | poppler | 30c731b487190c02afff3f036736a392eb60cd9a | 225,647,474,995,486,180,000,000,000,000,000,000,000 | 68 | Properly initialize HtmlOutputDev::page to avoid SIGSEGV upon error exit.
Closes #742 |
static void netback_changed(struct xenbus_device *dev,
enum xenbus_state backend_state)
{
struct netfront_info *np = dev_get_drvdata(&dev->dev);
struct net_device *netdev = np->netdev;
dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state));
wake_up_all(&module_wq);
switch (backend_state) {
case Xenb... | 0 | [] | linux | f63c2c2032c2e3caad9add3b82cc6e91c376fd26 | 89,983,623,722,233,900,000,000,000,000,000,000,000 | 39 | xen-netfront: restore __skb_queue_tail() positioning in xennet_get_responses()
The commit referenced below moved the invocation past the "next" label,
without any explanation. In fact this allows misbehaving backends undue
control over the domain the frontend runs in, as earlier detected errors
require the skb to not ... |
R_API RList *r_bin_java_get_method_offsets(RBinJavaObj *bin) {
RBinJavaField *fm_type = NULL;
RList *the_list = r_list_new ();
RListIter *iter = NULL;
ut64 *paddr = NULL;
if (!bin) {
return the_list;
}
the_list->free = free;
r_list_foreach (bin->methods_list, iter, fm_type) {
paddr = R_NEW0 (ut64);
*paddr... | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 331,418,756,721,573,000,000,000,000,000,000,000,000 | 16 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
void rds_recv_incoming(struct rds_connection *conn, __be32 saddr, __be32 daddr,
struct rds_incoming *inc, gfp_t gfp)
{
struct rds_sock *rs = NULL;
struct sock *sk;
unsigned long flags;
inc->i_conn = conn;
inc->i_rx_jiffies = jiffies;
rdsdebug("conn %p next %llu inc %p seq %llu len %u sport %u dport %u ... | 0 | [
"CWE-200"
] | net | 4116def2337991b39919f3b448326e21c40e0dbb | 115,154,345,964,703,130,000,000,000,000,000,000,000 | 88 | rds: fix an infoleak in rds_inc_info_copy
The last field "flags" of object "minfo" is not initialized.
Copying this object out may leak kernel stack data.
Assign 0 to it to avoid leak.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller... |
static OPJ_BOOL opj_jp2_setup_end_header_reading(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager)
{
/* preconditions */
assert(jp2 != 00);
assert(p_manager != 00);
if (! opj_procedure_list_add_procedure(jp2->m_procedure_list,
(opj_procedure)opj_jp2_read_he... | 0 | [
"CWE-20"
] | openjpeg | 4edb8c83374f52cd6a8f2c7c875e8ffacccb5fa5 | 18,715,607,914,760,636,000,000,000,000,000,000,000 | 15 | Add support for generation of PLT markers in encoder
* -PLT switch added to opj_compress
* Add a opj_encoder_set_extra_options() function that
accepts a PLT=YES option, and could be expanded later
for other uses.
-------
Testing with a Sentinel2 10m band, T36JTT_20160914T074612_B02.jp2,
coming from S2A_MSIL1C_20... |
struct nfs_commit_data *nfs_commitdata_alloc(void)
{
struct nfs_commit_data *p = mempool_alloc(nfs_commit_mempool, GFP_NOIO);
if (p) {
memset(p, 0, sizeof(*p));
INIT_LIST_HEAD(&p->pages);
}
return p;
} | 0 | [] | linux | c7559663e42f4294ffe31fe159da6b6a66b35d61 | 276,143,229,661,947,600,000,000,000,000,000,000,000 | 10 | NFS: Allow nfs_updatepage to extend a write under additional circumstances
Currently nfs_updatepage allows a write to be extended to cover a full
page only if we don't have a byte range lock lock on the file... but if
we have a write delegation on the file or if we have the whole file
locked for writing then we should... |
static WORD_LIST *
call_expand_word_internal (w, q, i, c, e)
WORD_DESC *w;
int q, i, *c, *e;
{
WORD_LIST *result;
result = expand_word_internal (w, q, i, c, e);
if (result == &expand_word_error || result == &expand_word_fatal)
{
/* By convention, each time this error is returned, w->word has
... | 0 | [
"CWE-20"
] | bash | 4f747edc625815f449048579f6e65869914dd715 | 329,957,529,111,928,600,000,000,000,000,000,000,000 | 22 | Bash-4.4 patch 7 |
ieee802_15_4_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int hdrlen;
uint16_t fc;
uint8_t seq;
uint16_t panid = 0;
if (caplen < 3) {
ND_PRINT((ndo, "[|802.15.4]"));
return caplen;
}
hdrlen = 3;
fc = EXTRACT_LE_16BITS(... | 1 | [
"CWE-125",
"CWE-787"
] | tcpdump | 8512734883227c11568bb35da1d48b9f8466f43f | 108,251,335,796,461,920,000,000,000,000,000,000,000 | 159 | CVE-2017-13000/IEEE 802.15.4: Fix bug introduced two fixes prior.
We've already advanced the pointer past the PAN ID, if present; it now
points to the address, so don't add 2 to it.
This fixes a buffer over-read discovered by Forcepoint's security
researchers Otto Airamo & Antti Levomäki.
Add a test using the captur... |
callbacks_get_selected_row_index (void)
{
GtkTreeSelection *selection;
GtkTreeIter iter;
GtkListStore *list_store = (GtkListStore *) gtk_tree_view_get_model
((GtkTreeView *) screen.win.layerTree);
gint index=-1,i=0;
/* This will only work in single or browse selection mode! */
selection = gtk_tree_view_... | 0 | [
"CWE-200"
] | gerbv | 319a8af890e4d0a5c38e6d08f510da8eefc42537 | 310,998,524,776,849,640,000,000,000,000,000,000,000 | 21 | Remove local alias to parameter array
Normalizing access to `gerbv_simplified_amacro_t::parameter` as a step to fix CVE-2021-40402 |
static void test_fetch_nobuffs()
{
MYSQL_STMT *stmt;
MYSQL_BIND my_bind[4];
char str[4][50];
int rc;
myheader("test_fetch_nobuffs");
stmt= mysql_simple_prepare(mysql, "SELECT DATABASE(), CURRENT_USER(), \
CURRENT_DATE(), CURRENT_TIME()");
check_stmt(stmt);
r... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 339,072,578,823,362,230,000,000,000,000,000,000,000 | 57 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
gnutls_x509_crt_list_import2(gnutls_x509_crt_t ** certs,
unsigned int *size,
const gnutls_datum_t * data,
gnutls_x509_crt_fmt_t format,
unsigned int flags)
{
unsigned int init = 1024;
int ret;
*certs = gnutls_malloc(sizeof(gnutls_x509_crt_t) * init);
if (*certs == NULL) {
gnutls_a... | 0 | [
"CWE-295"
] | gnutls | 6e76e9b9fa845b76b0b9a45f05f4b54a052578ff | 324,757,879,642,229,020,000,000,000,000,000,000,000 | 41 | on certificate import check whether the two signature algorithms match |
S_ssc_finalize(pTHX_ RExC_state_t *pRExC_state, regnode_ssc *ssc)
{
/* The inversion list in the SSC is marked mortal; now we need a more
* permanent copy, which is stored the same way that is done in a regular
* ANYOF node, with the first NUM_ANYOF_CODE_POINTS code points in a bit
* map */
SV* ... | 0 | [
"CWE-125"
] | perl5 | 43b2f4ef399e2fd7240b4eeb0658686ad95f8e62 | 176,678,379,817,819,300,000,000,000,000,000,000,000 | 39 | regcomp.c: Convert some strchr to memchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information. |
int hugetlb_get_quota(struct address_space *mapping, long delta)
{
int ret = 0;
struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(mapping->host->i_sb);
if (sbinfo->free_blocks > -1) {
spin_lock(&sbinfo->stat_lock);
if (sbinfo->free_blocks - delta >= 0)
sbinfo->free_blocks -= delta;
else
ret = -ENOMEM;
s... | 1 | [
"CWE-399"
] | linux | 90481622d75715bfcb68501280a917dbfe516029 | 165,672,267,029,961,000,000,000,000,000,000,000,000 | 16 | hugepages: fix use after free bug in "quota" handling
hugetlbfs_{get,put}_quota() are badly named. They don't interact with the
general quota handling code, and they don't much resemble its behaviour.
Rather than being about maintaining limits on on-disk block usage by
particular users, they are instead about maintai... |
static void GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im)
{
int B;
int RWidth, RHeight;
int LeftOfs, TopOfs;
int Resolution;
int ColorMapSize;
int InitCodeSize;
int i;
GifCtx ctx;
memset(&ctx... | 0 | [
"CWE-415"
] | libgd | 553702980ae89c83f2d6e254d62cf82e204956d0 | 259,166,464,731,265,200,000,000,000,000,000,000,000 | 113 | Fix #492: Potential double-free in gdImage*Ptr()
Whenever `gdImage*Ptr()` calls `gdImage*Ctx()` and the latter fails, we
must not call `gdDPExtractData()`; otherwise a double-free would
happen. Since `gdImage*Ctx()` are void functions, and we can't change
that for BC reasons, we're introducing static helpers which ar... |
cmsStage* CMSEXPORT cmsStageAllocCLut16bitGranular(cmsContext ContextID,
const cmsUInt32Number clutPoints[],
cmsUInt32Number inputChan,
cmsUInt32Number outputChan,
... | 1 | [] | Little-CMS | 5d98f40ed58f6e8eb9aee6dd2d9467bbc8551ee7 | 44,075,234,313,482,750,000,000,000,000,000,000,000 | 52 | Fixed some menor issues for 2.4 |
static void ok_jpg_generate_huffman_table_lookups(ok_jpg_huffman_table *huff, bool is_ac_table) {
// Look up table for codes that use N bits or less (most of them)
for (int q = 0; q < HUFFMAN_LOOKUP_SIZE; q++) {
huff->lookup_num_bits[q] = 0;
for (uint8_t i = 0; i < HUFFMAN_LOOKUP_SIZE_BITS; i++)... | 0 | [
"CWE-787"
] | ok-file-formats | a9cc1711dd4ed6a215038f1c5c03af0ef52c3211 | 181,501,137,022,103,400,000,000,000,000,000,000,000 | 49 | ok_jpg: Fix invalid DHT (#11) |
static void mtrr_lookup_next(struct mtrr_iter *iter)
{
if (iter->fixed)
mtrr_lookup_fixed_next(iter);
else
mtrr_lookup_var_next(iter);
} | 0 | [
"CWE-284"
] | linux | 9842df62004f366b9fed2423e24df10542ee0dc5 | 304,406,445,909,149,500,000,000,000,000,000,000,000 | 7 | KVM: MTRR: remove MSR 0x2f8
MSR 0x2f8 accessed the 124th Variable Range MTRR ever since MTRR support
was introduced by 9ba075a664df ("KVM: MTRR support").
0x2f8 became harmful when 910a6aae4e2e ("KVM: MTRR: exactly define the
size of variable MTRRs") shrinked the array of VR MTRRs from 256 to 8,
which made access to ... |
static int check_user_pass(ctrl_t *ctrl)
{
if (!ctrl->name[0])
return -1;
if (!strcmp("anonymous", ctrl->name))
return 1;
return 0;
} | 0 | [
"CWE-120",
"CWE-787"
] | uftpd | 0fb2c031ce0ace07cc19cd2cb2143c4b5a63c9dd | 93,552,693,333,275,420,000,000,000,000,000,000,000 | 10 | FTP: Fix buffer overflow in PORT parser, reported by Aaron Esau
Signed-off-by: Joachim Nilsson <troglobit@gmail.com> |
void skb_abort_seq_read(struct skb_seq_state *st)
{
if (st->frag_data)
kunmap_skb_frag(st->frag_data);
} | 0 | [] | linux | e89e9cf539a28df7d0eb1d0a545368e9920b34ac | 132,821,427,116,312,740,000,000,000,000,000,000,000 | 5 | [IPv4/IPv6]: UFO Scatter-gather approach
Attached is kernel patch for UDP Fragmentation Offload (UFO) feature.
1. This patch incorporate the review comments by Jeff Garzik.
2. Renamed USO as UFO (UDP Fragmentation Offload)
3. udp sendfile support with UFO
This patches uses scatter-gather feature of skb to generate l... |
void exit_mmap(struct mm_struct *mm)
{
struct mmu_gather tlb;
struct vm_area_struct *vma;
unsigned long nr_accounted = 0;
/* mm's last user has gone, and its about to be pulled down */
mmu_notifier_release(mm);
if (mm->locked_vm) {
vma = mm->mmap;
while (vma) {
if (vma->vm_flags & VM_LOCKED)
munlock_... | 1 | [
"CWE-476"
] | linux | 27ae357fa82be5ab73b2ef8d39dcb8ca2563483a | 141,544,773,978,631,740,000,000,000,000,000,000,000 | 62 | mm, oom: fix concurrent munlock and oom reaper unmap, v3
Since exit_mmap() is done without the protection of mm->mmap_sem, it is
possible for the oom reaper to concurrently operate on an mm until
MMF_OOM_SKIP is set.
This allows munlock_vma_pages_all() to concurrently run while the oom
reaper is operating on a vma. ... |
static void remove_translation_table(FlowSource_t *fs, exporter_ipfix_domain_t *exporter, uint16_t id) {
input_translation_t *table, *parent;
syslog(LOG_INFO, "Process_ipfix: [%u] Withdraw template id: %i",
exporter->info.id, id);
parent = NULL;
table = exporter->input_translation_table;
while ( table && ( ta... | 1 | [] | nfdump | ff0e855bd1f51bed9fc5d8559c64d3cfb475a5d8 | 285,933,219,564,491,280,000,000,000,000,000,000,000 | 39 | Fix security issues in netflow_v9.c and ipfix.c |
void execute_init_command(THD *thd, LEX_STRING *init_command,
mysql_rwlock_t *var_lock)
{
Vio* save_vio;
ulonglong save_client_capabilities;
mysql_rwlock_rdlock(var_lock);
if (!init_command->length)
{
mysql_rwlock_unlock(var_lock);
return;
}
/*
copy the value under ... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 105,168,513,657,641,300,000,000,000,000,000,000,000 | 37 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static void test_json_append_escaped_data(void)
{
static const unsigned char test_input[] =
"\b\f\r\n\t\"\\\000\001\002-\xC3\xA4\xf0\x90\x90\xb7";
string_t *str = t_str_new(32);
test_begin("json_append_escaped()");
json_append_escaped_data(str, test_input, sizeof(test_input)-1);
test_assert(strcmp(str_c(str), "... | 1 | [] | core | 973769d74433de3c56c4ffdf4f343cb35d98e4f7 | 240,045,088,701,042,530,000,000,000,000,000,000,000 | 11 | lib: json - Escape invalid UTF-8 as unicode bytes
This prevents dovecot from crashing if invalid UTF-8 input
is given. |
static int link_initialized_and_synced(sd_netlink *rtnl, sd_netlink_message *m,
void *userdata) {
_cleanup_link_unref_ Link *link = userdata;
Network *network;
int r;
assert(link);
assert(link->ifname);
assert(link->manager);
... | 0 | [
"CWE-120"
] | systemd | f5a8c43f39937d97c9ed75e3fe8621945b42b0db | 26,915,754,680,520,165,000,000,000,000,000,000,000 | 58 | networkd: IPv6 router discovery - follow IPv6AcceptRouterAdvertisemnt=
The previous behavior:
When DHCPv6 was enabled, router discover was performed first, and then DHCPv6 was
enabled only if the relevant flags were passed in the Router Advertisement message.
Moreover, router discovery was performed even if AcceptRout... |
uint get_errcode_from_name(char *error_name, char *error_end)
{
/* SQL error as string */
st_error *e= global_error_names;
DBUG_ENTER("get_errcode_from_name");
DBUG_PRINT("enter", ("error_name: %s", error_name));
/* Loop through the array of known error names */
for (; e->name; e++)
{
/*
If we... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 80,333,706,480,159,310,000,000,000,000,000,000,000 | 26 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
static void php_free_gd_image(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
gdImageDestroy((gdImagePtr) rsrc->ptr);
} | 0 | [
"CWE-703",
"CWE-189"
] | php-src | 2938329ce19cb8c4197dec146c3ec887c6f61d01 | 153,170,157,303,809,260,000,000,000,000,000,000,000 | 4 | Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
And also fixed the bug: arguments are altered after some calls |
static size_t send_control_msg(VirtIOSerial *vser, void *buf, size_t len)
{
VirtQueueElement elem;
VirtQueue *vq;
vq = vser->c_ivq;
if (!virtio_queue_ready(vq)) {
return 0;
}
if (!virtqueue_pop(vq, &elem)) {
return 0;
}
/* TODO: detect a buffer that's too short, set NEE... | 0 | [
"CWE-120",
"CWE-787"
] | qemu | 7882080388be5088e72c425b02223c02e6cb4295 | 179,752,260,130,633,400,000,000,000,000,000,000,000 | 20 | virtio-serial: fix ANY_LAYOUT
Don't assume a specific layout for control messages.
Required by virtio 1.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Jason Wang <jasowang@redhat.com> |
jpc_cstate_t *jpc_cstate_create()
{
jpc_cstate_t *cstate;
if (!(cstate = jas_malloc(sizeof(jpc_cstate_t)))) {
return 0;
}
cstate->numcomps = 0;
return cstate;
} | 0 | [] | jasper | 4031ca321d8cb5798c316ab39c7a5dc88a61fdd7 | 128,463,143,019,328,040,000,000,000,000,000,000,000 | 9 | Incorporated changes from patch
jasper-1.900.3-libjasper-stepsizes-overflow.patch |
inline Eigen::DSizes<int, 2> NByOne(int n) {
return Eigen::DSizes<int, 2>(n, 1);
} | 0 | [
"CWE-476",
"CWE-787"
] | tensorflow | 93f428fd1768df147171ed674fee1fc5ab8309ec | 309,941,126,370,168,700,000,000,000,000,000,000,000 | 3 | Fix nullptr deref and heap OOB access in binary cwise ops.
PiperOrigin-RevId: 387936777
Change-Id: I608b8074cec36a982cca622b7144cb2c43e6e19f |
sds sdsgrowzero(sds s, size_t len) {
size_t curlen = sdslen(s);
if (len <= curlen) return s;
s = sdsMakeRoomFor(s,len-curlen);
if (s == NULL) return NULL;
/* Make sure added region doesn't contain garbage */
memset(s+curlen,0,(len-curlen+1)); /* also set trailing \0 byte */
sdssetlen(s, le... | 0 | [
"CWE-190"
] | redis | d32f2e9999ce003bad0bd2c3bca29f64dcce4433 | 251,292,365,419,002,000,000,000,000,000,000,000,000 | 12 | Fix integer overflow (CVE-2021-21309). (#8522)
On 32-bit systems, setting the proto-max-bulk-len config parameter to a high value may result with integer overflow and a subsequent heap overflow when parsing an input bulk (CVE-2021-21309).
This fix has two parts:
Set a reasonable limit to the config parameter.
A... |
int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
{
if (group->meth->make_affine == 0) {
ECerr(EC_F_EC_POINT_MAKE_AFFINE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (!ec_point_is_compat(point, group)) {
ECerr(EC_F_EC_POINT_MAKE_AFFINE, EC_R_INCOMPA... | 0 | [] | openssl | 30c22fa8b1d840036b8e203585738df62a03cec8 | 312,537,216,443,190,940,000,000,000,000,000,000,000 | 12 | [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it
The cofactor argument to EC_GROUP_set_generator is optional, and SCA
mitigations for ECC currently use it. So the library currently falls
back to very old SCA-vulnerable code if the cofactor is not present.
This PR allows EC_GROUP_set_generator to ... |
static int sanity_check_int_value(struct snd_card *card,
const struct snd_ctl_elem_value *control,
const struct snd_ctl_elem_info *info,
int i, bool print_error)
{
long long lval, lmin, lmax, lstep;
u64 rem;
switch (info->type) {
default:
case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
lval = control->value... | 0 | [
"CWE-416",
"CWE-125"
] | linux | 6ab55ec0a938c7f943a4edba3d6514f775983887 | 971,413,356,956,686,700,000,000,000,000,000,000 | 60 | ALSA: control: Fix an out-of-bounds bug in get_ctl_id_hash()
Since the user can control the arguments provided to the kernel by the
ioctl() system call, an out-of-bounds bug occurs when the 'id->name'
provided by the user does not end with '\0'.
The following log can reveal it:
[ 10.002313] BUG: KASAN: stack-out-... |
int tls1_final_finish_mac(SSL *s,
const char *str, int slen, unsigned char *out)
{
unsigned int i;
EVP_MD_CTX ctx;
unsigned char buf[2*EVP_MAX_MD_SIZE];
unsigned char *q,buf2[12];
int idx;
long mask;
int err=0;
const EVP_MD *md;
q=buf;
if (s->s3->handshake_buffer)
if (!ssl3_digest_cached_records(... | 1 | [] | openssl | 0294b2be5f4c11e60620c0018674ff0e17b14238 | 26,070,744,355,786,520,000,000,000,000,000,000,000 | 53 | Check EVP errors for handshake digests.
Partial mitigation of PR#3200 |
static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
{
/* un-describe */
if (stmt->columns) {
int i;
struct pdo_column_data *cols = stmt->columns;
for (i = 0; i < stmt->column_count; i++) {
efree(cols[i].name);
}
efree(stmt->columns);
stmt->columns = NULL;
stmt->column_count = 0;
}
if ... | 0 | [
"CWE-476"
] | php-src | 6045de69c7dedcba3eadf7c4bba424b19c81d00d | 163,760,235,339,055,830,000,000,000,000,000,000,000 | 25 | Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
Proper soltion would be to call serialize/unserialize and deal with the result,
but this requires more work that should be done by wddx maintainer (not me). |
static void perf_swevent_start_hrtimer(struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
s64 period;
if (!is_sampling_event(event))
return;
period = local64_read(&hwc->period_left);
if (period) {
if (period < 0)
period = 10000;
local64_set(&hwc->period_left, 0);
} else {
period = m... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8176cced706b5e5d15887584150764894e94e02f | 43,058,227,905,137,440,000,000,000,000,000,000,000 | 21 | perf: Treat attr.config as u64 in perf_swevent_init()
Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().
Introduced in commit b0a873ebb ("perf: Register PMU
implementations").
Signed... |
void ldbLogSourceLine(int lnum) {
char *line = ldbGetSourceLine(lnum);
char *prefix;
int bp = ldbIsBreakpoint(lnum);
int current = ldb.currentline == lnum;
if (current && bp)
prefix = "->#";
else if (current)
prefix = "-> ";
else if (bp)
prefix = " #";
else
... | 0 | [
"CWE-703",
"CWE-125"
] | redis | 6ac3c0b7abd35f37201ed2d6298ecef4ea1ae1dd | 124,902,395,199,830,240,000,000,000,000,000,000,000 | 17 | Fix protocol parsing on 'ldbReplParseCommand' (CVE-2021-32672)
The protocol parsing on 'ldbReplParseCommand' (LUA debugging)
Assumed protocol correctness. This means that if the following
is given:
*1
$100
test
The parser will try to read additional 94 unallocated bytes after
the client buffer.
This commit fixes this ... |
bool JBIG2Stream::readSymbolDictSeg(unsigned int segNum, unsigned int length, unsigned int *refSegs, unsigned int nRefSegs)
{
std::unique_ptr<JBIG2SymbolDict> symbolDict;
const JBIG2HuffmanTable *huffDHTable, *huffDWTable;
const JBIG2HuffmanTable *huffBMSizeTable, *huffAggInstTable;
JBIG2Segment *seg;
... | 0 | [
"CWE-476",
"CWE-190"
] | poppler | 27354e9d9696ee2bc063910a6c9a6b27c5184a52 | 68,362,592,719,100,150,000,000,000,000,000,000,000 | 436 | JBIG2Stream: Fix crash on broken file
https://github.com/jeffssh/CVE-2021-30860
Thanks to David Warren for the heads up |
static int shmem_getpage(struct inode *inode, unsigned long idx,
struct page **pagep, enum sgp_type sgp, int *type)
{
struct address_space *mapping = inode->i_mapping;
struct shmem_inode_info *info = SHMEM_I(inode);
struct shmem_sb_info *sbinfo;
struct page *filepage = *pagep;
struct page *swappage;
swp_entry_... | 1 | [
"CWE-200"
] | linux-2.6 | e84e2e132c9c66d8498e7710d4ea532d1feaaac5 | 337,224,798,820,921,130,000,000,000,000,000,000,000 | 221 | tmpfs: restore missing clear_highpage
tmpfs was misconverted to __GFP_ZERO in 2.6.11. There's an unusual case in
which shmem_getpage receives the page from its caller instead of allocating.
We must cover this case by clear_highpage before SetPageUptodate, as before.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Sig... |
static void test_bug42373()
{
int rc;
MYSQL con;
MYSQL_STMT *stmt;
DBUG_ENTER("test_bug42373");
myheader("test_42373");
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
myquery(rc);
rc= mysql_query(mysql, "CREATE PROCEDURE p1()"
" BEGIN"
" SEL... | 0 | [
"CWE-416"
] | server | eef21014898d61e77890359d6546d4985d829ef6 | 247,922,637,536,102,000,000,000,000,000,000,000,000 | 75 | MDEV-11933 Wrong usage of linked list in mysql_prune_stmt_list
mysql_prune_stmt_list() was walking the list following
element->next pointers, but inside the loop it was invoking
list_add(element) that modified element->next. So, mysql_prune_stmt_list()
failed to visit and reset all elements, and some of them were left... |
static int sd_format_disk_name(char *prefix, int index, char *buf, int buflen)
{
const int base = 'z' - 'a' + 1;
char *begin = buf + strlen(prefix);
char *end = buf + buflen;
char *p;
int unit;
p = end - 1;
*p = '\0';
unit = base;
do {
if (p == begin)
return -EINVAL;
*--p = 'a' + (index % unit);
inde... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 0bfc96cb77224736dfa35c3c555d37b3646ef35e | 323,352,674,342,519,600,000,000,000,000,000,000,000 | 23 | block: fail SCSI passthrough ioctls on partition devices
Linux allows executing the SG_IO ioctl on a partition or LVM volume, and
will pass the command to the underlying block device. This is
well-known, but it is also a large security problem when (via Unix
permissions, ACLs, SELinux or a combination thereof) a prog... |
void PackLinuxElf32::updateLoader(OutputFile * /*fo*/)
{
unsigned start = linker->getSymbolOffset("_start");
unsigned vbase = get_te32(&elfout.phdr[C_TEXT].p_vaddr);
set_te32(&elfout.ehdr.e_entry, start + sz_pack2 + vbase);
} | 0 | [
"CWE-476",
"CWE-415"
] | upx | 90279abdfcd235172eab99651043051188938dcc | 266,635,919,378,015,650,000,000,000,000,000,000,000 | 6 | PackLinuxElf::canUnpack must checkEhdr() for ELF input
https://github.com/upx/upx/issues/485
modified: p_lx_elf.cpp |
void rpm_sysfs_remove(struct device *dev)
{
sysfs_unmerge_group(&dev->kobj, &pm_runtime_attr_group);
} | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 149,728,805,752,409,810,000,000,000,000,000,000,000 | 4 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
xmlParseElementChildrenContentDeclPriv(xmlParserCtxtPtr ctxt, int inputchk,
int depth) {
xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
const xmlChar *elem;
xmlChar type = 0;
if (((depth > 128) && ((ctxt->options & XML_PARSE_HUGE) == 0)) ||
... | 0 | [
"CWE-125"
] | libxml2 | 77404b8b69bc122d12231807abf1a837d121b551 | 306,168,545,409,280,630,000,000,000,000,000,000,000 | 264 | Make sure the parser returns when getting a Stop order
patch backported from chromiun bug fixes, assuming author is Chris |
best_name (char *const *name, int const *ignore)
{
enum nametype i;
int components[3];
int components_min = INT_MAX;
size_t basename_len[3];
size_t basename_len_min = SIZE_MAX;
size_t len[3];
size_t len_min = SIZE_MAX;
for (i = OLD; i <= INDEX; i++)
if (name[i] && !ignore[i])
{
/* Take the... | 0 | [
"CWE-59"
] | patch | 44a987e02f04b9d81a0db4a611145cad1093a2d3 | 335,161,332,480,336,430,000,000,000,000,000,000,000 | 43 | Add line number overflow checking
* bootstrap.conf: use intprops module.
* src/common.h: Define LINENUM_MIN and LINENUM_MAX macros.
* src/pch.c (another_hunk): Add line number overflow checking. Based on Robert
C. Seacord's INT32-C document for integer overflow checking and Tobias
Stoeckmann's "integer overflows and ... |
bool CZNC::UpdateModule(const CString& sModule) {
CModule* pModule;
map<CUser*, CString> musLoaded;
map<CIRCNetwork*, CString> mnsLoaded;
// Unload the module for every user and network
for (const auto& it : m_msUsers) {
CUser* pUser = it.second;
pModule = pUser->GetModules().Find... | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 8,337,625,731,466,455,000,000,000,000,000,000,000 | 84 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
Mat_WriteCompressedEmptyVariable5(mat_t *mat,const char *name,int rank,
size_t *dims,z_streamp z)
{
mat_uint32_t array_flags;
int array_flags_type = MAT_T_UINT32, dims_array_type = MAT_T_INT32;
int array_flags_size = 8;
int i, err;
size_t nBytes, empty_matrix_max_bu... | 0 | [
"CWE-190",
"CWE-401"
] | matio | 5fa49ef9fc4368fe3d19b5fdaa36d8fa5e7f4606 | 216,555,867,068,776,740,000,000,000,000,000,000,000 | 118 | Fix integer addition overflow
As reported by https://github.com/tbeu/matio/issues/121 |
void controller::write_item(std::shared_ptr<rss_item> item, const std::string& filename) {
std::fstream f;
f.open(filename.c_str(),std::fstream::out);
if (!f.is_open())
throw exception(errno);
write_item(item, f);
} | 0 | [
"CWE-943",
"CWE-787"
] | newsbeuter | 96e9506ae9e252c548665152d1b8968297128307 | 220,350,889,662,962,900,000,000,000,000,000,000,000 | 8 | Sanitize inputs to bookmark-cmd (#591)
Newsbeuter didn't properly shell-escape the arguments passed to
bookmarking command, which allows a remote attacker to perform remote
code execution by crafting an RSS item whose title and/or URL contain
something interpretable by the shell (most notably subshell
invocations.)
T... |
xmlXPathNodeSetCreateSize(int size) {
xmlNodeSetPtr ret;
ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
if (ret == NULL) {
xmlXPathErrMemory(NULL, "creating nodeset\n");
return(NULL);
}
memset(ret, 0 , (size_t) sizeof(xmlNodeSet));
if (size < XML_NODESET_DEFAULT)
size = XML_NODE... | 0 | [
"CWE-119"
] | libxml2 | 91d19754d46acd4a639a8b9e31f50f31c78f8c9c | 194,774,840,064,872,860,000,000,000,000,000,000,000 | 21 | Fix the semantic of XPath axis for namespace/attribute context nodes
The processing of namespace and attributes nodes was not compliant
to the XPath-1.0 specification |
const CImg<T>& back() const {
return *(_data + _width - 1);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 67,795,036,699,991,000,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
addSess(ptcplstn_t *pLstn, int sock, prop_t *peerName, prop_t *peerIP)
{
DEFiRet;
ptcpsess_t *pSess = NULL;
ptcpsrv_t *pSrv = pLstn->pSrv;
int pmsg_size_factor;
CHKmalloc(pSess = malloc(sizeof(ptcpsess_t)));
pSess->next = NULL;
if(pLstn->pSrv->inst->startRegex == NULL) {
pmsg_size_factor = 1;
pSess->pMsg_sa... | 0 | [
"CWE-787"
] | rsyslog | 89955b0bcb1ff105e1374aad7e0e993faa6a038f | 95,706,106,995,535,630,000,000,000,000,000,000,000 | 66 | net bugfix: potential buffer overrun |
static void gf_filter_parse_args(GF_Filter *filter, const char *args, GF_FilterArgType arg_type, Bool for_script)
{
u32 i=0;
char szSecName[200];
char szEscape[7];
char szSrc[5], szDst[5];
Bool has_meta_args = GF_FALSE;
const GF_FilterArgs *f_args = NULL;
if (!filter) return;
if (!for_script) {
if (!filter->... | 0 | [
"CWE-787"
] | gpac | da37ec8582266983d0ec4b7550ec907401ec441e | 69,685,615,348,320,010,000,000,000,000,000,000,000 | 72 | fixed crashes for very long path - cf #1908 |
MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__jpeg_image_load;
module->begin_load = gdk_pixbuf__jpeg_image_begin_load;
module->stop_load = gdk_pixbuf__jpeg_image_stop_load;
module->load_increment = gdk_pixbuf__jpeg_image_load_increment;
module->save = gdk_pixbuf__jpeg_image_save... | 0 | [
"CWE-787"
] | gdk-pixbuf | c2a40a92fe3df4111ed9da51fe3368c079b86926 | 334,258,237,251,558,640,000,000,000,000,000,000,000 | 10 | jpeg: Throw error when number of color components is unsupported
Explicitly check "3" or "4" output color components.
gdk-pixbuf assumed that the value of output_components to be either
3 or 4, but not an invalid value (9) or an unsupported value (1).
The way the buffer size was deduced was using a naive "== 4" chec... |
static struct page *linear_to_page(struct page *page, unsigned int *len,
unsigned int *offset,
struct sock *sk)
{
struct page_frag *pfrag = sk_page_frag(sk);
if (!sk_page_frag_refill(sk, pfrag))
return NULL;
*len = min_t(unsigned int, *len, pfrag->size - pfrag->offset);
memcpy(page_address(pfrag-... | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 221,242,716,443,029,030,000,000,000,000,000,000,000 | 18 | core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the caller... |
static void row_dim_delete(zval *object, zval *offset TSRMLS_DC)
{
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a PDORow"); | 0 | [
"CWE-476"
] | php-src | 6045de69c7dedcba3eadf7c4bba424b19c81d00d | 50,022,217,375,606,460,000,000,000,000,000,000,000 | 4 | Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
Proper soltion would be to call serialize/unserialize and deal with the result,
but this requires more work that should be done by wddx maintainer (not me). |
void stco_del(GF_Box *s)
{
GF_ChunkOffsetBox *ptr = (GF_ChunkOffsetBox *)s;
if (ptr == NULL) return;
if (ptr->offsets) gf_free(ptr->offsets);
gf_free(ptr);
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 238,976,245,116,608,020,000,000,000,000,000,000,000 | 7 | prevent dref memleak on invalid input (#1183) |
static int cap_file_set_fowner(struct file *file)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 289,563,780,507,314,000,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
{
struct net_device *dev;
struct bnep_session *s, *ss;
u8 dst[ETH_ALEN], src[ETH_ALEN];
int err;
BT_DBG("");
baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);
/* session struct... | 1 | [
"CWE-20",
"CWE-284"
] | linux | 71bb99a02b32b4cc4265118e85f6035ca72923f0 | 252,311,578,201,598,440,000,000,000,000,000,000,000 | 82 | Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket
same story as cmtp
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
void cli_icongroupset_add(const char *groupname, icon_groupset *set, unsigned int type, cli_ctx *ctx) {
struct icon_matcher *matcher;
unsigned int i, j;
if(type>1 || !ctx || !ctx->engine || !(matcher = ctx->engine->iconcheck) || !matcher->group_counts[type])
return;
j = matcher->group_counts[type];
... | 0 | [
"CWE-189"
] | clamav-devel | 3cbd8b5668bd0f262a8c00b1fd57eb03c117b00a | 38,854,884,175,643,300,000,000,000,000,000,000,000 | 24 | libclamav/pe_icons.c: introduce LOGPARSEICONDETAILS define to reduce parseicon logging in default build |
Macho_Binary_t** macho_parse(const char *file) {
FatBinary* fat = Parser::parse(file).release();
size_t nb_bin = fat->size();
auto** c_macho_binaries = static_cast<Macho_Binary_t**>(
malloc((fat->size() + 1) * sizeof(Macho_Binary_t**)));
for (size_t i = 0; i < nb_bin; ++i) {
Binary* binary = fat->ta... | 0 | [
"CWE-787"
] | LIEF | 0033b6312fd311b2e45e379c04a83d77c1e58578 | 286,066,633,750,241,380,000,000,000,000,000,000,000 | 20 | Resolve #767 |
static void kvm_timer_init(void)
{
int cpu;
max_tsc_khz = tsc_khz;
register_hotcpu_notifier(&kvmclock_cpu_notifier_block);
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
#ifdef CONFIG_CPU_FREQ
struct cpufreq_policy policy;
memset(&policy, 0, sizeof(policy));
cpu = get_cpu();
cpufreq_get_policy(&policy, cpu... | 0 | [] | kvm | 0769c5de24621141c953fbe1f943582d37cb4244 | 141,892,820,798,614,870,000,000,000,000,000,000,000 | 23 | KVM: x86: extend "struct x86_emulate_ops" with "get_cpuid"
In order to be able to proceed checks on CPU-specific properties
within the emulator, function "get_cpuid" is introduced.
With "get_cpuid" it is possible to virtually call the guests
"cpuid"-opcode without changing the VM's context.
[mtosatti: cleanup/beautif... |
int main()
{
gdImagePtr im;
void *data;
int size = 0;
im = gdImageCreate(100, 100);
gdTestAssert(im != NULL);
data = gdImagePngPtr(im, &size);
gdTestAssert(data == NULL);
gdImageDestroy(im);
return gdNumFailures();
} | 0 | [
"CWE-415"
] | libgd | 56ce6ef068b954ad28379e83cca04feefc51320c | 204,602,565,788,657,500,000,000,000,000,000,000,000 | 16 | Fix #381: libgd double-free vulnerability
The issue is that `gdImagePngCtxEx` (which is called by `gdImagePngPtr`
and the other PNG output functions to do the real work) does not return
whether it succeeded or failed, so this is not checked in
`gdImagePngPtr` and the function wrongly assumes everything is okay,
which ... |
expand(struct archive_read *a, int64_t end)
{
static const unsigned char lengthbases[] =
{ 0, 1, 2, 3, 4, 5, 6,
7, 8, 10, 12, 14, 16, 20,
24, 28, 32, 40, 48, 56, 64,
80, 96, 112, 128, 160, 192, 224 };
static const unsigned char lengthbits[] =
{ 0, 0, 0, 0, 0... | 0 | [
"CWE-119",
"CWE-787"
] | libarchive | 05caadc7eedbef471ac9610809ba683f0c698700 | 267,412,227,975,387,830,000,000,000,000,000,000,000 | 226 | Issue 719: Fix for TALOS-CAN-154
A RAR file with an invalid zero dictionary size was not being
rejected, leading to a zero-sized allocation for the dictionary
storage which was then overwritten during the dictionary initialization.
Thanks to the Open Source and Threat Intelligence project at Cisco for
reporting this... |
bool ProtocolV1::is_connected() {
return can_write.load() == WriteStatus::CANWRITE;
} | 0 | [
"CWE-294"
] | ceph | 6c14c2fb5650426285428dfe6ca1597e5ea1d07d | 23,046,163,266,788,796,000,000,000,000,000,000,000 | 3 | mon/MonClient: bring back CEPHX_V2 authorizer challenges
Commit c58c5754dfd2 ("msg/async/ProtocolV1: use AuthServer and
AuthClient") introduced a backwards compatibility issue into msgr1.
To fix it, commit 321548010578 ("mon/MonClient: skip CEPHX_V2
challenge if client doesn't support it") set out to skip authorizer
c... |
static int do_read_fault(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
int ret = 0;
/*
* Let's call ->map_pages() first and use ->fault() as fallback
* if page by the offset is not ready to be mapped (cold cache or
* something).
*/
if (vma->vm_ops->map_pages && fault_around_bytes >> PAGE_S... | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 61,183,270,204,423,310,000,000,000,000,000,000,000 | 26 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
int ldb_msg_add_value(struct ldb_message *msg,
const char *attr_name,
const struct ldb_val *val,
struct ldb_message_element **return_el)
{
struct ldb_message_element *el;
int ret;
el = ldb_msg_find_element(msg, attr_name);
if (!el) {
ret = ldb_msg_add_empty(msg, attr_name, 0, &el);
if (... | 0 | [
"CWE-200"
] | samba | a2bb5beee82fd9c4c29decc07024057febeaf1b5 | 185,354,622,206,094,240,000,000,000,000,000,000,000 | 27 | CVE-2022-32746 ldb: Ensure shallow copy modifications do not affect original message
Using the newly added ldb flag, we can now detect when a message has
been shallow-copied so that its elements share their values with the
original message elements. Then when adding values to the copied
message, we now make a copy of ... |
static int poll_action_name_to_id(const char *name, size_t namesz)
{
int id = -1;
if (strncasecmp(name, "move", namesz) == 0 && namesz == 4)
id = MNT_TABDIFF_MOVE;
else if (strncasecmp(name, "mount", namesz) == 0 && namesz == 5)
id = MNT_TABDIFF_MOUNT;
else if (strncasecmp(name, "umount", namesz) == 0 && names... | 0 | [
"CWE-552",
"CWE-703"
] | util-linux | 166e87368ae88bf31112a30e078cceae637f4cdb | 132,084,049,063,885,300,000,000,000,000,000,000,000 | 17 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount to... |
static void move_back(compiler_common *common, jump_list **backtracks, BOOL must_be_valid)
{
/* Goes one character back. Affects STR_PTR and TMP1. If must_be_valid is TRUE,
TMP2 is not used. Otherwise TMP2 must contain the start of the subject buffer,
and it is destroyed. Does not modify STR_PTR for invalid character s... | 0 | [
"CWE-125"
] | pcre2 | 50a51cb7e67268e6ad417eb07c9de9bfea5cc55a | 130,451,376,165,842,210,000,000,000,000,000,000,000 | 86 | Fixed a unicode properrty matching issue in JIT |
png_set_sBIT(png_const_structrp png_ptr, png_inforp info_ptr,
png_const_color_8p sig_bit)
{
png_debug1(1, "in %s storage function", "sBIT");
if (png_ptr == NULL || info_ptr == NULL || sig_bit == NULL)
return;
info_ptr->sig_bit = *sig_bit;
info_ptr->valid |= PNG_INFO_sBIT;
} | 0 | [
"CWE-120"
] | libpng | a901eb3ce6087e0afeef988247f1a1aa208cb54d | 142,339,061,585,622,760,000,000,000,000,000,000,000 | 11 | [libpng16] Prevent reading over-length PLTE chunk (Cosmin Truta). |
QPDF_Stream::getDict() const
{
return this->stream_dict;
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 306,799,944,395,374,800,000,000,000,000,000,000,000 | 4 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
CImg<T>& rotate(const float angle, const unsigned int interpolation=1,
const unsigned int boundary_conditions=0) {
const float nangle = cimg::mod(angle,360.f);
if (nangle==0.f) return *this;
return get_rotate(nangle,interpolation,boundary_conditions).move_to(*this);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 318,252,358,564,504,500,000,000,000,000,000,000,000 | 6 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
int llhttp__on_url_complete(llhttp_t* s, const char* p, const char* endp) {
int err;
CALLBACK_MAYBE(s, on_url_complete);
return err;
} | 0 | [
"CWE-444"
] | node | af488f8dc82d69847992ea1cd2f53dc8082b3b91 | 274,267,362,995,425,600,000,000,000,000,000,000,000 | 5 | deps: update llhttp to 6.0.4
Refs: https://hackerone.com/reports/1238099
Refs: https://hackerone.com/reports/1238709
Refs: https://github.com/nodejs-private/llhttp-private/pull/6
Refs: https://github.com/nodejs-private/llhttp-private/pull/5
CVE-ID: CVE-2021-22959
CVE-ID: CVE-2021-22960
PR-URL: https://github.com/node... |
RecordFindClientOnContext(RecordContextPtr pContext,
XID clientspec, int *pposition)
{
RecordClientsAndProtocolPtr pRCAP;
for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP) {
int i;
for (i = 0; i < pRCAP->numClients; i++) {
if (pRCAP->pCl... | 0 | [
"CWE-191"
] | xserver | 2902b78535ecc6821cc027351818b28a5c7fdbdc | 270,396,251,550,962,350,000,000,000,000,000,000,000 | 18 | Fix XRecordRegisterClients() Integer underflow
CVE-2020-14362 ZDI-CAN-11574
This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> |
static void perf_event_exit_cpu_context(int cpu)
{
struct perf_event_context *ctx;
struct pmu *pmu;
int idx;
idx = srcu_read_lock(&pmus_srcu);
list_for_each_entry_rcu(pmu, &pmus, entry) {
ctx = &per_cpu_ptr(pmu->pmu_cpu_context, cpu)->ctx;
mutex_lock(&ctx->mutex);
smp_call_function_single(cpu, __perf_event... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8176cced706b5e5d15887584150764894e94e02f | 272,223,862,006,372,170,000,000,000,000,000,000,000 | 16 | perf: Treat attr.config as u64 in perf_swevent_init()
Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().
Introduced in commit b0a873ebb ("perf: Register PMU
implementations").
Signed... |
void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sContext, int & UpperEltFound, EbmlElement * & FoundElt, bool AllowDummyElt, ScopeMode ReadFully)
{
if (ReadFully == SCOPE_NO_DATA)
return;
EbmlElement * ElementLevelA;
// remove all existing elements, including the mandatory ones..... | 0 | [
"CWE-703"
] | libebml | 88409e2a94dd3b40ff81d08bf6d92f486d036b24 | 19,796,853,357,842,760,000,000,000,000,000,000,000 | 115 | EbmlMaster: propagate upper level element after infinite sized one correctly
When the parser encountered a deeply nested element with an infinite
size then a following element of an upper level was not propagated
correctly. Instead the element with the infinite size was added into the
EBML element tree a second time r... |
Item_result result_type () const
{
return type_handler()->result_type();
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 91,867,073,371,373,710,000,000,000,000,000,000,000 | 4 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
mt_new(mrb_state *mrb)
{
mt_tbl *t;
t = (mt_tbl*)mrb_malloc(mrb, sizeof(mt_tbl));
t->size = 0;
t->alloc = 0;
t->table = NULL;
return t;
} | 0 | [
"CWE-476",
"CWE-190"
] | mruby | f5e10c5a79a17939af763b1dcf5232ce47e24a34 | 15,262,612,009,271,964,000,000,000,000,000,000,000 | 11 | proc.c: add `mrb_state` argument to `mrb_proc_copy()`.
The function may invoke the garbage collection and it requires
`mrb_state` to run. |
static int show_log(WriterContext *w, int section_ids, int section_id, int log_level)
{
int i;
pthread_mutex_lock(&log_mutex);
if (!log_buffer_size) {
pthread_mutex_unlock(&log_mutex);
return 0;
}
writer_print_section_header(w, section_ids);
for (i=0; i<log_buffer_size; i++) {
... | 0 | [
"CWE-476"
] | FFmpeg | 837cb4325b712ff1aab531bf41668933f61d75d2 | 22,023,459,638,883,967,000,000,000,000,000,000,000 | 34 | ffprobe: Fix null pointer dereference with color primaries
Found-by: AD-lab of venustech
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
void CLASS phase_one_load_raw_c()
{
static const int length[] = { 8,7,6,9,11,10,5,12,14,13 };
int *offset, len[2], pred[2], row, col, i, j;
ushort *pixel;
short (*c_black)[2], (*r_black)[2];
#ifdef LIBRAW_LIBRARY_BUILD
if(ph1.format == 6)
throw LIBRAW_EXCEPTION_IO_CORRUPT;
#endif
pixel = (ushort *) cal... | 0 | [
"CWE-129"
] | LibRaw | 89d065424f09b788f443734d44857289489ca9e2 | 251,209,687,564,409,150,000,000,000,000,000,000,000 | 87 | fixed two more problems found by fuzzer |
int init_dumping_views(char *qdatabase MY_ATTRIBUTE((unused)))
{
return 0;
} /* init_dumping_views */ | 0 | [
"CWE-319"
] | mysql-server | 0002e1380d5f8c113b6bce91f2cf3f75136fd7c7 | 22,689,030,194,706,620,000,000,000,000,000,000,000 | 4 | BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING SSL CONNECTION
MYSQL_OPT_SSL_MODE option introduced.
It is set in case of --ssl-mode=REQUIRED and permits only SSL connection.
(cherry picked from commit f91b941842d240b8a62645e507f5554e8be76aec) |
static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident)
{
struct hlist_nulls_head *hslot = ping_hashslot(&ping_table, net, ident);
struct sock *sk = NULL;
struct inet_sock *isk;
struct hlist_nulls_node *hnode;
int dif = skb->dev->ifindex;
if (skb->protocol == htons(ETH_P_IP)) {
pr_debu... | 0 | [
"CWE-703"
] | linux | a134f083e79fb4c3d0a925691e732c56911b4326 | 314,532,630,052,594,780,000,000,000,000,000,000,000 | 67 | ipv4: Missing sk_nulls_node_init() in ping_unhash().
If we don't do that, then the poison value is left in the ->pprev
backlink.
This can cause crashes if we do a disconnect, followed by a connect().
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Wen Xu <hotdog3645@gmail.com>
Signed-off-by: D... |
static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
{
zval ztmp;
int ret = SUCCESS;
if (Z_TYPE_P(newval) != IS_LONG) {
ztmp = *newval;
zval_copy_ctor(&ztmp);
convert_to_long(&ztmp);
newval = &ztmp;
}
switch(Z_LVAL_P(newval)) {
case NETSNMP_OID_OUTPUT_SUFFIX... | 1 | [
"CWE-416"
] | php-src | cab1c3b3708eead315e033359d07049b23b147a3 | 323,425,880,239,979,100,000,000,000,000,000,000,000 | 31 | Fixed bug #72479 - same as #72434 |
static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
u32 val, ktime_t *abs_time, u32 bitset,
u32 __user *uaddr2)
{
struct hrtimer_sleeper timeout, *to = NULL;
struct futex_pi_state *pi_state = NULL;
struct rt_mutex_waiter rt_waiter;
struct futex_hash_bucket *hb;
union futex_key key2 = ... | 0 | [
"CWE-416"
] | linux | 48fb6f4db940e92cfb16cd878cddd59ea6120d06 | 326,571,070,555,940,800,000,000,000,000,000,000,000 | 169 | futex: Remove unnecessary warning from get_futex_key
Commit 65d8fc777f6d ("futex: Remove requirement for lock_page() in
get_futex_key()") removed an unnecessary lock_page() with the
side-effect that page->mapping needed to be treated very carefully.
Two defensive warnings were added in case any assumption was missed ... |
dns_zone_getrequestixfr(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (zone->requestixfr);
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 94,500,619,665,997,810,000,000,000,000,000,000,000 | 4 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
rsvg_state_reinit (RsvgState * state)
{
RsvgState *parent = state->parent;
rsvg_state_finalize (state);
rsvg_state_init (state);
state->parent = parent;
} | 0 | [
"CWE-20"
] | librsvg | d1c9191949747f6dcfd207831d15dd4ba00e31f2 | 292,524,597,006,855,250,000,000,000,000,000,000,000 | 7 | state: Store mask as reference
Instead of immediately looking up the mask, store the reference and look
it up on use. |
_g_str_eat_spaces (const char *line)
{
if (line == NULL)
return NULL;
while ((*line == ' ') && (*line != 0))
line++;
return line;
} | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 191,146,932,722,439,730,000,000,000,000,000,000,000 | 8 | libarchive: sanitize filenames before extracting |
rb_str_intern(s)
VALUE s;
{
volatile VALUE str = s;
ID id;
if (!RSTRING(str)->ptr || RSTRING(str)->len == 0) {
rb_raise(rb_eArgError, "interning empty string");
}
if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len)
rb_raise(rb_eArgError, "symbol string may not contain `\\0'");
if (OBJ_TAI... | 0 | [
"CWE-20"
] | ruby | e926ef5233cc9f1035d3d51068abe9df8b5429da | 292,513,763,152,971,230,000,000,000,000,000,000,000 | 17 | * random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
* string.c (rb_str_tmp_new), intern.h: New function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
static void __ip_vs_del_service(struct ip_vs_service *svc)
{
struct ip_vs_dest *dest, *nxt;
struct ip_vs_scheduler *old_sched;
/* Count only IPv4 services for old get/setsockopt interface */
if (svc->af == AF_INET)
ip_vs_num_services--;
ip_vs_kill_estimator(&svc->stats);
/* Unbind scheduler */
old_sched = s... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 04bcef2a83f40c6db24222b27a52892cba39dffb | 225,617,719,500,187,470,000,000,000,000,000,000,000 | 48 | ipvs: Add boundary check on ioctl arguments
The ipvs code has a nifty system for doing the size of ioctl command
copies; it defines an array with values into which it indexes the cmd
to find the right length.
Unfortunately, the ipvs code forgot to check if the cmd was in the
range that the array provides, allowing fo... |
static unsigned int multi_tx_empty(struct sb_uart_port *port)
{
struct mp_port *mtpt = (struct mp_port *)port;
unsigned long flags;
unsigned int ret;
spin_lock_irqsave(&mtpt->port.lock, flags);
ret = serial_in(mtpt, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
spin_unlock_irqrestore(&mtpt->port.lock, flags);
... | 0 | [
"CWE-200"
] | linux | a8b33654b1e3b0c74d4a1fed041c9aae50b3c427 | 337,194,720,329,819,500,000,000,000,000,000,000,000 | 12 | Staging: sb105x: info leak in mp_get_count()
The icount.reserved[] array isn't initialized so it leaks stack
information to userspace.
Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Li... |
int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting, int drvflags)
{
struct cdc_ncm_ctx *ctx;
struct usb_driver *driver;
u8 *buf;
int len;
int temp;
u8 iface_no;
struct usb_cdc_parsed_header hdr;
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
hrti... | 0 | [
"CWE-703"
] | linux | 4d06dd537f95683aba3651098ae288b7cbff8274 | 165,777,781,683,685,250,000,000,000,000,000,000,000 | 154 | cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind
usbnet_link_change will call schedule_work and should be
avoided if bind is failing. Otherwise we will end up with
scheduled work referring to a netdev which has gone away.
Instead of making the call conditional, we can just defer
it to usbnet_probe, using the... |
static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
{
struct sockaddr_llc *uaddr = (struct sockaddr_llc *)msg->msg_name;
const int nonblock = flags & MSG_DONTWAIT;
struct sk_buff *skb = NULL;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk... | 0 | [
"CWE-200"
] | linux-2.6 | 28e9fc592cb8c7a43e4d3147b38be6032a0e81bc | 130,562,314,383,448,920,000,000,000,000,000,000,000 | 152 | NET: llc, zero sockaddr_llc struct
sllc_arphrd member of sockaddr_llc might not be changed. Zero sllc
before copying to the above layer's structure.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
SPL_METHOD(SplObjectStorage, key)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_LONG(intern->index);
} /* }}} */ | 0 | [
"CWE-119",
"CWE-787"
] | php-src | 61cdd1255d5b9c8453be71aacbbf682796ac77d4 | 263,226,830,115,737,960,000,000,000,000,000,000,000 | 10 | Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key |
void HTTPSession::onError(HTTPCodec::StreamID streamID,
const HTTPException& error, bool newTxn) {
DestructorGuard dg(this);
// The codec detected an error in the ingress stream, possibly bad
// syntax, a truncated message, or bad semantics in the frame. If reads
// are paused, queue ... | 0 | [
"CWE-20"
] | proxygen | 0600ebe59c3e82cd012def77ca9ca1918da74a71 | 206,369,138,256,575,440,000,000,000,000,000,000,000 | 63 | Check that a secondary auth manager is set before dereferencing.
Summary: CVE-2018-6343
Reviewed By: mingtaoy
Differential Revision: D12994423
fbshipit-source-id: 9229ec11da8085f1fa153595e8e5353e19d06fb7 |
int platform_device_register(struct platform_device *pdev)
{
device_initialize(&pdev->dev);
arch_setup_pdev_archdata(pdev);
return platform_device_add(pdev);
} | 0 | [
"CWE-362",
"CWE-284"
] | linux | 6265539776a0810b7ce6398c27866ddb9c6bd154 | 338,644,918,162,166,270,000,000,000,000,000,000,000 | 6 | driver core: platform: fix race condition with driver_override
The driver_override implementation is susceptible to race condition when
different threads are reading vs storing a different driver override.
Add locking to avoid race condition.
Fixes: 3d713e0e382e ("driver core: platform: add device binding path 'drive... |
msg_start(void)
{
int did_return = FALSE;
if (!msg_silent)
VIM_CLEAR(keep_msg);
#ifdef FEAT_EVAL
if (need_clr_eos)
{
// Halfway an ":echo" command and getting an (error) message: clear
// any text from the command.
need_clr_eos = FALSE;
msg_clr_eos();
}
#endif
if (!msg_scroll && full_sc... | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 207,478,675,501,330,750,000,000,000,000,000,000,000 | 45 | 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. |
static int samldb_rodc_add(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
uint32_t krbtgt_number, i_start, i;
int ret;
struct ldb_val newpass_utf16;
/* find a unused msDS-SecondaryKrbTgtNumber */
i_start = generate_random() & 0xFFFF;
if (i_start == 0) {
i_start = 1;
}
fo... | 1 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 202,150,202,285,615,070,000,000,000,000,000,000,000 | 68 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.