func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
TEST(IndexBoundsBuilderTest, TranslateGtCode) {
auto testIndex = buildSimpleIndexEntry();
BSONObj obj = BSON("a" << BSON("$gt" << BSONCode("function(){ return 0; }")));
auto expr = parseMatchExpression(obj);
BSONElement elt = obj.firstElement();
OrderedIntervalList oil;
IndexBoundsBuilder::Bound... | 0 | [
"CWE-754"
] | mongo | f8f55e1825ee5c7bdb3208fc7c5b54321d172732 | 295,678,627,276,081,300,000,000,000,000,000,000,000 | 15 | SERVER-44377 generate correct plan for indexed inequalities to null |
query_info_compare(void* m1, void* m2)
{
struct query_info* msg1 = (struct query_info*)m1;
struct query_info* msg2 = (struct query_info*)m2;
int mc;
/* from most different to least different for speed */
COMPARE_IT(msg1->qtype, msg2->qtype);
if((mc = query_dname_compare(msg1->qname, msg2->qname)) != 0)
return m... | 0 | [
"CWE-787"
] | unbound | 6c3a0b54ed8ace93d5b5ca7b8078dc87e75cd640 | 82,026,300,058,976,840,000,000,000,000,000,000,000 | 14 | - Fix Out of Bound Write Compressed Names in rdata_copy(),
reported by X41 D-Sec. |
gx_default_cmyk_decode_color(
gx_device * dev,
gx_color_index color,
gx_color_value cv[4] )
{
/* The device may have been determined to be 'separable'. */
if (colors_are_separable_and_linear(&dev->color_info))
return gx_default_decode_color(dev, color, cv);
else {
int i, co... | 0 | [] | ghostpdl | c9b362ba908ca4b1d7c72663a33229588012d7d9 | 176,695,869,986,942,970,000,000,000,000,000,000,000 | 23 | Bug 699670: disallow copying of the epo device
The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.
Add an epo_finish_copydevice which NULLs the three offending poin... |
static inline void v4l2l_get_timestamp(struct v4l2_buffer *b) {
/* ktime_get_ts is considered deprecated, so use ktime_get_ts64 if possible */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
struct timespec ts;
ktime_get_ts(&ts);
#else
struct timespec64 ts;
ktime_get_ts64(&ts);
#endif
b->timestamp.tv_sec = ts.... | 0 | [
"CWE-787"
] | v4l2loopback | 64a216af4c09c9ba9326057d7e78994271827eff | 116,415,507,067,574,460,000,000,000,000,000,000,000 | 13 | add explicit format specifier to printf() invocations
CWE-134 |
process_next_cpt_value(
ins_compl_next_state_T *st,
int *compl_type_arg,
pos_T *start_match_pos)
{
int compl_type = -1;
int status = INS_COMPL_CPT_OK;
st->found_all = FALSE;
while (*st->e_cpt == ',' || *st->e_cpt == ' ')
st->e_cpt++;
if (*st->e_cpt == '.' && !curbuf->b_scanned)
... | 0 | [
"CWE-416"
] | vim | 0ff01835a40f549c5c4a550502f62a2ac9ac447c | 208,734,963,631,586,250,000,000,000,000,000,000,000 | 115 | patch 9.0.0579: using freed memory when 'tagfunc' wipes out buffer
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid. |
next_packet (unsigned char const **bufptr, size_t *buflen,
unsigned char const **r_data, size_t *r_datalen, int *r_pkttype,
size_t *r_ntotal)
{
const unsigned char *buf = *bufptr;
size_t len = *buflen;
int c, ctb, pkttype;
unsigned long pktlen;
if (!len)
return gpg_error (GPG_ER... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 71,831,822,553,729,520,000,000,000,000,000,000,000 | 102 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
static i64 seekcur_fdout(rzip_control *control)
{
if (!TMP_OUTBUF)
return lseek(control->fd_out, 0, SEEK_CUR);
return (control->out_relofs + control->out_ofs);
} | 0 | [
"CWE-703"
] | lrzip | 4b3942103b57c639c8e0f31d6d5fd7bac53bbdf4 | 146,321,677,920,341,900,000,000,000,000,000,000,000 | 6 | Fix possible race condition between zpaq_decompress_buf() and clear_rulist() function as reported by wcventure. |
rdp_out_order_caps(STREAM s)
{
uint8 order_caps[32];
memset(order_caps, 0, 32);
order_caps[0] = 1; /* dest blt */
order_caps[1] = 1; /* pat blt */
order_caps[2] = 1; /* screen blt */
order_caps[3] = (g_bitmap_cache ? 1 : 0); /* memblt */
order_caps[4] = 0; /* triblt */
order_caps[8] = 1; /* line */
order_caps... | 0 | [
"CWE-787"
] | rdesktop | 766ebcf6f23ccfe8323ac10242ae6e127d4505d2 | 115,767,369,746,318,700,000,000,000,000,000,000,000 | 39 | Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulnerabilities in
rdesktop when a malicious RDP server is used.
All vulnerabilities was identified and reported by Eyal Itkin.
* Add rdp_protocol_error function that is used in several fixes
* Refactor of process_bitmap_updates
* Fix pos... |
get_zmbuf(struct vhost_virtqueue *vq)
{
uint16_t i;
uint16_t last;
int tries = 0;
/* search [last_zmbuf_idx, zmbuf_size) */
i = vq->last_zmbuf_idx;
last = vq->zmbuf_size;
again:
for (; i < last; i++) {
if (vq->zmbufs[i].in_use == 0) {
vq->last_zmbuf_idx = i + 1;
vq->zmbufs[i].in_use = 1;
return &vq-... | 0 | [
"CWE-665"
] | dpdk | 97ecc1c85c95c13bc66a87435758e93406c35c48 | 139,384,680,541,948,250,000,000,000,000,000,000,000 | 29 | vhost: fix translated address not checked
Malicious guest can construct desc with invalid address and zero buffer
length. That will request vhost to check both translated address and
translated data length. This patch will add missed address check.
CVE-2020-10725
Fixes: 75ed51697820 ("vhost: add packed ring batch deq... |
cmsBool AddMLUBlock(cmsMLU* mlu, cmsUInt32Number size, const wchar_t *Block,
cmsUInt16Number LanguageCode, cmsUInt16Number CountryCode)
{
cmsUInt32Number Offset;
cmsUInt8Number* Ptr;
// Sanity check
if (mlu == NULL) return FALSE;
// Is there any room available?
if (mlu ->U... | 0 | [] | Little-CMS | 886e2f524268efe8a1c3aa838c28e446fda24486 | 85,810,097,163,881,940,000,000,000,000,000,000,000 | 40 | Fixes from coverity check |
NOEXPORT void win_log(LPCTSTR txt) {
struct LIST *curr;
size_t txt_len;
static size_t log_len=0;
txt_len=_tcslen(txt);
curr=str_alloc_detached(sizeof(struct LIST)+txt_len*sizeof(TCHAR));
curr->len=txt_len;
_tcscpy(curr->txt, txt);
curr->next=NULL;
/* this critical section is perfor... | 0 | [
"CWE-295"
] | stunnel | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | 75,047,986,078,828,640,000,000,000,000,000,000,000 | 31 | stunnel-5.57 |
static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_ev_conn_complete *ev = (void *) skb->data;
struct inquiry_entry *ie;
struct hci_conn *conn;
BT_DBG("%s", hdev->name);
hci_dev_lock(hdev);
conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
if (!conn) {
/... | 0 | [
"CWE-290"
] | linux | 3ca44c16b0dcc764b641ee4ac226909f5c421aa3 | 131,765,125,059,125,150,000,000,000,000,000,000,000 | 109 | Bluetooth: Consolidate encryption handling in hci_encrypt_cfm
This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection
state is BT_CONFIG so callers don't have to check the state.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
void sdma_ahg_free(struct sdma_engine *sde, int ahg_index)
{
if (!sde)
return;
trace_hfi1_ahg_deallocate(sde, ahg_index);
if (ahg_index < 0 || ahg_index > 31)
return;
clear_bit(ahg_index, &sde->ahg_bits);
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | 34b3be18a04ecdc610aae4c48e5d1b799d8689f6 | 198,830,293,072,986,330,000,000,000,000,000,000,000 | 9 | RDMA/hfi1: Prevent memory leak in sdma_init
In sdma_init if rhashtable_init fails the allocated memory for
tmp_sdma_rht should be released.
Fixes: 5a52a7acf7e2 ("IB/hfi1: NULL pointer dereference when freeing rhashtable")
Link: https://lore.kernel.org/r/20190925144543.10141-1-navid.emamdoost@gmail.com
Signed-off-by: ... |
Bool gf_opus_parse_header(GF_OpusParser *opus, u8 *data, u32 data_len)
{
char tag[9];
GF_BitStream *bs = gf_bs_new(data, data_len, GF_BITSTREAM_READ);
gf_bs_read_data(bs, tag, 8);
tag[8]=0;
if (memcmp(data, "OpusHead", sizeof(char)*8)) {
gf_bs_del(bs);
return GF_FALSE;
}
/*Identification Header*/
opus->ver... | 0 | [
"CWE-190",
"CWE-787"
] | gpac | 51cdb67ff7c5f1242ac58c5aa603ceaf1793b788 | 31,895,025,489,748,200,000,000,000,000,000,000,000 | 31 | add safety in avc/hevc/vvc sps/pps/vps ID check - cf #1720 #1721 #1722 |
static int imap_tags_commit(struct Context *ctx, struct Header *hdr, char *buf)
{
struct Buffer *cmd = NULL;
char uid[11];
struct ImapData *idata = ctx->data;
if (*buf == '\0')
buf = NULL;
if (!mutt_bit_isset(idata->ctx->rights, MUTT_ACL_WRITE))
return 0;
snprintf(uid, sizeof(uid), "%u", HEADER_... | 0 | [
"CWE-78",
"CWE-77"
] | neomutt | 95e80bf9ff10f68cb6443f760b85df4117cb15eb | 327,187,860,895,288,060,000,000,000,000,000,000,000 | 76 | Quote path in imap_subscribe |
static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
void *frame, struct net_device *dev, void *data, int tp_len,
__be16 proto, unsigned char *addr, int hlen, int copylen,
const struct sockcm_cookie *sockc)
{
union tpacket_uhdr ph;
int to_write, offset, len, nr_frags, len_max;
struct socket... | 0 | [
"CWE-119",
"CWE-787"
] | linux | edbd58be15a957f6a760c4a514cd475217eb97fd | 117,956,059,503,708,500,000,000,000,000,000,000,000 | 80 | packet: Don't write vnet header beyond end of buffer
... which may happen with certain values of tp_reserve and maclen.
Fixes: 58d19b19cd99 ("packet: vnet_hdr support for tpacket_rcv")
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Willem de Bruijn <willemb@goo... |
static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode)
{
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
iconv_t cd = (iconv_t)(-1), cd_pl = (iconv_t)(-1);
const char *p1;
size_t str_left;
unsigned int scan_stat = 0;
c... | 1 | [
"CWE-125"
] | php-src | 70523ce41ff400ea00343a03f297332cb1f1b77b | 180,898,520,077,366,680,000,000,000,000,000,000,000 | 549 | Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
(cherry picked from commit 7cf7148a8f8f4f55fb04de2a517d740bb6253eac) |
static inline int sem_lock(struct sem_array *sma, struct sembuf *sops,
int nsops)
{
int locknum;
again:
if (nsops == 1 && !sma->complex_count) {
struct sem *sem = sma->sem_base + sops->sem_num;
/* Lock just the semaphore we are interested in. */
spin_lock(&sem->lock);
/*
* If sma->complex_count... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 6062a8dc0517bce23e3c2f7d2fea5e22411269a3 | 92,437,351,060,152,160,000,000,000,000,000,000,000 | 50 | ipc,sem: fine grained locking for semtimedop
Introduce finer grained locking for semtimedop, to handle the common case
of a program wanting to manipulate one semaphore from an array with
multiple semaphores.
If the call is a semop manipulating just one semaphore in an array with
multiple semaphores, only take the loc... |
void PngImage::writeMetadata()
{
if (io_->open() != 0) {
throw Error(kerDataSourceOpenFailed, io_->path(), strError());
}
IoCloser closer(*io_);
BasicIo::UniquePtr tempIo(new MemIo);
assert(tempIo.get() != 0);
doWriteMetadata(*tempIo); // may throw
... | 0 | [
"CWE-190"
] | exiv2 | 491c3ebe3b3faa6d8f75fb28146186792c2439da | 183,356,677,243,106,430,000,000,000,000,000,000,000 | 14 | Avoid negative integer overflow when `iccOffset > chunkLength`.
This fixes #790.
(cherry picked from commit 6fa2e31206127bd8bcac0269311f3775a8d6ea21) |
//! Save image as a sub-image into an existing .cimg file \overloading.
const CImg<T>& save_cimg(std::FILE *const file,
const unsigned int n0,
const unsigned int x0, const unsigned int y0,
const unsigned int z0, const unsigned int c0) const {
CImgList<T>(*this,true).save_cimg(file,... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 38,140,404,763,014,920,000,000,000,000,000,000,000 | 7 | Fix other issues in 'CImg<T>::load_bmp()'. |
vte_sequence_handler_screen_alignment_test (VteTerminal *terminal, GValueArray *params)
{
long row;
VteRowData *rowdata;
VteScreen *screen;
VteCell cell;
screen = terminal->pvt->screen;
for (row = terminal->pvt->screen->insert_delta;
row < terminal->pvt->screen->insert_delta + terminal->row_count;
r... | 0 | [] | vte | 8b971a7b2c59902914ecbbc3915c45dd21530a91 | 160,448,306,784,363,500,000,000,000,000,000,000,000 | 34 | Fix terminal title reporting
Fixed CVE-2003-0070 again.
See also http://marc.info/?l=bugtraq&m=104612710031920&w=2 .
(cherry picked from commit 6042c75b5a6daa0e499e61c8e07242d890d38ff1) |
PolicyParseException(rapidjson::ParseResult&& pr)
: pr(pr) { } | 0 | [
"CWE-617"
] | ceph | b3118cabb8060a8cc6a01c4e8264cb18e7b1745a | 46,667,695,783,923,040,000,000,000,000,000,000,000 | 2 | rgw: Remove assertions in IAM Policy
A couple of them could be triggered by user input.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com> |
static ssize_t status_show(struct device *dev,
struct device_attribute *attr, char *out)
{
char *s = out;
int pdev_nr;
out += sprintf(out,
"hub port sta spd dev socket local_busid\n");
pdev_nr = status_name_to_id(attr->attr.name);
if (pdev_nr < 0)
out += status_show_not_ready(pdev... | 0 | [
"CWE-200"
] | linux | 2f2d0088eb93db5c649d2a5e34a3800a8a935fc5 | 27,966,582,594,237,590,000,000,000,000,000,000,000 | 17 | usbip: prevent vhci_hcd driver from leaking a socket pointer address
When a client has a USB device attached over IP, the vhci_hcd driver is
locally leaking a socket pointer address via the
/sys/devices/platform/vhci_hcd/status file (world-readable) and in debug
output when "usbip --debug port" is run.
Fix it to not... |
setBaseURL(instanceData *pData, es_str_t **url)
{
char portBuf[64];
int r;
DEFiRet;
*url = es_newStr(128);
snprintf(portBuf, sizeof(portBuf), "%d", pData->port);
r = es_addBuf(url, "http://", sizeof("http://")-1);
if(r == 0) r = es_addBuf(url, (char*)pData->server, strlen((char*)pData->server));
if(r == 0) r =... | 0 | [
"CWE-399"
] | rsyslog | 80f88242982c9c6ad6ce8628fc5b94ea74051cf4 | 170,685,328,390,568,980,000,000,000,000,000,000,000 | 15 | bugfix: double-free in omelasticsearch
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=461
Thanks to Marius Ionescu for providing a detailled bug report |
inline void TransposeConv(const float* input_data, const Dims<4>& input_dims,
const float* filter_data, const Dims<4>& filter_dims,
int stride_width, int stride_height, int pad_width,
int pad_height, float* output_data,
... | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 233,320,326,984,904,800,000,000,000,000,000,000,000 | 18 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
int _libssh2_transport_send(LIBSSH2_SESSION *session,
const unsigned char *data, size_t data_len,
const unsigned char *data2, size_t data2_len)
{
int blocksize =
(session->state & LIBSSH2_STATE_NEWKEYS) ?
session->local.crypt->blocksize : 8;
... | 0 | [
"CWE-787"
] | libssh2 | dc109a7f518757741590bb993c0c8412928ccec2 | 10,454,402,877,076,280,000,000,000,000,000,000,000 | 213 | Security fixes (#315)
* Bounds checks
Fixes for CVEs
https://www.libssh2.org/CVE-2019-3863.html
https://www.libssh2.org/CVE-2019-3856.html
* Packet length bounds check
CVE
https://www.libssh2.org/CVE-2019-3855.html
* Response length check
CVE
https://www.libssh2.org/CVE-2019-3859.html
* Bounds ch... |
do_exedit(
exarg_T *eap,
win_T *old_curwin) // curwin before doing a split or NULL
{
int n;
int need_hide;
int exmode_was = exmode_active;
if ((eap->cmdidx != CMD_pedit && ERROR_IF_POPUP_WINDOW)
|| ERROR_IF_TERM_POPUP_WINDOW)
return;
/*
* ":vi" command ends Ex mode.
... | 0 | [
"CWE-416"
] | vim | e031fe90cf2e375ce861ff5e5e281e4ad229ebb9 | 243,607,807,955,892,670,000,000,000,000,000,000,000 | 169 | patch 8.2.3741: using freed memory in open command
Problem: Using freed memory in open command.
Solution: Make a copy of the current line. |
TEST_F(QueryPlannerTest, IntersectSortFromAndHash) {
params.options = QueryPlannerParams::NO_TABLE_SCAN | QueryPlannerParams::INDEX_INTERSECTION;
addIndex(BSON("a" << 1));
addIndex(BSON("b" << 1));
runQuerySortProj(fromjson("{a: 1, b:{$gt: 1}}"), fromjson("{b:1}"), BSONObj());
// This provides the ... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 28,696,748,727,592,540,000,000,000,000,000,000,000 | 19 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
bool RemoveControlInput(NodeDef* node, const string& control_input_to_remove,
NodeMap* node_map) {
for (int pos = node->input_size() - 1; pos >= 0; --pos) {
const string& input = node->input(pos);
if (input[0] != '^') break;
if (input == control_input_to_remove) {
node->mutab... | 0 | [
"CWE-476"
] | tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | 80,445,113,311,466,340,000,000,000,000,000,000,000 | 14 | Handle a special grappler case resulting in crash.
It might happen that a malformed input could be used to trick Grappler into trying to optimize a node with no inputs. This, in turn, would produce a null pointer dereference and a segfault.
PiperOrigin-RevId: 369242852
Change-Id: I2e5cbe7aec243d34a6d60220ac8ac9b16f13... |
static void emulator_set_idt(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt)
{
kvm_x86_ops->set_idt(emul_to_vcpu(ctxt), dt);
} | 0 | [] | kvm | 0769c5de24621141c953fbe1f943582d37cb4244 | 298,860,625,850,850,630,000,000,000,000,000,000,000 | 4 | 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... |
static int nonpaging_sync_page(struct kvm_vcpu *vcpu,
struct kvm_mmu_page *sp)
{
return -1;
} | 0 | [
"CWE-476"
] | linux | 9f46c187e2e680ecd9de7983e4d081c3391acc76 | 69,263,542,557,187,610,000,000,000,000,000,000,000 | 5 | KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
With shadow paging enabled, the INVPCID instruction results in a call
to kvm_mmu_invpcid_gva. If INVPCID is executed with CR0.PG=0, the
invlpg callback is not set and the result is a NULL pointer dereference.
Fix it trivially by checking for mmu->invlpg befo... |
int wc_Ed448PrivateKeyToDer(ed448_key* key, byte* output, word32 inLen)
{
return wc_BuildEd448KeyDer(key, output, inLen, 0);
} | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 263,890,577,287,307,180,000,000,000,000,000,000,000 | 4 | OCSP: improve handling of OCSP no check extension |
TEST(BSONValidate, RandomData) {
PseudoRandom r(17);
int numValid = 0;
int numToRun = 1000;
long long jsonSize = 0;
for ( int i=0; i<numToRun; i++ ) {
int size = 1234;
char* x = new char[size];
int* xx = reinterpret_... | 1 | [
"CWE-20"
] | mongo | 6889d1658136c753998b4a408dc8d1a3ec28e3b9 | 37,185,774,658,262,866,000,000,000,000,000,000,000 | 36 | SERVER-7769 - fast bson validate |
static __inline__ unsigned hash_dst(u32 *dst, u8 protocol, u8 tunnelid)
{
unsigned h = dst[RSVP_DST_LEN-1];
h ^= h>>16;
h ^= h>>8;
return (h ^ protocol ^ tunnelid) & 0xFF;
} | 0 | [
"CWE-200"
] | linux-2.6 | 8a47077a0b5aa2649751c46e7a27884e6686ccbf | 330,348,935,688,063,180,000,000,000,000,000,000,000 | 7 | [NETLINK]: Missing padding fields in dumped structures
Plug holes with padding fields and initialized them to zero.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
qf_set_cwindow_options(void)
{
// switch off 'swapfile'
set_option_value_give_err((char_u *)"swf", 0L, NULL, OPT_LOCAL);
set_option_value_give_err((char_u *)"bt",
0L, (char_u *)"quickfix", OPT_LOCAL);
set_option_value_give_err((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL);
RESET_BINDING(cu... | 0 | [
"CWE-416"
] | vim | 4f1b083be43f351bc107541e7b0c9655a5d2c0bb | 317,946,894,252,712,400,000,000,000,000,000,000,000 | 16 | patch 9.0.0322: crash when no errors and 'quickfixtextfunc' is set
Problem: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any. |
WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
const char *option,const char *arg1n,const char *arg2n)
{
const char /* percent escaped versions of the args */
*arg1,
*arg2;
Image
*new_images;
MagickStatusType
status;
ssize_t
parse;
#define _image_info (... | 0 | [
"CWE-399",
"CWE-401"
] | ImageMagick | ce08a3691a8ac29125e29fc41967b3737fa3f425 | 23,845,984,895,030,457,000,000,000,000,000,000,000 | 893 | https://github.com/ImageMagick/ImageMagick/issues/1604 |
int in_gate_area_no_task(unsigned long addr)
{
#ifdef AT_SYSINFO_EHDR
if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END))
return 1;
#endif
return 0;
} | 0 | [
"CWE-20"
] | linux-2.6 | 89f5b7da2a6bad2e84670422ab8192382a5aeb9f | 201,638,251,468,372,180,000,000,000,000,000,000,000 | 8 | Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP
KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") removed
the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
generally now populate the VM with real emp... |
static void fn_send_intr(struct vc_data *vc)
{
tty_insert_flip_char(&vc->port, 0, TTY_BREAK);
tty_schedule_flip(&vc->port);
} | 0 | [
"CWE-416"
] | linux | 6ca03f90527e499dd5e32d6522909e2ad390896b | 307,497,098,203,710,260,000,000,000,000,000,000,000 | 5 | vt: keyboard, simplify vt_kdgkbsent
Use 'strlen' of the string, add one for NUL terminator and simply do
'copy_to_user' instead of the explicit 'for' loop. This makes the
KDGKBSENT case more compact.
The only thing we need to take care about is NULL 'func_table[i]'. Use
an empty string in that case.
The original che... |
nvmet_fc_rcv_fcp_req(struct nvmet_fc_target_port *target_port,
struct nvmefc_tgt_fcp_req *fcpreq,
void *cmdiubuf, u32 cmdiubuf_len)
{
struct nvmet_fc_tgtport *tgtport = targetport_to_tgtport(target_port);
struct nvme_fc_cmd_iu *cmdiu = cmdiubuf;
struct nvmet_fc_tgt_queue *queue;
struct nvmet_fc_fcp_iod *fod;
... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 0c319d3a144d4b8f1ea2047fd614d2149b68f889 | 96,957,007,560,402,850,000,000,000,000,000,000,000 | 85 | nvmet-fc: ensure target queue id within range.
When searching for queue id's ensure they are within the expected range.
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
virtual bool is_outer_field() const { DBUG_ASSERT(fixed); return FALSE; } | 0 | [] | mysql-server | f7316aa0c9a3909fc7498e7b95d5d3af044a7e21 | 278,328,552,176,488,200,000,000,000,000,000,000,000 | 1 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))
Backport of Bug#19143243 fix.
NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an a... |
static void save_same_name_hfinfo(gpointer data)
{
same_name_hfinfo = (header_field_info*)data;
} | 0 | [
"CWE-401"
] | wireshark | a9fc769d7bb4b491efb61c699d57c9f35269d871 | 324,369,783,332,760,530,000,000,000,000,000,000,000 | 4 | epan: Fix a memory leak.
Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032. |
int main(int argc, char **argv)
{
jas_image_t *image;
cmdopts_t *cmdopts;
jas_stream_t *in;
jas_stream_t *out;
jas_tmr_t dectmr;
jas_tmr_t enctmr;
double dectime;
double enctime;
int_fast16_t numcmpts;
int i;
/* Determine the base name of this command. */
if ((cmdname = strrchr(argv[0], '/'))) {
++cmdnam... | 1 | [
"CWE-119"
] | jasper | 65536647d380571d1a9a6c91fa03775fb5bbd256 | 332,148,609,621,238,360,000,000,000,000,000,000,000 | 153 | A new experimental memory allocator has been introduced. The allocator
is experimental in the sense that its API is not considered stable and
the allocator may change or disappear entirely in future versions of
the code. This new allocator tracks how much memory is being used by
jas_malloc and friends. A maximum upp... |
int pn_ssl_get_peer_hostname(pn_ssl_t *ssl0, char *hostname, size_t *bufsize)
{
pni_ssl_t *ssl = get_ssl_internal(ssl0);
if (!ssl) return -1;
if (!ssl->peer_hostname) {
*bufsize = 0;
if (hostname) *hostname = '\0';
return 0;
}
unsigned len = strlen(ssl->peer_hostname);
if (hostname) {
if (le... | 0 | [] | qpid-proton | 4aea0fd8502f5e9af7f22fd60645eeec07bce0b2 | 97,765,512,563,786,920,000,000,000,000,000,000,000 | 17 | PROTON-2014: [c] Ensure SSL mutual authentication
(cherry picked from commit 97c7733f07712665f3d08091c82c393e4c3adbf7) |
mrb_exec_irep(mrb_state *mrb, mrb_value self, struct RProc *p)
{
mrb_callinfo *ci = mrb->c->ci;
if (ci->cci == CINFO_NONE) {
return exec_irep(mrb, self, p);
}
else {
mrb_value ret;
if (MRB_PROC_CFUNC_P(p)) {
if (MRB_PROC_NOARG_P(p)) {
check_method_noarg(mrb, ci);
}
cipush(m... | 0 | [
"CWE-703",
"CWE-125"
] | mruby | a4d97934d51cb88954cc49161dc1d151f64afb6b | 150,356,856,346,039,220,000,000,000,000,000,000,000 | 26 | vm.c: check if target_class is NULL (when prepended). |
int wc_InitRsaKey(RsaKey* key, void* heap)
{
return wc_InitRsaKey_ex(key, heap, INVALID_DEVID);
} | 0 | [
"CWE-310",
"CWE-787"
] | wolfssl | fb2288c46dd4c864b78f00a47a364b96a09a5c0f | 46,321,356,894,619,820,000,000,000,000,000,000,000 | 4 | RSA-PSS: Handle edge case with encoding message to hash
When the key is small relative to the digest (1024-bit key, 64-byte
hash, 61-byte salt length), the internal message to hash is larger than
the output size.
Allocate a buffer for the message when this happens. |
GF_Err gf_isom_box_parse_ex(GF_Box **outBox, GF_BitStream *bs, u32 parent_type, Bool is_root_box, u64 parent_size)
{
u32 type, uuid_type, hdr_size, restore_type;
u64 size, start, comp_start, end;
char uuid[16];
GF_Err e;
GF_BitStream *uncomp_bs = NULL;
u8 *uncomp_data = NULL;
u32 compressed_size=0;
GF_Box *newB... | 0 | [
"CWE-476"
] | gpac | 37592ad86c6ca934d34740012213e467acc4a3b0 | 39,055,403,588,388,566,000,000,000,000,000,000,000 | 248 | fixed #2163 |
virtual Item *grouping_field_transformer_for_where(THD *thd, uchar *arg)
{ return this; } | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 331,035,693,368,227,070,000,000,000,000,000,000,000 | 2 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
global_notify_fifo_script(vector_t *strvec)
{
notify_fifo_script(strvec, "", &global_data->notify_fifo);
} | 0 | [
"CWE-200"
] | keepalived | c6247a9ef2c7b33244ab1d3aa5d629ec49f0a067 | 199,202,355,516,101,060,000,000,000,000,000,000,000 | 4 | Add command line and configuration option to set umask
Issue #1048 identified that files created by keepalived are created
with mode 0666. This commit changes the default to 0644, and also
allows the umask to be specified in the configuration or as a command
line option.
Signed-off-by: Quentin Armitage <quentin@armit... |
wl_array_add(struct wl_array *array, size_t size)
{
size_t alloc;
void *data, *p;
if (array->alloc > 0)
alloc = array->alloc;
else
alloc = 16;
while (alloc < array->size + size)
alloc *= 2;
if (array->alloc < alloc) {
if (array->alloc > 0)
data = realloc(array->data, alloc);
else
data = malloc(... | 0 | [] | wayland | b19488c7154b902354cb26a27f11415d7799b0b2 | 200,053,387,127,008,240,000,000,000,000,000,000,000 | 30 | util: Limit size of wl_map
Since server IDs are basically indistinguishable from really big client
IDs at many points in the source, it's theoretically possible to overflow
a map and either overflow server IDs into the client ID space, or grow
client IDs into the server ID space. This would currently take a massive
am... |
static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb, u32 mtu)
{
struct rt6_info *rt6 = (struct rt6_info *)dst;
dst_confirm(dst);
if (mtu < dst_mtu(dst) && rt6->rt6i_dst.plen == 128) {
struct net *net = dev_net(dst->dev);
rt6->rt6i_flags |= RTF_MODIFIED;
if (mt... | 0 | [
"CWE-17"
] | linux-stable | 9d289715eb5c252ae15bd547cb252ca547a3c4f2 | 82,096,211,975,627,580,000,000,000,000,000,000,000 | 17 | ipv6: stop sending PTB packets for MTU < 1280
Reduce the attack vector and stop generating IPv6 Fragment Header for
paths with an MTU smaller than the minimum required IPv6 MTU
size (1280 byte) - called atomic fragments.
See IETF I-D "Deprecating the Generation of IPv6 Atomic Fragments" [1]
for more information and h... |
void security_mac_salt_key(const BYTE* session_key_blob, const BYTE* client_random,
const BYTE* server_random, BYTE* output)
{
/* MacSaltKey = First128Bits(SessionKeyBlob) */
memcpy(output, session_key_blob, 16);
} | 0 | [
"CWE-476"
] | FreeRDP | 7d58aac24fe20ffaad7bd9b40c9ddf457c1b06e7 | 263,948,985,184,640,330,000,000,000,000,000,000,000 | 6 | security: add a NULL pointer check to fix a server crash. |
void negotiate(CLIENT *client) {
char zeros[300];
u64 size_host;
memset(zeros, 0, 290);
if (write(client->net, INIT_PASSWD, 8) < 0)
err("Negotiation failed: %m");
cliserv_magic = htonll(cliserv_magic);
if (write(client->net, &cliserv_magic, sizeof(cliserv_magic)) < 0)
err("Negotiation failed: %m");
size_hos... | 0 | [
"CWE-119"
] | nbd | 4ed24fe0d64c7cc9963c57b52cad1555ad7c6b60 | 299,234,879,029,562,600,000,000,000,000,000,000,000 | 16 | r134: CVE-2005-3534 |
AfpInfo *afpinfo_unpack(TALLOC_CTX *ctx, const void *data)
{
AfpInfo *ai = talloc_zero(ctx, AfpInfo);
if (ai == NULL) {
return NULL;
}
ai->afpi_Signature = RIVAL(data, 0);
ai->afpi_Version = RIVAL(data, 4);
ai->afpi_BackupTime = RIVAL(data, 12);
memcpy(ai->afpi_FinderInfo, (const char *)data + 16,
siz... | 0 | [
"CWE-787"
] | samba | 0e2b3fb982d1f53d111e10d9197ed2ec2e13712c | 322,020,611,515,480,700,000,000,000,000,000,000,000 | 21 | CVE-2021-44142: libadouble: harden parsing code
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14914
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org> |
int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol)
{
struct snd_ctl_elem_id id;
unsigned int idx;
int err = -EINVAL;
if (! kcontrol)
return err;
if (snd_BUG_ON(!card || !kcontrol->info))
goto error;
id = kcontrol->id;
down_write(&card->controls_rwsem);
if (snd_ctl_find_id(card, &id)) {
... | 1 | [
"CWE-416",
"CWE-415"
] | linux | fd9f26e4eca5d08a27d12c0933fceef76ed9663d | 320,174,769,789,961,530,000,000,000,000,000,000,000 | 41 | ALSA: control: Don't access controls outside of protected regions
A control that is visible on the card->controls list can be freed at any time.
This means we must not access any of its memory while not holding the
controls_rw_lock. Otherwise we risk a use after free access.
Signed-off-by: Lars-Peter Clausen <lars@me... |
static inline void mpeg4_encode_dc(PutBitContext *s, int level, int n)
{
#if 1
/* DC will overflow if level is outside the [-255,255] range. */
level += 256;
if (n < 4) {
/* luminance */
put_bits(s, uni_DCtab_lum_len[level], uni_DCtab_lum_bits[level]);
} else {
/* chrominance */
... | 0 | [
"CWE-20"
] | FFmpeg | 6bbef938839adc55e8e048bc9cc2e0fafe2064df | 268,552,533,158,738,000,000,000,000,000,000,000,000 | 40 | avcodec/mpeg4videoenc: Use 64 bit for times in mpeg4_encode_gop_header()
Fixes truncation
Fixes Assertion n <= 31 && value < (1U << n) failed at libavcodec/put_bits.h:169
Fixes: ffmpeg_crash_2.avi
Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart... |
static llparse_state_t llhttp__internal__run(
llhttp__internal_t* state,
const unsigned char* p,
const unsigned char* endp) {
int match;
switch ((llparse_state_t) (intptr_t) state->_current) {
case s_n_llhttp__internal__n_invoke_llhttp__after_message_complete:
s_n_llhttp__internal__n_invoke_llht... | 1 | [
"CWE-444"
] | node | da0fda0fe81d372e24c0cb11aec37534985708dd | 319,614,150,588,660,300,000,000,000,000,000,000,000 | 5,678 | http: stricter Transfer-Encoding and header separator parsing
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
PR-URL: #315
Backport-PR-URL: #327
CVE-ID: CVE-2022-3221... |
static int32_t ahci_dma_prepare_buf(IDEDMA *dma, int is_write)
{
AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
IDEState *s = &ad->port.ifs[0];
if (ahci_populate_sglist(ad, &s->sg, s->io_buffer_offset) == -1) {
DPRINTF(ad->port_no, "ahci_dma_prepare_buf failed.\n");
return -1;
}
... | 0 | [
"CWE-399"
] | qemu | 3251bdcf1c67427d964517053c3d185b46e618e8 | 223,371,965,855,669,550,000,000,000,000,000,000,000 | 14 | ide: Correct handling of malformed/short PRDTs
This impacts both BMDMA and AHCI HBA interfaces for IDE.
Currently, we confuse the difference between a PRDT having
"0 bytes" and a PRDT having "0 complete sectors."
When we receive an incomplete sector, inconsistent error checking
leads to an infinite loop wherein the c... |
MONGO_EXPORT int bson_append_regex( bson *b, const char *name, const char *pattern, const char *opts ) {
const int plen = strlen( pattern )+1;
const int olen = strlen( opts )+1;
if ( bson_append_estart( b, BSON_REGEX, name, plen + olen ) == BSON_ERROR )
return BSON_ERROR;
if ( bson_check_string(... | 1 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 286,092,247,857,024,780,000,000,000,000,000,000,000 | 11 | don't mix up int and size_t (first pass to fix that) |
static int sample_rate_idx (int rate)
{
if (92017 <= rate) return 0;
else if (75132 <= rate) return 1;
else if (55426 <= rate) return 2;
else if (46009 <= rate) return 3;
else if (37566 <= rate) return 4;
else if (27713 <= rate) return 5;
else if (23004 <= rate) return 6;
else if (1... | 0 | [
"CWE-703"
] | FFmpeg | 6e42ccb9dbc13836cd52cda594f819d17af9afa2 | 84,070,733,163,042,300,000,000,000,000,000,000,000 | 15 | avcodec/aacdec: Fix pulse position checks in decode_pulses()
Fixes out of array read
Fixes: asan_static-oob_1efed25_1887_cov_2013541199_HeyYa_RA10_AAC_192K_30s.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
size_t qpdf_get_buffer_length(qpdf_data qpdf)
{
qpdf_get_buffer_internal(qpdf);
size_t result = 0;
if (qpdf->output_buffer)
{
result = qpdf->output_buffer->getSize();
}
return result;
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 40,234,429,979,669,373,000,000,000,000,000,000,000 | 10 | 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 ... |
Item_direct_view_ref(Name_resolution_context *context_arg, Item **item,
const char *table_name_arg,
const char *field_name_arg)
:Item_direct_ref(context_arg, item, table_name_arg, field_name_arg) {} | 0 | [] | mysql-server | f7316aa0c9a3909fc7498e7b95d5d3af044a7e21 | 98,254,808,649,881,200,000,000,000,000,000,000,000 | 4 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))
Backport of Bug#19143243 fix.
NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an a... |
static pyc_object *get_long_object(RBuffer *buffer) {
pyc_object *ret = NULL;
bool error = false;
bool neg = false;
ut32 tmp = 0;
size_t size;
size_t i, j = 0, left = 0;
ut16 n;
char *hexstr;
char digist2hex[] = "0123456789abcdef";
st32 ndigits = get_st32 (buffer, &error);
if (error) {
return NULL;
}
re... | 0 | [
"CWE-415"
] | radare2 | 049de62730f4954ef9a642f2eeebbca30a8eccdc | 68,339,553,596,400,200,000,000,000,000,000,000,000 | 63 | Fix #18679 - UAF when parsing corrupted pyc files ##bin |
static int __init eventpoll_init(void)
{
struct sysinfo si;
si_meminfo(&si);
/*
* Allows top 4% of lomem to be allocated for epoll watches (per user).
*/
max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) /
EP_ITEM_COST;
BUG_ON(max_user_watches < 0);
/*
* Initialize the structure use... | 0 | [] | linux-2.6 | 28d82dc1c4edbc352129f97f4ca22624d1fe61de | 302,181,285,748,922,780,000,000,000,000,000,000,000 | 34 | epoll: limit paths
The current epoll code can be tickled to run basically indefinitely in
both loop detection path check (on ep_insert()), and in the wakeup paths.
The programs that tickle this behavior set up deeply linked networks of
epoll file descriptors that cause the epoll algorithms to traverse them
indefinitel... |
static inline int has_header(const char *str, const char *header)
{
/* header + 2 to skip over CRLF prefix. (make sure you have one!) */
if (!str)
return 0;
return av_stristart(str, header + 2, NULL) || av_stristr(str, header);
} | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 2a05c8f813de6f2278827734bf8102291e7484aa | 244,458,579,894,755,500,000,000,000,000,000,000,000 | 7 | http: make length/offset-related variables unsigned.
Fixes #5992, reported and found by Paul Cher <paulcher@icloud.com>. |
OwnedImpl::OwnedImpl(absl::string_view data) : OwnedImpl() { add(data); } | 0 | [
"CWE-401"
] | envoy | 5eba69a1f375413fb93fab4173f9c393ac8c2818 | 93,951,309,373,568,670,000,000,000,000,000,000,000 | 1 | [buffer] Add on-drain hook to buffer API and use it to avoid fragmentation due to tracking of H2 data and control frames in the output buffer (#144)
Signed-off-by: antonio <avd@google.com> |
Error Box_infe::write(StreamWriter& writer) const
{
size_t box_start = reserve_box_header_space(writer);
if (get_version() <= 1) {
writer.write16((uint16_t)m_item_ID);
writer.write16(m_item_protection_index);
writer.write(m_item_name);
writer.write(m_content_type);
writer.write(m_content_encod... | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 44,322,592,019,301,820,000,000,000,000,000,000,000 | 44 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
interp(i_ctx_t **pi_ctx_p /* context for execution, updated if resched */,
const ref * pref /* object to interpret */,
ref * perror_object)
{
i_ctx_t *i_ctx_p = *pi_ctx_p;
/*
* Note that iref may actually be either a ref * or a ref_packed *.
* Certain DEC compilers assume that a ref * is... | 0 | [] | ghostpdl | a6807394bd94b708be24758287b606154daaaed9 | 338,514,046,006,828,080,000,000,000,000,000,000,000 | 1,022 | For hidden operators, pass a name object to error handler.
In normal operation, Postscript error handlers are passed the object which
triggered the error: this is invariably an operator object.
The issue arises when an error is triggered by an operator which is for internal
use only, and that operator is then passed ... |
static void ccp_sg_free(struct ccp_sg_workarea *wa)
{
if (wa->dma_count)
dma_unmap_sg(wa->dma_dev, wa->dma_sg_head, wa->nents, wa->dma_dir);
wa->dma_count = 0;
} | 0 | [
"CWE-703",
"CWE-401"
] | linux | 505d9dcb0f7ddf9d075e729523a33d38642ae680 | 337,624,057,912,692,500,000,000,000,000,000,000,000 | 7 | crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd()
There are three bugs in this code:
1) If we ccp_init_data() fails for &src then we need to free aad.
Use goto e_aad instead of goto e_ctx.
2) The label to free the &final_wa was named incorrectly as "e_tag" but
it should have been "e_final_wa". One erro... |
static int l2cap_reassemble_sdu(struct l2cap_chan *chan, struct sk_buff *skb,
struct l2cap_ctrl *control)
{
int err = -EINVAL;
switch (control->sar) {
case L2CAP_SAR_UNSEGMENTED:
if (chan->sdu)
break;
err = chan->ops->recv(chan, skb);
break;
case L2CAP_SAR_START:
if (chan->sdu)
break;
if (!p... | 0 | [
"CWE-787"
] | linux | e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 | 273,368,084,356,612,460,000,000,000,000,000,000,000 | 84 | Bluetooth: Properly check L2CAP config option output buffer length
Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.
Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <mar... |
idprime_set_security_env(struct sc_card *card,
const struct sc_security_env *env, int se_num)
{
int r;
struct sc_security_env new_env;
if (card == NULL || env == NULL) {
return SC_ERROR_INVALID_ARGUMENTS;
}
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
/* The card requires algorithm reference here */
ne... | 0 | [] | OpenSC | f015746d22d249642c19674298a18ad824db0ed7 | 95,166,865,598,061,830,000,000,000,000,000,000,000 | 61 | idprime: Use temporary variable instead of messing up the passed one
Thanks oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28185 |
set_lenIV(const char* line)
{
char *p = strstr(line, "/lenIV ");
/* Allow lenIV to be negative. Thanks to Tom Kacvinsky <tjk@ams.org> */
if (p && (isdigit((unsigned char) p[7]) || p[7] == '+' || p[7] == '-')) {
lenIV = atoi(p + 7);
}
} | 0 | [
"CWE-119",
"CWE-787"
] | t1utils | 6b9d1aafcb61a3663c883663eb19ccdbfcde8d33 | 181,024,463,207,763,660,000,000,000,000,000,000,000 | 9 | Security fixes.
- Don't overflow the small cs_start buffer (reported by Niels
Thykier via the debian tracker (Jakub Wilk), found with a
fuzzer ("American fuzzy lop")).
- Cast arguments to <ctype.h> functions to unsigned char. |
void tcp_chrono_start(struct sock *sk, const enum tcp_chrono type)
{
struct tcp_sock *tp = tcp_sk(sk);
/* If there are multiple conditions worthy of tracking in a
* chronograph then the highest priority enum takes precedence
* over the other conditions. So that if something "more interesting"
* starts happenin... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 73,382,811,098,056,890,000,000,000,000,000,000,000 | 12 | tcp: limit payload size of sacked skbs
Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :
BUG_ON(tcp_skb_pcount(skb) < pcount);
This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48
An skb can hold 17 fragments, and each fragment can ho... |
void Val(mongo::OID& v) const {
v = OID();
} | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 68,121,603,032,361,840,000,000,000,000,000,000,000 | 3 | SERVER-38984 Validate unique User ID on UserCache hit |
static inline int check_mnt(struct mount *mnt)
{
return mnt->mnt_ns == current->nsproxy->mnt_ns;
} | 0 | [
"CWE-269"
] | user-namespace | a6138db815df5ee542d848318e5dae681590fccd | 182,282,151,125,182,740,000,000,000,000,000,000,000 | 4 | mnt: Only change user settable mount flags in remount
Kenton Varda <kenton@sandstorm.io> discovered that by remounting a
read-only bind mount read-only in a user namespace the
MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user
to the remount a read-only mount read-write.
Correct this by replacing t... |
TPMT_SYM_DEF_OBJECT_Marshal(TPMT_SYM_DEF_OBJECT *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPMI_ALG_SYM_OBJECT_Marshal(&source->algorithm, buffer, size);
written += TPMU_SYM_KEY_BITS_Marshal(&source->keyBits, buffer, size, source->algorithm);
written += TPMU_SYM_MODE_Marshal(... | 0 | [
"CWE-787"
] | libtpms | 3ef9b26cb9f28bd64d738bff9505a20d4eb56acd | 163,057,697,811,178,610,000,000,000,000,000,000,000 | 9 | 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> |
void RGWGetObjLayout_ObjStore_S3::send_response()
{
if (op_ret)
set_req_state_err(s, op_ret);
dump_errno(s);
end_header(s, this, "application/json");
JSONFormatter f;
if (op_ret < 0) {
return;
}
f.open_object_section("result");
::encode_json("head", head_obj, &f);
::encode_json("manifest", ... | 0 | [
"CWE-79"
] | ceph | 8f90658c731499722d5f4393c8ad70b971d05f77 | 174,624,644,710,123,240,000,000,000,000,000,000,000 | 37 | rgw: reject unauthenticated response-header actions
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d8dd5e513c0c62bbd7d3044d7e2eddcd897bd400) |
unsigned long netdev_fix_features(unsigned long features, const char *name)
{
/* Fix illegal SG+CSUM combinations. */
if ((features & NETIF_F_SG) &&
!(features & NETIF_F_ALL_CSUM)) {
if (name)
printk(KERN_NOTICE "%s: Dropping NETIF_F_SG since no "
"checksum feature.\n", name);
features &= ~NETIF... | 0 | [
"CWE-264"
] | linux | 8909c9ad8ff03611c9c96c9a92656213e4bb495b | 320,112,637,193,339,900,000,000,000,000,000,000,000 | 41 | net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules
Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with
CAP_NET_ADMIN may load any module from /lib/modules/. This doesn't mean
that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are
limited to /lib/modules/**. However, CAP_NET_ADMIN... |
udisks_log (UDisksLogLevel level,
const gchar *function,
const gchar *location,
const gchar *format,
...)
{
va_list var_args;
gchar *message;
va_start (var_args, format);
message = g_strdup_vprintf (format, var_args);
va_end (var_args);
#... | 0 | [
"CWE-134"
] | udisks | e369a9b4b08e9373c814c05328b366c938284eb5 | 87,218,934,448,487,830,000,000,000,000,000,000,000 | 23 | Fix string format vulnerability
If the message in g_log_structured itself
contained format sequences like %d or %n they
were applied again, leading to leaked stack contents
and possibly memory corruption. It can be triggered
e.g. by a volume label containing format sequences.
Print the message argument itself into a ... |
static void sock_def_write_space(struct sock *sk)
{
struct socket_wq *wq;
rcu_read_lock();
/* Do not wake up a writer until he can make "significant"
* progress. --DaveM
*/
if ((refcount_read(&sk->sk_wmem_alloc) << 1) <= READ_ONCE(sk->sk_sndbuf)) {
wq = rcu_dereference(sk->sk_wq);
if (skwq_has_sleeper(wq... | 0 | [] | net | 35306eb23814444bd4021f8a1c3047d3cb0c8b2b | 327,259,554,568,882,500,000,000,000,000,000,000,000 | 22 | af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
Jann Horn reported that SO_PEERCRED and SO_PEERGROUPS implementations
are racy, as af_unix can concurrently change sk_peer_pid and sk_peer_cred.
In order to fix this issue, this patch adds a new spinlock that needs
to be used whenever these fields are read o... |
gint32 ves_icall_System_Threading_Interlocked_Exchange_Int (gint32 *location, gint32 value)
{
MONO_ARCH_SAVE_REGS;
return InterlockedExchange(location, value);
} | 0 | [
"CWE-399",
"CWE-264"
] | mono | 722f9890f09aadfc37ae479e7d946d5fc5ef7b91 | 148,470,598,372,963,330,000,000,000,000,000,000,000 | 6 | Fix access to freed members of a dead thread
* threads.c: Fix access to freed members of a dead thread. Found
and fixed by Rodrigo Kumpera <rkumpera@novell.com>
Ref: CVE-2011-0992 |
static int ntop_list_http_hosts(lua_State* vm) {
NetworkInterface *ntop_interface = getCurrentInterface(vm);
char *key;
ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__);
if(!ntop_interface) return(CONST_LUA_ERROR);
if(lua_type(vm, 1) != LUA_TSTRING) /* Optional */
key = NULL;
el... | 0 | [
"CWE-476"
] | ntopng | 01f47e04fd7c8d54399c9e465f823f0017069f8f | 189,937,549,844,498,280,000,000,000,000,000,000,000 | 17 | Security fix: prevents empty host from being used |
fsobj_error(int *a_eno, struct archive_string *a_estr,
int err, const char *errstr, const char *path)
{
if (a_eno)
*a_eno = err;
if (a_estr)
archive_string_sprintf(a_estr, "%s%s", errstr, path);
} | 0 | [
"CWE-59",
"CWE-269"
] | libarchive | b41daecb5ccb4c8e3b2c53fd6147109fc12c3043 | 75,732,856,503,056,600,000,000,000,000,000,000,000 | 8 | Do not follow symlinks when processing the fixup list
Use lchmod() instead of chmod() and tell the remaining functions that the
real file to be modified is a symbolic link.
Fixes #1566 |
GF_Err dfla_box_dump(GF_Box *a, FILE * trace)
{
GF_FLACConfigBox *ptr = (GF_FLACConfigBox *)a;
gf_isom_box_dump_start(a, "FLACSpecificBox", trace);
gf_fprintf(trace, " dataSize=\"%d\">\n", ptr->dataSize);
gf_isom_box_dump_done("FLACSpecificBox", a, trace);
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 216,495,899,546,224,680,000,000,000,000,000,000,000 | 8 | fixed #2138 |
birthday_populate (EContact *contact,
gchar **values)
{
if (values[0]) {
EContactDate *dt = e_contact_date_from_string (values[0]);
e_contact_set (contact, E_CONTACT_BIRTH_DATE, dt);
e_contact_date_free (dt);
}
} | 0 | [] | evolution-data-server | 34bad61738e2127736947ac50e0c7969cc944972 | 63,042,928,208,104,960,000,000,000,000,000,000,000 | 9 | Bug 796174 - strcat() considered unsafe for buffer overflow |
int sldns_str2wire_dname_buf_origin(const char* str, uint8_t* buf, size_t* len,
uint8_t* origin, size_t origin_len)
{
size_t dlen = *len;
int rel = 0;
int s = sldns_str2wire_dname_buf_rel(str, buf, &dlen, &rel);
if(s) return s;
if(rel && origin && dlen > 0) {
if((unsigned)dlen >= 0x00ffffffU ||
(unsigned)or... | 0 | [] | unbound | 3f3cadd416d6efa92ff2d548ac090f42cd79fee9 | 265,728,198,206,763,070,000,000,000,000,000,000,000 | 25 | - Fix Out of Bounds Write in sldns_str2wire_str_buf(),
reported by X41 D-Sec. |
static inline int unuse_pmd_range(struct vm_area_struct *vma, pud_t *pud,
unsigned long addr, unsigned long end,
swp_entry_t entry, struct page *page)
{
pmd_t *pmd;
unsigned long next;
int ret;
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
if (unlikely(pmd_trans_huge(*pmd)))
con... | 1 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 205,910,742,923,901,300,000,000,000,000,000,000,000 | 21 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
static struct binder_thread *binder_get_txn_from_and_acq_inner(
struct binder_transaction *t)
{
struct binder_thread *from;
from = binder_get_txn_from(t);
if (!from)
return NULL;
binder_inner_proc_lock(from->proc);
if (t->from) {
BUG_ON(from != t->from);
return from;
}
binder_inner_proc_unlock(from->pro... | 0 | [
"CWE-416"
] | linux | 7bada55ab50697861eee6bb7d60b41e68a961a9c | 64,698,462,756,021,850,000,000,000,000,000,000,000 | 17 | binder: fix race that allows malicious free of live buffer
Malicious code can attempt to free buffers using the BC_FREE_BUFFER
ioctl to binder. There are protections against a user freeing a buffer
while in use by the kernel, however there was a window where
BC_FREE_BUFFER could be used to free a recently allocated bu... |
static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
{
struct ipv6_txoptions *opt_to_free = NULL;
struct ipv6_txoptions opt_space;
DECLARE_SOCKADDR(struct sockaddr_in6 *, sin6, msg->msg_name);
struct in6_addr *daddr, *final_p, final;
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np... | 0 | [
"CWE-416",
"CWE-284",
"CWE-264"
] | linux | 45f6fad84cc305103b28d73482b344d7f5b76f39 | 84,114,743,361,403,110,000,000,000,000,000,000,000 | 187 | ipv6: add complete rcu protection around np->opt
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-a... |
ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{
loff_t isize, left;
int ret;
isize = i_size_read(in->f_mapping->host);
if (unlikely(*ppos >= isize))
return 0;
left = isize - *ppos;
if (unlikely(left < len))
len = left;... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 8d0207652cbe27d1f962050737848e5ad4671958 | 220,431,777,718,407,000,000,000,000,000,000,000,000 | 23 | ->splice_write() via ->write_iter()
iter_file_splice_write() - a ->splice_write() instance that gathers the
pipe buffers, builds a bio_vec-based iov_iter covering those and feeds
it to ->write_iter(). A bunch of simple cases coverted to that...
[AV: fixed the braino spotted by Cyrill]
Signed-off-by: Al Viro <viro@z... |
router_dir_info_changed(void)
{
need_to_update_have_min_dir_info = 1;
rend_hsdir_routers_changed();
} | 0 | [
"CWE-399"
] | tor | 308f6dad20675c42b29862f4269ad1fbfb00dc9a | 91,331,866,059,817,300,000,000,000,000,000,000,000 | 5 | Mitigate a side-channel leak of which relays Tor chooses for a circuit
Tor's and OpenSSL's current design guarantee that there are other leaks,
but this one is likely to be more easily exploitable, and is easy to fix. |
load_vector_int(BitStream& bit_stream, int nitems, std::vector<T>& vec,
int bits_wanted, int_type T::*field)
{
bool append = vec.empty();
// nitems times, read bits_wanted from the given bit stream,
// storing results in the ith vector entry.
for (int i = 0; i < nitems; ++i)
{
if (append)... | 1 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 77,745,159,151,214,640,000,000,000,000,000,000,000 | 23 | 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 ... |
static bool r_parse_pointer(RParsedPointer *ptr, ut64 decorated_addr, RKernelCacheObj *obj) {
/*
* Logic taken from:
* https://github.com/Synacktiv/kernelcache-laundering/blob/master/ios12_kernel_cache_helper.py
*/
if ((decorated_addr & 0x4000000000000000LL) == 0 && obj->rebase_info) {
if (decorated_addr & 0... | 0 | [
"CWE-476"
] | radare2 | feaa4e7f7399c51ee6f52deb84dc3f795b4035d6 | 62,318,195,815,103,970,000,000,000,000,000,000,000 | 21 | Fix null deref in xnu.kernelcache ##crash
* Reported by @xshad3 via huntr.dev |
e1000e_build_rx_metadata(E1000ECore *core,
struct NetRxPkt *pkt,
bool is_eop,
const E1000E_RSSInfo *rss_info,
uint32_t *rss, uint32_t *mrq,
uint32_t *status_flags,
uint16... | 0 | [
"CWE-835"
] | qemu | 4154c7e03fa55b4cf52509a83d50d6c09d743b77 | 281,772,676,525,651,960,000,000,000,000,000,000,000 | 106 | net: e1000e: fix an infinite loop issue
This issue is like the issue in e1000 network card addressed in
this commit:
e1000: eliminate infinite loops on out-of-bounds transfer start.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.... |
static bool toneport_has_led(struct usb_line6_toneport *toneport)
{
switch (toneport->type) {
case LINE6_GUITARPORT:
case LINE6_TONEPORT_GX:
/* add your device here if you are missing support for the LEDs */
return true;
default:
return false;
}
} | 0 | [
"CWE-476"
] | linux | 0b074ab7fc0d575247b9cc9f93bb7e007ca38840 | 200,266,606,423,086,100,000,000,000,000,000,000,000 | 12 | ALSA: line6: Assure canceling delayed work at disconnection
The current code performs the cancel of a delayed work at the late
stage of disconnection procedure, which may lead to the access to the
already cleared state.
This patch assures to call cancel_delayed_work_sync() at the beginning
of the disconnection proced... |
read_rsrc_short (const SD2_RSRC *prsrc, int offset)
{ const unsigned char * data = prsrc->rsrc_data ;
if (offset < 0 || offset + 1 >= prsrc->rsrc_len)
return 0 ;
return (data [offset] << 8) + data [offset + 1] ;
} /* read_rsrc_short */ | 0 | [
"CWE-119",
"CWE-787"
] | libsndfile | dbe14f00030af5d3577f4cabbf9861db59e9c378 | 129,682,064,665,722,580,000,000,000,000,000,000,000 | 6 | src/sd2.c : Fix two potential buffer read overflows.
Closes: https://github.com/erikd/libsndfile/issues/93 |
int ip6_forward(struct sk_buff *skb)
{
struct dst_entry *dst = skb_dst(skb);
struct ipv6hdr *hdr = ipv6_hdr(skb);
struct inet6_skb_parm *opt = IP6CB(skb);
struct net *net = dev_net(dst->dev);
u32 mtu;
if (net->ipv6.devconf_all->forwarding == 0)
goto error;
if (skb_warn_if_lro(skb))
goto drop;
if (!xfrm6_... | 0 | [
"CWE-399"
] | linux | 75a493e60ac4bbe2e977e7129d6d8cbb0dd236be | 186,644,210,773,340,370,000,000,000,000,000,000,000 | 158 | ipv6: ip6_append_data_mtu did not care about pmtudisc and frag_size
If the socket had an IPV6_MTU value set, ip6_append_data_mtu lost track
of this when appending the second frame on a corked socket. This results
in the following splat:
[37598.993962] ------------[ cut here ]------------
[37598.994008] kernel BUG at ... |
PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
{
int module_number = PS(module_number);
if (!PS(id)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot set session ID - session ID is not initialized");
return;
}
if (PS(use_cookies) && PS(send_cookie)) {
php_session_send_cookie(TSRMLS_C);
PS(send_... | 0 | [
"CWE-264"
] | php-src | 25e8fcc88fa20dc9d4c47184471003f436927cde | 108,124,407,647,991,200,000,000,000,000,000,000,000 | 34 | Strict session |
BOOL update_write_opaque_rect_order(wStream* s, ORDER_INFO* orderInfo,
const OPAQUE_RECT_ORDER* opaque_rect)
{
BYTE byte;
int inf = update_approximate_opaque_rect_order(orderInfo, opaque_rect);
if (!Stream_EnsureRemainingCapacity(s, inf))
return FALSE;
// TODO: Color format c... | 0 | [
"CWE-415"
] | FreeRDP | 67c2aa52b2ae0341d469071d1bc8aab91f8d2ed8 | 272,596,382,856,367,420,000,000,000,000,000,000,000 | 30 | Fixed #6013: Check new length is > 0 |
static int bt_seq_show(struct seq_file *seq, void *v)
{
struct bt_seq_state *s = seq->private;
struct bt_sock_list *l = s->l;
if (v == SEQ_START_TOKEN) {
seq_puts(seq ,"sk RefCnt Rmem Wmem User Inode Parent");
if (l->custom_seq_show) {
seq_putc(seq, ' ');
l->custom_seq_show(seq, v);
... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 124,600,892,396,178,430,000,000,000,000,000,000,000 | 37 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
static void vmxnet3_get_tx_stats_from_file(QEMUFile *f,
struct UPT1_TxStats *tx_stat)
{
tx_stat->TSOPktsTxOK = qemu_get_be64(f);
tx_stat->TSOBytesTxOK = qemu_get_be64(f);
tx_stat->ucastPktsTxOK = qemu_get_be64(f);
tx_stat->ucastBytesTxOK = qemu_get_be64(f);
tx_stat->mcastPktsTxOK = qemu_get_be64... | 0 | [
"CWE-20"
] | qemu | a7278b36fcab9af469563bd7b9dadebe2ae25e48 | 101,091,731,663,647,300,000,000,000,000,000,000,000 | 14 | net/vmxnet3: Refine l2 header validation
Validation of l2 header length assumed minimal packet size as
eth_header + 2 * vlan_header regardless of the actual protocol.
This caused crash for valid non-IP packets shorter than 22 bytes, as
'tx_pkt->packet_type' hasn't been assigned for such packets, and
'vmxnet3_on_tx_do... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.