func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void php_image_filter_grayscale(INTERNAL_FUNCTION_PARAMETERS)
{
PHP_GD_SINGLE_RES
if (gdImageGrayScale(im_src) == 1) {
RETURN_TRUE;
}
RETURN_FALSE;
} | 0 | [
"CWE-703",
"CWE-189"
] | php-src | 2938329ce19cb8c4197dec146c3ec887c6f61d01 | 230,636,299,163,491,200,000,000,000,000,000,000,000 | 10 | Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
And also fixed the bug: arguments are altered after some calls |
TEST(ExpressionObjectParse, ShouldAcceptEmptyObject) {
intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest());
VariablesParseState vps = expCtx->variablesParseState;
auto object = ExpressionObject::parse(expCtx, BSONObj(), vps);
ASSERT_VALUE_EQ(Value(Document{}), object->serializ... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 209,167,315,437,677,050,000,000,000,000,000,000,000 | 6 | SERVER-38070 fix infinite loop in agg expression |
onig_get_encoding(regex_t* reg)
{
return reg->enc;
} | 0 | [
"CWE-125"
] | oniguruma | 690313a061f7a4fa614ec5cc8368b4f2284e059b | 105,104,842,753,233,340,000,000,000,000,000,000,000 | 4 | fix #57 : DATA_ENSURE() check must be before data access |
unsigned headerSizeof(Header h, int magicp)
{
indexEntry entry;
unsigned int size = 0;
int i;
if (h == NULL)
return size;
headerSort(h);
if (magicp == HEADER_MAGIC_YES)
size += sizeof(rpm_header_magic);
size += 2 * sizeof(int32_t); /* count of index entries */
for (i = 0, entry = ... | 0 | [
"CWE-125"
] | rpm | 8f4b3c3cab8922a2022b9e47c71f1ecf906077ef | 71,903,330,668,013,150,000,000,000,000,000,000,000 | 38 | hdrblobInit() needs bounds checks too
Users can pass untrusted data to hdrblobInit() and it must be robust
against this. |
buf_add_txid(StringInfo buf, txid xid)
{
TxidSnapshot *snap = (TxidSnapshot *) buf->data;
/* do this before possible realloc */
snap->nxip++;
appendBinaryStringInfo(buf, (char *) &xid, sizeof(xid));
} | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 199,043,968,599,514,640,000,000,000,000,000,000,000 | 9 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
template<typename tc>
CImg<T>& draw_grid(const float delta_x, const float delta_y,
const float offsetx, const float offsety,
const bool invertx, const bool inverty,
const tc *const color, const float opacity=1,
const un... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 50,453,683,050,613,780,000,000,000,000,000,000,000 | 23 | Fix other issues in 'CImg<T>::load_bmp()'. |
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
CWD_STATE_FREE(&new_state);
return -1;
}
retval = php_sys_lstat(new_state.cwd, buf... | 0 | [
"CWE-190"
] | php-src | 0218acb7e756a469099c4ccfb22bce6c2bd1ef87 | 133,432,394,867,514,330,000,000,000,000,000,000,000 | 16 | Fix for bug #72513 |
static int opt_show_entries(void *optctx, const char *opt, const char *arg)
{
const char *p = arg;
int ret = 0;
while (*p) {
AVDictionary *entries = NULL;
char *section_name = av_get_token(&p, "=:");
int show_all_entries = 0;
if (!section_name) {
av_log(NULL, AV... | 0 | [
"CWE-476"
] | FFmpeg | 837cb4325b712ff1aab531bf41668933f61d75d2 | 220,379,867,944,937,350,000,000,000,000,000,000,000 | 49 | ffprobe: Fix null pointer dereference with color primaries
Found-by: AD-lab of venustech
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
smtp_server_connection_get_state(struct smtp_server_connection *conn,
const char **args_r)
{
if (args_r != NULL)
*args_r = conn->state.args;
return conn->state.state;
} | 0 | [
"CWE-77"
] | core | 321c339756f9b2b98fb7326359d1333adebb5295 | 255,634,060,084,601,850,000,000,000,000,000,000,000 | 7 | lib-smtp: smtp-server-connection - Fix STARTTLS command injection vulnerability.
The input handler kept reading more commands even though the input was locked by
the STARTTLS command, thereby causing it to read the command pipelined beyond
STARTTLS. This causes a STARTTLS command injection vulerability. |
PHP_FUNCTION(imagecopyresized)
{
zval *SIM, *DIM;
long SX, SY, SW, SH, DX, DY, DW, DH;
gdImagePtr im_dst, im_src;
int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
... | 0 | [
"CWE-703",
"CWE-189"
] | php-src | 2938329ce19cb8c4197dec146c3ec887c6f61d01 | 39,425,769,157,606,570,000,000,000,000,000,000,000 | 31 | Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
And also fixed the bug: arguments are altered after some calls |
s32 gf_mpegh_get_mhas_pl(u8 *ptr, u32 size, u64 *ch_layout)
{
s32 PL = -1;
GF_BitStream *bs;
u32 i;
s32 sync_pos=-1;
for (i=0; i<size-3; i++) {
if ((ptr[i]==0xC0) && (ptr[i+1]== 0x01) && (ptr[i+2]==0xA5)) {
sync_pos = i;
break;
}
}
if (sync_pos<0) return 0;
if (ch_layout) *ch_layout = 0;
bs = gf_bs_n... | 0 | [
"CWE-190",
"CWE-787"
] | gpac | 51cdb67ff7c5f1242ac58c5aa603ceaf1793b788 | 60,000,426,028,357,930,000,000,000,000,000,000,000 | 47 | add safety in avc/hevc/vvc sps/pps/vps ID check - cf #1720 #1721 #1722 |
static void validate_mm_rb(struct rb_root *root, struct vm_area_struct *ignore)
{
struct rb_node *nd;
for (nd = rb_first(root); nd; nd = rb_next(nd)) {
struct vm_area_struct *vma;
vma = rb_entry(nd, struct vm_area_struct, vm_rb);
VM_BUG_ON_VMA(vma != ignore &&
vma->rb_subtree_gap != vma_compute_subtree_gap(... | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 338,988,351,784,046,080,000,000,000,000,000,000,000 | 12 | 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 ... |
input_buffer* Buffers::TakeRawInput()
{
input_buffer* ret = rawInput_;
rawInput_ = 0;
return ret;
} | 0 | [
"CWE-254"
] | mysql-server | e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69 | 166,935,920,386,999,300,000,000,000,000,000,000,000 | 7 | Bug #22738607: YASSL FUNCTION X509_NAME_GET_INDEX_BY_NID IS NOT WORKING AS EXPECTED. |
static int oz_set_active_pd(const u8 *addr)
{
int rc = 0;
struct oz_pd *pd;
struct oz_pd *old_pd;
pd = oz_pd_find(addr);
if (pd) {
spin_lock_bh(&g_cdev.lock);
memcpy(g_cdev.active_addr, addr, ETH_ALEN);
old_pd = g_cdev.active_pd;
g_cdev.active_pd = pd;
spin_unlock_bh(&g_cdev.lock);
if (old_pd)
oz_p... | 0 | [
"CWE-119",
"CWE-787"
] | linux | c2c65cd2e14ada6de44cb527e7f1990bede24e15 | 282,461,172,059,517,800,000,000,000,000,000,000,000 | 31 | staging: ozwpan: prevent overflow in oz_cdev_write()
We need to check "count" so we don't overflow the ei->data buffer.
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: Linus Torvalds <t... |
_gnutls_proc_x509_server_certificate (gnutls_session_t session,
uint8_t * data, size_t data_size)
{
int size, len, ret;
uint8_t *p = data;
cert_auth_info_t info;
gnutls_certificate_credentials_t cred;
ssize_t dsize = data_size;
int i;
gnutls_pcert_st *peer_certificate... | 1 | [
"CWE-399"
] | gnutls | 9c62f4feb2bdd6fbbb06eb0c60bfdea80d21bbb8 | 265,861,406,491,065,970,000,000,000,000,000,000,000 | 138 | Deinitialize the correct number of certificates. Reported by Remi Gacogne. |
TfLiteStatus LessEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1;
TF_LITE_ENSURE_OK(context,
GetInputSafe(context, node, kInputTensor1, &input1));
const TfLiteTensor* input2;
TF_LITE_ENSURE_OK(context,
GetInputSafe(context, node, kInputTensor2,... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 84,522,225,940,930,480,000,000,000,000,000,000,000 | 40 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
struct net_device * hostap_add_interface(struct local_info *local,
int type, int rtnl_locked,
const char *prefix,
const char *name)
{
struct net_device *dev, *mdev;
struct hostap_interface *iface;
int ret;
dev = alloc_etherdev(sizeof(struct hostap_interface));
if (dev == NULL)
return NULL;
i... | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 35,085,697,910,300,435,000,000,000,000,000,000,000 | 51 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
append_to_parameter (struct para_data_s *para, struct para_data_s *r)
{
assert (para);
while (para->next)
para = para->next;
para->next = r;
} | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 265,997,159,097,471,750,000,000,000,000,000,000,000 | 7 | 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 ... |
inline int _sscanf(const char *const s, const char *const format, ...) {
cimg::mutex(6);
va_list args;
va_start(args,format);
const int result = std::vsscanf(s,format,args);
va_end(args);
cimg::mutex(6,0);
return result;
} | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 314,349,680,197,381,530,000,000,000,000,000,000,000 | 9 | Fix other issues in 'CImg<T>::load_bmp()'. |
irc_server_check_join_noswitch_cb (void *data,
struct t_hashtable *hashtable,
const void *key, const void *value)
{
/* make C compiler happy */
(void) data;
if (*((time_t *)value) + (60 * 10) < time (NULL))
weechat_hashtable_remo... | 0 | [
"CWE-120",
"CWE-787"
] | weechat | 40ccacb4330a64802b1f1e28ed9a6b6d3ca9197f | 147,434,892,990,446,030,000,000,000,000,000,000,000 | 10 | irc: fix crash when a new message 005 is received with longer nick prefixes
Thanks to Stuart Nevans Locke for reporting the issue. |
enum open_frm_error open_table_def(THD *thd, TABLE_SHARE *share, uint flags)
{
bool error_given= false;
File file;
uchar *buf;
uchar head[FRM_HEADER_SIZE];
char path[FN_REFLEN];
size_t frmlen, read_length;
uint length;
DBUG_ENTER("open_table_def");
DBUG_PRINT("enter", ("table: '%s'.'%s' path: '%s'", ... | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 201,660,297,536,592,400,000,000,000,000,000,000,000 | 114 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
peer_weight_unset_vty (struct vty *vty, const char *ip_str)
{
struct peer *peer;
peer = peer_and_group_lookup_vty (vty, ip_str);
if (! peer)
return CMD_WARNING;
peer_weight_unset (peer);
return CMD_SUCCESS;
} | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 278,471,051,474,140,000,000,000,000,000,000,000,000 | 12 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
static int check_perm(const char **mntp, struct stat *stbuf, int *mountpoint_fd)
{
int res;
const char *mnt = *mntp;
const char *origmnt = mnt;
res = lstat(mnt, stbuf);
if (res == -1) {
fprintf(stderr, "%s: failed to access mountpoint %s: %s\n",
progname, mnt, strerror(errno));
return -1;
}
/* No permis... | 0 | [
"CWE-269"
] | libfuse | 28bdae3d113ef479c1660a581ef720cdc33bf466 | 176,409,891,185,103,700,000,000,000,000,000,000,000 | 80 | fusermount: don't feed "escaped commas" into mount options
The old code permits the following behavior:
$ _FUSE_COMMFD=10000 priv_strace -etrace=mount -s200 fusermount -o 'foobar=\,allow_other' mount
mount("/dev/fuse", ".", "fuse", MS_NOSUID|MS_NODEV, "foobar=\\,allow_other,fd=3,rootmode=40000,user_id=1000,group_id=1... |
static void klsi_105_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
struct ktermios *old_termios)
{
struct klsi_105_private *priv = usb_get_serial_port_data(port);
struct device *dev = &port->dev;
unsigned int iflag = tty->termios.c_iflag;
unsigned int old_iflag = old_termios->c_iflag;
... | 0 | [
"CWE-532"
] | linux | 146cc8a17a3b4996f6805ee5c080e7101277c410 | 105,428,981,153,298,950,000,000,000,000,000,000,000 | 159 | USB: serial: kl5kusb105: fix line-state error handling
The current implementation failed to detect short transfers when
attempting to read the line state, and also, to make things worse,
logged the content of the uninitialised heap transfer buffer.
Fixes: abf492e7b3ae ("USB: kl5kusb105: fix DMA buffers on stack")
Fix... |
static void cmd_parse_lsub (IMAP_DATA* idata, char* s)
{
char buf[STRING];
char errstr[STRING];
BUFFER err, token;
ciss_url_t url;
IMAP_LIST list;
if (idata->cmddata && idata->cmdtype == IMAP_CT_LIST)
{
/* caller will handle response itself */
cmd_parse_list (idata, s);
return;
}
if (!op... | 1 | [
"CWE-78"
] | mutt | 185152818541f5cdc059cbff3f3e8b654fc27c1d | 114,047,141,275,832,760,000,000,000,000,000,000,000 | 46 | Properly quote IMAP mailbox names when (un)subscribing.
When handling automatic subscription (via $imap_check_subscribed), or
manual subscribe/unsubscribe commands, mutt generating a "mailboxes"
command but failed to properly escape backquotes.
Thanks to Jeriko One for the detailed bug report and patch, which this
co... |
static void std_opt_2(ArmOpcode *ao) {
ao->a[2] = ao->a[1];
ao->a[1] = ao->a[0];
} | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | e5c14c167b0dcf0a53d76bd50bacbbcc0dfc1ae7 | 194,457,498,449,869,180,000,000,000,000,000,000,000 | 4 | Fix #12417/#12418 (arm assembler heap overflows) |
static void disable_dmar_iommu(struct intel_iommu *iommu)
{
struct device_domain_info *info, *tmp;
unsigned long flags;
if (!iommu->domains || !iommu->domain_ids)
return;
again:
spin_lock_irqsave(&device_domain_lock, flags);
list_for_each_entry_safe(info, tmp, &device_domain_list, global) {
struct dmar_domai... | 0 | [] | linux | d8b8591054575f33237556c32762d54e30774d28 | 133,230,709,196,428,260,000,000,000,000,000,000,000 | 40 | iommu/vt-d: Disable ATS support on untrusted devices
Commit fb58fdcd295b9 ("iommu/vt-d: Do not enable ATS for untrusted
devices") disables ATS support on the devices which have been marked
as untrusted. Unfortunately this is not enough to fix the DMA attack
vulnerabiltiies because IOMMU driver allows translated reques... |
int handler_init(void)
{
return tcmur_register_handler(&file_handler);
} | 0 | [
"CWE-200"
] | tcmu-runner | 8cf8208775022301adaa59c240bb7f93742d1329 | 107,930,981,025,919,600,000,000,000,000,000,000,000 | 4 | removed all check_config callback implementations to avoid security issues
see github issue #194
qcow.c contained an information leak, could test for existance of any
file in the system
file_example.c and file_optical.c allow also to test for existance of
any file, plus to temporarily create empty new files anywhere... |
void GrpcHealthCheckerImpl::GrpcActiveHealthCheckSession::onResetStream(Http::StreamResetReason,
absl::string_view) {
const bool expected_reset = expect_reset_;
const bool goaway = received_no_error_goaway_;
resetState();
if (expected_rese... | 0 | [
"CWE-476"
] | envoy | 9b1c3962172a972bc0359398af6daa3790bb59db | 420,060,769,586,004,550,000,000,000,000,000,000 | 29 | healthcheck: fix grpc inline removal crashes (#749)
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
TEST_F(QueryPlannerTest, CompoundIndexBoundsMiddleFieldMissing) {
addIndex(BSON("a" << 1 << "b" << 1 << "c" << 1));
runQuery(fromjson("{a: 1, c: {$lt: 3}}"));
assertNumSolutions(2U);
assertSolutionExists("{cscan: {dir: 1}}");
assertSolutionExists(
"{fetch: {node: {ixscan: {pattern: {a: 1, b... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 95,066,557,517,224,500,000,000,000,000,000,000,000 | 11 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
static int __init packet_init(void)
{
int rc = proto_register(&packet_proto, 0);
if (rc != 0)
goto out;
sock_register(&packet_family_ops);
register_pernet_subsys(&packet_net_ops);
register_netdevice_notifier(&packet_netdev_notifier);
out:
return rc;
} | 0 | [
"CWE-909"
] | linux-2.6 | 67286640f638f5ad41a946b9a3dc75327950248f | 174,071,068,095,261,370,000,000,000,000,000,000,000 | 13 | net: packet: fix information leak to userland
packet_getname_spkt() doesn't initialize all members of sa_data field of
sockaddr struct if strlen(dev->name) < 13. This structure is then copied
to userland. It leads to leaking of contents of kernel stack memory.
We have to fully fill sa_data with strncpy() instead of ... |
pdf_nextobject(const char *ptr, size_t len)
{
const char *p;
int inobject = 1;
while(len) {
switch(*ptr) {
case '\n':
case '\r':
case '%': /* comment */
p = pdf_nextlinestart(ptr, len);
if(p == NULL)
return NULL;
len -= (size_t)(p - ptr);
ptr = p;
inobject = 0;
break;
cas... | 0 | [] | clamav-devel | f0eb394501ec21b9fe67f36cbf5db788711d4236 | 153,777,764,620,801,780,000,000,000,000,000,000,000 | 40 | bb #2016. |
static av_cold int dct_init(MpegEncContext *s)
{
ff_blockdsp_init(&s->bdsp, s->avctx);
ff_h264chroma_init(&s->h264chroma, 8); //for lowres
ff_hpeldsp_init(&s->hdsp, s->avctx->flags);
ff_mpegvideodsp_init(&s->mdsp);
ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample);
if (s->avctx->debug &... | 0 | [
"CWE-476"
] | FFmpeg | b3332a182f8ba33a34542e4a0370f38b914ccf7d | 191,881,484,597,952,340,000,000,000,000,000,000,000 | 46 | avcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext profile
These 2 fields are not always the same, it is simpler to always use the same field
for detecting studio profile
Fixes: null pointer dereference
Fixes: ffmpeg_crash_3.avi
Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böh... |
static inline struct free_segmap_info *FREE_I(struct f2fs_sb_info *sbi)
{
return (struct free_segmap_info *)(SM_I(sbi)->free_info);
} | 0 | [
"CWE-476"
] | linux | 4969c06a0d83c9c3dc50b8efcdc8eeedfce896f6 | 212,123,829,720,219,900,000,000,000,000,000,000,000 | 4 | f2fs: support swap file w/ DIO
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
devirtualization_time_bonus (struct cgraph_node *node,
vec<tree> known_csts,
vec<ipa_polymorphic_call_context> known_contexts,
vec<ipa_agg_value_set> known_aggs)
{
struct cgraph_edge *ie;
int res = 0;
for (ie = node->indirect_calls; ie; ie = ie->next_callee)
{
struct cgraph_node... | 0 | [
"CWE-20"
] | gcc | a09ccc22459c565814f79f96586fe4ad083fe4eb | 10,318,679,659,808,718,000,000,000,000,000,000,000 | 49 | Avoid segfault when doing IPA-VRP but not IPA-CP (PR 93015)
2019-12-21 Martin Jambor <mjambor@suse.cz>
PR ipa/93015
* ipa-cp.c (ipcp_store_vr_results): Check that info exists
testsuite/
* gcc.dg/lto/pr93015_0.c: New test.
From-SVN: r279695 |
void JOIN::exec_inner()
{
List<Item> *columns_list= &fields_list;
DBUG_ENTER("JOIN::exec_inner");
DBUG_ASSERT(optimization_state == JOIN::OPTIMIZATION_DONE);
THD_STAGE_INFO(thd, stage_executing);
/*
Enable LIMIT ROWS EXAMINED during query execution if:
(1) This JOIN is the outermost query (not a sub... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 136,441,511,460,170,000,000,000,000,000,000,000,000 | 202 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
Compare_keys handler::compare_key_parts(const Field &old_field,
const Column_definition &new_field,
const KEY_PART_INFO &old_part,
const KEY_PART_INFO &new_part) const
{
if (!old_field.is_equal(new_... | 0 | [
"CWE-416"
] | server | af810407f78b7f792a9bb8c47c8c532eb3b3a758 | 236,749,388,461,105,640,000,000,000,000,000,000,000 | 13 | MDEV-28098 incorrect key in "dup value" error after long unique
reset errkey after using it, so that it wouldn't affect
the next error message in the next statement |
int ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *sk, WPACKET *pkt)
{
int i;
size_t totlen = 0, len, maxlen, maxverok = 0;
int empty_reneg_info_scsv = !s->renegotiate;
/* Set disabled masks for this session */
if (!ssl_set_client_disabled(s)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SS... | 0 | [
"CWE-835"
] | openssl | 758754966791c537ea95241438454aa86f91f256 | 248,351,239,045,101,770,000,000,000,000,000,000,000 | 101 | Fix invalid handling of verify errors in libssl
In the event that X509_verify() returned an internal error result then
libssl would mishandle this and set rwstate to SSL_RETRY_VERIFY. This
subsequently causes SSL_get_error() to return SSL_ERROR_WANT_RETRY_VERIFY.
That return code is supposed to only ever be returned i... |
static CURLcode imap_perform_starttls(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
/* Send the STARTTLS command */
result = imap_sendf(conn, "STARTTLS");
if(!result)
state(conn, IMAP_STARTTLS);
return result;
} | 0 | [
"CWE-119"
] | curl | 13c9a9ded3ae744a1e11cbc14e9146d9fa427040 | 35,797,384,737,945,804,000,000,000,000,000,000,000 | 12 | imap: if a FETCH response has no size, don't call write callback
CVE-2017-1000257
Reported-by: Brian Carpenter and 0xd34db347
Also detected by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3586 |
ex_delcommand(exarg_T *eap)
{
int i = 0;
ucmd_T *cmd = NULL;
int res = -1;
garray_T *gap;
char_u *arg = eap->arg;
int buffer_only = FALSE;
if (STRNCMP(arg, "-buffer", 7) == 0 && VIM_ISWHITE(arg[7]))
{
buffer_only = TRUE;
arg = skipwhite(arg + 7);
}
gap = &curbuf->b_ucmds;
... | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 94,615,025,309,315,670,000,000,000,000,000,000,000 | 49 | 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. |
FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter)
{
/* try and get br->consumed_words and br->consumed_bits into register;
* must remember to flush them back to *br before calling other
* bitreader functions that use them, and before returning */... | 1 | [
"CWE-125"
] | flac | 2e7931c27eb15e387da440a37f12437e35b22dd4 | 173,788,847,374,942,150,000,000,000,000,000,000,000 | 138 | libFLAC/bitreader.c: Fix out-of-bounds read
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17069
Testcase: fuzzer_decoder-5670265022840832 |
static int gpk_get_serialnr(sc_card_t *card, sc_serial_number_t *serial)
{
int r;
u8 rbuf[10];
sc_apdu_t apdu;
if (card->type != SC_CARD_TYPE_GPK_GPK16000)
return SC_ERROR_NOT_SUPPORTED;
if (!serial)
return SC_ERROR_INVALID_ARGUMENTS;
/* see if we have cached serial number */
if (card->serialnr.len) {
m... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 89,342,219,755,274,370,000,000,000,000,000,000,000 | 35 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
void megasas_get_snapdump_properties(struct megasas_instance *instance)
{
int ret = 0;
struct megasas_cmd *cmd;
struct megasas_dcmd_frame *dcmd;
struct MR_SNAPDUMP_PROPERTIES *ci;
dma_addr_t ci_h = 0;
ci = instance->snapdump_prop;
ci_h = instance->snapdump_prop_h;
if (!ci)
return;
cmd = megasas_get_cmd(in... | 0 | [
"CWE-476"
] | linux | bcf3b67d16a4c8ffae0aa79de5853435e683945c | 123,054,141,060,978,850,000,000,000,000,000,000,000 | 73 | scsi: megaraid_sas: return error when create DMA pool failed
when create DMA pool for cmd frames failed, we should return -ENOMEM,
instead of 0.
In some case in:
megasas_init_adapter_fusion()
-->megasas_alloc_cmds()
-->megasas_create_frame_pool
create DMA pool failed,
--> megasas_fre... |
xsltComment(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED) {
xmlChar *value = NULL;
xmlNodePtr commentNode;
int len;
value = xsltEvalTemplateString(ctxt, node, inst);
/* TODO: use or generate the compiled form */
len = xmlS... | 0 | [] | libxslt | 937ba2a3eb42d288f53c8adc211bd1122869f0bf | 64,526,428,161,835,620,000,000,000,000,000,000,000 | 33 | Fix default template processing on namespace nodes |
int decode_layoutreturn(struct xdr_stream *xdr,
struct nfs4_layoutreturn_res *res)
{
return 0;
} | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 168,481,888,347,912,100,000,000,000,000,000,000,000 | 5 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
SetUsrP(tcps_sess_t *pThis, void *pUsr)
{
DEFiRet;
pThis->pUsr = pUsr;
RETiRet;
} | 0 | [
"CWE-787"
] | rsyslog | 89955b0bcb1ff105e1374aad7e0e993faa6a038f | 123,234,056,657,790,960,000,000,000,000,000,000,000 | 6 | net bugfix: potential buffer overrun |
read_value_block_line(vector_t *strvec)
{
size_t word;
char *str;
char *dup;
if (!read_value_block_vec)
read_value_block_vec = vector_alloc();
vector_foreach_slot(strvec, str, word) {
dup = (char *) MALLOC(strlen(str) + 1);
strcpy(dup, str);
vector_alloc_slot(read_value_block_vec);
vector_set_slot(read... | 0 | [
"CWE-59",
"CWE-61"
] | keepalived | 04f2d32871bb3b11d7dc024039952f2fe2750306 | 101,927,122,123,105,050,000,000,000,000,000,000,000 | 16 | When opening files for write, ensure they aren't symbolic links
Issue #1048 identified that if, for example, a non privileged user
created a symbolic link from /etc/keepalvied.data to /etc/passwd,
writing to /etc/keepalived.data (which could be invoked via DBus)
would cause /etc/passwd to be overwritten.
This commit ... |
g_chmod_hex(const char* filename, int flags)
{
#if defined(_WIN32)
return 0;
#else
int fl;
fl = 0;
fl |= (flags & 0x4000) ? S_ISUID : 0;
fl |= (flags & 0x2000) ? S_ISGID : 0;
fl |= (flags & 0x1000) ? S_ISVTX : 0;
fl |= (flags & 0x0400) ? S_IRUSR : 0;
fl |= (flags & 0x0200) ? S_IWUSR : 0;
fl |= (flags... | 0 | [] | xrdp | d8f9e8310dac362bb9578763d1024178f94f4ecc | 137,470,836,082,588,000,000,000,000,000,000,000,000 | 23 | move temp files from /tmp to /tmp/.xrdp |
static unsigned int btrfs_mask_fsflags_for_type(struct inode *inode,
unsigned int flags)
{
if (S_ISDIR(inode->i_mode))
return flags;
else if (S_ISREG(inode->i_mode))
return flags & ~FS_DIRSYNC_FL;
else
return flags & (FS_NODUMP_FL | FS_NOATIME_FL);
} | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 126,344,760,823,778,260,000,000,000,000,000,000,000 | 10 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
static char* oidc_util_get_chunk_cookie_name(request_rec *r,
const char *cookieName, int i) {
return apr_psprintf(r->pool, "%s%s%d", cookieName,
OIDC_COOKIE_CHUNKS_SEPARATOR, i);
} | 0 | [
"CWE-79"
] | mod_auth_openidc | 55ea0a085290cd2c8cdfdd960a230cbc38ba8b56 | 14,480,329,662,244,760,000,000,000,000,000,000,000 | 5 | Add a function to escape Javascript characters |
int meth_unlock(struct transaction_t *txn, void *params)
{
struct meth_params *lparams = (struct meth_params *) params;
int ret = HTTP_NO_CONTENT, r, precond;
const char **hdr, *token;
struct mailbox *mailbox = NULL;
struct dav_data *ddata;
struct index_record record;
const char *etag;
t... | 0 | [] | cyrus-imapd | 6703ff881b6056e0c045a7b795ce8ba1bbb87027 | 14,113,119,753,987,358,000,000,000,000,000,000,000 | 142 | http_dav.c: add 'private' Cache-Control directive for cacheable responses that require authentication |
static int nfs4_xdr_dec_reclaim_complete(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{
struct nfs41_reclaim_complete_res *res = data;
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (!status)
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (!... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 296,571,503,631,502,500,000,000,000,000,000,000,000 | 15 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
static void __dentry_kill(struct dentry *dentry)
{
struct dentry *parent = NULL;
bool can_free = true;
if (!IS_ROOT(dentry))
parent = dentry->d_parent;
/*
* The dentry is now unrecoverably dead to the world.
*/
lockref_mark_dead(&dentry->d_lockref);
/*
* inform the fs via d_prune that this dentry is abo... | 0 | [
"CWE-362",
"CWE-399"
] | linux | 49d31c2f389acfe83417083e1208422b4091cd9e | 230,479,876,527,544,640,000,000,000,000,000,000,000 | 45 | dentry name snapshots
take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified). In either case the pointer to stable
string is stored into the same st... |
void km_state_expired(struct xfrm_state *x, int hard, u32 portid)
{
struct km_event c;
c.data.hard = hard;
c.portid = portid;
c.event = XFRM_MSG_EXPIRE;
km_state_notify(x, &c);
} | 0 | [
"CWE-416"
] | linux | dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 | 107,365,124,443,187,170,000,000,000,000,000,000,000 | 9 | xfrm: clean up xfrm protocol checks
In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().
And, IPSEC_PROTO_ANY is expected to only m... |
static ssize_t qib_write(struct file *fp, const char __user *data,
size_t count, loff_t *off)
{
const struct qib_cmd __user *ucmd;
struct qib_ctxtdata *rcd;
const void __user *src;
size_t consumed, copy = 0;
struct qib_cmd cmd;
ssize_t ret = 0;
void *dest;
if (WARN_ON_ONCE(!ib_safe_file_access(fp)))
retu... | 0 | [
"CWE-284",
"CWE-264"
] | linux | e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 | 102,155,511,955,418,960,000,000,000,000,000,000,000 | 200 | IB/security: Restrict use of the write() interface
The drivers/infiniband stack uses write() as a replacement for
bi-directional ioctl(). This is not safe. There are ways to
trigger write calls that result in the return structure that
is normally written to user space being shunted off to user
specified kernel memory... |
int r_jwe_parse(jwe_t * jwe, const char * jwe_str, int x5u_flags) {
return r_jwe_parsen(jwe, jwe_str, o_strlen(jwe_str), x5u_flags);
} | 0 | [
"CWE-787"
] | rhonabwy | b4c2923a1ba4fabf9b55a89244127e153a3e549b | 283,325,320,667,908,750,000,000,000,000,000,000,000 | 3 | Fix buffer overflow on r_jwe_aesgcm_key_unwrap |
R_API char *r_bin_java_resolve(RBinJavaObj *BIN_OBJ, int idx, ut8 space_bn_name_type) {
// TODO XXX FIXME add a size parameter to the str when it is passed in
RBinJavaCPTypeObj *item = NULL, *item2 = NULL;
char *class_str = NULL,
*name_str = NULL,
*desc_str = NULL,
*string_str = NULL,
*empty = "",
*cp_name = NU... | 0 | [
"CWE-125"
] | radare2 | e9ce0d64faf19fa4e9c260250fbdf25e3c11e152 | 119,721,307,887,440,420,000,000,000,000,000,000,000 | 132 | Fix #10498 - Fix crash in fuzzed java files (#10511) |
int wc_DhParamsToDer(DhKey* key, byte* output, word32* outSz)
{
word32 idx, total;
if (key == NULL || outSz == NULL) {
return BAD_FUNC_ARG;
}
/* determine size */
/* integer - g */
idx = SetASNIntMP(&key->g, -1, NULL);
/* integer - p */
idx += SetASNIntMP(&key->p, -1, NULL);
... | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 52,051,910,550,885,230,000,000,000,000,000,000,000 | 38 | OCSP: improve handling of OCSP no check extension |
MagickExport Image *SparseColorImage(const Image *image,
const ChannelType channel,const SparseColorMethod method,
const size_t number_arguments,const double *arguments,
ExceptionInfo *exception)
{
#define SparseColorTag "Distort/SparseColor"
SparseColorMethod
sparse_method;
double
*coeff;
Image... | 0 | [] | ImageMagick6 | 4eafab89a2742865d770857a9d7434993f65ae6b | 235,411,665,002,462,180,000,000,000,000,000,000,000 | 359 | https://github.com/ImageMagick/ImageMagick/issues/3331 |
static inline u16 skb_get_rx_queue(const struct sk_buff *skb)
{
return skb->queue_mapping - 1; | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 280,085,825,056,135,430,000,000,000,000,000,000,000 | 4 | net: create skb_gso_validate_mac_len()
If you take a GSO skb, and split it into packets, will the MAC
length (L2 + L3 + L4 headers + payload) of those packets be small
enough to fit within a given length?
Move skb_gso_mac_seglen() to skbuff.h with other related functions
like skb_gso_network_seglen() so we can use it... |
static ssize_t vhost_scsi_tpg_show_nexus(struct se_portal_group *se_tpg,
char *page)
{
struct vhost_scsi_tpg *tpg = container_of(se_tpg,
struct vhost_scsi_tpg, se_tpg);
struct vhost_scsi_nexus *tv_nexus;
ssize_t ret;
mutex_lock(&tpg->tv_tpg_mutex);
tv_nexus = tpg->tpg_nexus;
if (!tv_nexus) {
mutex_unl... | 0 | [
"CWE-200",
"CWE-119"
] | linux | 59c816c1f24df0204e01851431d3bab3eb76719c | 75,478,919,680,200,375,000,000,000,000,000,000,000 | 20 | vhost/scsi: potential memory corruption
This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.
I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] arr... |
bool BatchnormSpatialPersistentEnabled() {
static bool is_enabled = [] {
bool is_enabled = false;
TF_CHECK_OK(tensorflow::ReadBoolFromEnvVar(
"TF_USE_CUDNN_BATCHNORM_SPATIAL_PERSISTENT",
/*default_val=*/false, &is_enabled));
return is_enabled;
}();
return is_enabled;
} | 0 | [
"CWE-20"
] | tensorflow | 14755416e364f17fb1870882fa778c7fec7f16e3 | 48,044,174,242,642,950,000,000,000,000,000,000,000 | 10 | Prevent CHECK-fail in LSTM/GRU with zero-length input.
PiperOrigin-RevId: 346239181
Change-Id: I5f233dbc076aab7bb4e31ba24f5abd4eaf99ea4f |
host_read_d2i (SF_PRIVATE *psf, int *ptr, sf_count_t len)
{ BUF_UNION ubuf ;
void (*convert) (const double *, int, int *, double) ;
int bufferlen, readcount ;
sf_count_t total = 0 ;
double scale ;
convert = (psf->add_clipping) ? d2i_clip_array : d2i_array ;
bufferlen = ARRAY_LEN (ubuf.dbuf) ;
scale = (psf->... | 0 | [
"CWE-369"
] | libsndfile | 85c877d5072866aadbe8ed0c3e0590fbb5e16788 | 276,395,694,685,438,200,000,000,000,000,000,000,000 | 28 | double64_init: Check psf->sf.channels against upper bound
This prevents division by zero later in the code.
While the trivial case to catch this (i.e. sf.channels < 1) has already
been covered, a crafted file may report a number of channels that is
so high (i.e. > INT_MAX/sizeof(double)) that it "somehow" gets
miscal... |
static void *m_start(struct seq_file *m, loff_t *pos)
{
struct mnt_namespace *n = m->private;
struct list_head *p;
loff_t l = *pos;
down_read(&namespace_sem);
list_for_each(p, &n->list)
if (!l--)
return list_entry(p, struct vfsmount, mnt_list);
return NULL;
} | 0 | [
"CWE-269"
] | linux-2.6 | ee6f958291e2a768fd727e7a67badfff0b67711a | 209,915,526,507,136,000,000,000,000,000,000,000,000 | 12 | check privileges before setting mount propagation
There's a missing check for CAP_SYS_ADMIN in do_change_type().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torva... |
longlong Item_func_truth::val_int()
{
return (val_bool() ? 1 : 0);
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 22,881,578,410,792,343,000,000,000,000,000,000,000 | 4 | 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 ... |
static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
struct virtio_net_hdr *vnet_hdr)
{
memset(vnet_hdr, 0, sizeof(*vnet_hdr));
if (skb_is_gso(skb)) {
struct skb_shared_info *sinfo = skb_shinfo(skb);
/* This is a hint as to how much should be linear. */
vnet_hdr->hdr_len = skb_headlen(skb);
... | 0 | [
"CWE-119",
"CWE-787"
] | linux | b92946e2919134ebe2a4083e4302236295ea2a73 | 269,575,871,868,940,480,000,000,000,000,000,000,000 | 34 | macvtap: zerocopy: validate vectors before building skb
There're several reasons that the vectors need to be validated:
- Return error when caller provides vectors whose num is greater than UIO_MAXIOV.
- Linearize part of skb when userspace provides vectors grater than MAX_SKB_FRAGS.
- Return error when userspace pro... |
static NOINLINE void read_config(const char *file)
{
parser_t *parser;
const struct config_keyword *k;
unsigned i;
char *token[2];
for (i = 0; i < KWS_WITH_DEFAULTS; i++)
keywords[i].handler(keywords[i].def, (char*)&server_config + keywords[i].ofs);
parser = config_open(file);
while (config_read(parser, toke... | 0 | [
"CWE-125"
] | busybox | 6d3b4bb24da9a07c263f3c1acf8df85382ff562c | 32,162,623,763,232,003,000,000,000,000,000,000,000 | 29 | udhcpc: check that 4-byte options are indeed 4-byte, closes 11506
function old new delta
udhcp_get_option32 - 27 +27
udhcp_get_option 231 248 +17
----------------------------------... |
TEST_P(MessengerTest, AuthTest) {
g_ceph_context->_conf->set_val("auth_cluster_required", "cephx");
g_ceph_context->_conf->set_val("auth_service_required", "cephx");
g_ceph_context->_conf->set_val("auth_client_required", "cephx");
FakeDispatcher cli_dispatcher(false), srv_dispatcher(true);
entity_addr_t bind_... | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 32,011,443,139,945,900,000,000,000,000,000,000,000 | 50 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
{
struct smb2_tree_disconnect_req *req; /* response is trivial */
int rc = 0;
struct TCP_Server_Info *server;
struct cifs_ses *ses = tcon->ses;
cifs_dbg(FYI, "Tree Disconnect\n");
if (ses && (ses->server))
server = ses->server;
else
return -EIO;
i... | 0 | [
"CWE-399"
] | linux | 18f39e7be0121317550d03e267e3ebd4dbfbb3ce | 122,555,094,405,726,160,000,000,000,000,000,000,000 | 27 | [CIFS] Possible null ptr deref in SMB2_tcon
As Raphael Geissert pointed out, tcon_error_exit can dereference tcon
and there is one path in which tcon can be null.
Signed-off-by: Steve French <smfrench@gmail.com>
CC: Stable <stable@vger.kernel.org> # v3.7+
Reported-by: Raphael Geissert <geissert@debian.org> |
static char *parse_params(
imp_xxh_t *imp_xxh,
pTHX_ MYSQL *sock,
char *statement,
STRLEN *slen_ptr,
imp_sth_ph_t* params,
int num_params,
... | 0 | [
"CWE-119"
] | DBD-mysql | 7c164a0c86cec6ee95df1d141e67b0e85dfdefd2 | 115,657,738,885,928,500,000,000,000,000,000,000,000 | 280 | Do not use unsafe sprintf w/variable length input
This can cause a buffer overflow to occur when reporting error
message about validation of (untrusted) user input parameters. |
static int __cpuinit sched_cpu_active(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_ONLINE:
case CPU_DOWN_FAILED:
set_cpu_active((long)hcpu, true);
return NOTIFY_OK;
default:
return NOTIFY_DONE;
}
} | 0 | [
"CWE-703",
"CWE-835"
] | linux | f26f9aff6aaf67e9a430d16c266f91b13a5bff64 | 103,283,702,235,570,820,000,000,000,000,000,000,000 | 12 | Sched: fix skip_clock_update optimization
idle_balance() drops/retakes rq->lock, leaving the previous task
vulnerable to set_tsk_need_resched(). Clear it after we return
from balancing instead, and in setup_thread_stack() as well, so
no successfully descheduled or never scheduled task has it set.
Need resched confus... |
CacheManager::start(const Comm::ConnectionPointer &client, HttpRequest *request, StoreEntry *entry, const AccessLogEntry::Pointer &ale)
{
debugs(16, 3, "request-url= '" << request->url << "', entry-url='" << entry->url() << "'");
Mgr::Command::Pointer cmd;
try {
cmd = ParseUrl(request->url);
}... | 0 | [
"CWE-401"
] | squid | 26e65059bc06ebce508737b5cd0866478691566a | 31,159,632,454,837,985,000,000,000,000,000,000,000 | 116 | Bug 5106: Broken cache manager URL parsing (#788)
Use already parsed request-target URL in cache manager and
update CacheManager to Tokanizer based URL parse
Removing use of sscan() and regex string processing which have
proven to be problematic on many levels. Most particularly with
regards to tolerance of normally ... |
void Box_ipma::add_property_for_item_ID(heif_item_id itemID,
PropertyAssociation assoc)
{
size_t idx;
for (idx=0; idx<m_entries.size(); idx++) {
if (m_entries[idx].item_ID == itemID) {
break;
}
}
// if itemID does not exist, add a new entry
if (idx == m_e... | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 268,280,935,520,809,930,000,000,000,000,000,000,000 | 20 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
coolkey_v0_get_attribute_record_len(const u8 *attr, size_t buf_len)
{
size_t attribute_len = sizeof(coolkey_v0_attribute_header_t);
size_t len;
int r;
r = coolkey_v0_get_attribute_len(attr, buf_len, &len);
if (r < 0) {
return buf_len; /* skip to the end, ignore the rest of the record */
}
return MIN(buf_len,a... | 0 | [
"CWE-415"
] | OpenSC | c246f6f69a749d4f68626b40795a4f69168008f4 | 288,536,283,265,581,060,000,000,000,000,000,000,000 | 12 | coolkey: Make sure the object ID is unique when filling list
Thanks to oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19208 |
int ram_block_discard_require(bool state)
{
int old;
if (!state) {
qatomic_inc(&ram_block_discard_disabled);
return 0;
}
do {
old = qatomic_read(&ram_block_discard_disabled);
if (old > 0) {
return -EBUSY;
}
} while (qatomic_cmpxchg(&ram_block_dis... | 0 | [
"CWE-787"
] | qemu | 4bfb024bc76973d40a359476dc0291f46e435442 | 330,367,228,521,712,600,000,000,000,000,000,000,000 | 18 | memory: clamp cached translation in case it points to an MMIO region
In using the address_space_translate_internal API, address_space_cache_init
forgot one piece of advice that can be found in the code for
address_space_translate_internal:
/* MMIO registers can be expected to perform full-width accesses based onl... |
PHP_FUNCTION(exif_tagname)
{
zend_long tag;
char *szTemp;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &tag) == FAILURE) {
return;
}
szTemp = exif_get_tagname(tag, tag_table_IFD);
if (tag < 0 || !szTemp) {
RETURN_FALSE;
}
RETURN_STRING(szTemp);
} | 0 | [
"CWE-125"
] | php-src | 0c77b4307df73217283a4aaf9313e1a33a0967ff | 165,016,992,594,466,370,000,000,000,000,000,000,000 | 16 | Fixed bug #79282 |
static void *find_audio_control_unit(struct mixer_build *state,
unsigned char unit)
{
/* we just parse the header */
struct uac_feature_unit_descriptor *hdr = NULL;
while ((hdr = snd_usb_find_desc(state->buffer, state->buflen, hdr,
USB_DT_CS_INTERFACE)) != NULL) {
if (hdr->bLength >= 4 &&
hdr-... | 0 | [
"CWE-416",
"CWE-787"
] | linux | 124751d5e63c823092060074bd0abaae61aaa9c4 | 143,660,575,412,500,600,000,000,000,000,000,000,000 | 17 | ALSA: usb-audio: Kill stray URB at exiting
USB-audio driver may leave a stray URB for the mixer interrupt when it
exits by some error during probe. This leads to a use-after-free
error as spotted by syzkaller like:
==================================================================
BUG: KASAN: use-after-free in sn... |
oop MethodHandles::field_name_or_null(Symbol* s) {
if (s == NULL) return NULL;
return StringTable::lookup(s);
} | 0 | [] | jdk8u | f14e35d20e1a4d0f507f05838844152f2242c6d3 | 61,400,460,014,867,245,000,000,000,000,000,000,000 | 4 | 8281866: Enhance MethodHandle invocations
Reviewed-by: andrew
Backport-of: d974d9da365f787f67971d88c79371c8b0769f75 |
term_and_job_init(
term_T *term,
typval_T *argvar,
char **argv,
jobopt_T *opt,
jobopt_T *orig_opt UNUSED)
{
create_vterm(term, term->tl_rows, term->tl_cols);
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
if (opt->jo_set2 & JO2_ANSI_COLORS)
set_vterm_palette(term->tl_vterm, opt->jo... | 1 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 131,281,597,708,076,280,000,000,000,000,000,000,000 | 25 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
static int lrw_aesni_setkey(struct crypto_tfm *tfm, const u8 *key,
unsigned int keylen)
{
struct aesni_lrw_ctx *ctx = crypto_tfm_ctx(tfm);
int err;
err = aes_set_key_common(tfm, ctx->raw_aes_ctx, key,
keylen - AES_BLOCK_SIZE);
if (err)
return err;
return lrw_init_table(&ctx->lrw_table, key + keylen... | 0 | [
"CWE-119",
"CWE-787"
] | linux | ccfe8c3f7e52ae83155cb038753f4c75b774ca8a | 156,412,361,556,184,080,000,000,000,000,000,000,000 | 13 | crypto: aesni - fix memory usage in GCM decryption
The kernel crypto API logic requires the caller to provide the
length of (ciphertext || authentication tag) as cryptlen for the
AEAD decryption operation. Thus, the cipher implementation must
calculate the size of the plaintext output itself and cannot simply use
cryp... |
static int _db_tree_add(struct db_arg_chain_tree **existing,
struct db_arg_chain_tree *new,
struct db_iter_state *state)
{
int rc;
struct db_arg_chain_tree *x_iter = *existing;
struct db_arg_chain_tree *n_iter = new;
do {
if (_db_chain_eq(x_iter, n_iter)) {
if (n_iter->act_t_flg) {
if (!x_iter->act_... | 0 | [] | libseccomp | c5bf78de480b32b324e0f511c88ce533ed280b37 | 68,156,524,767,053,630,000,000,000,000,000,000,000 | 136 | db: fix 64-bit argument comparisons
Our approach to doing 64-bit comparisons using 32-bit operators was
just plain wrong, leading to a number of potential problems with
filters that used the LT, GT, LE, or GE operators. This patch fixes
this problem and a few other related issues that came to light in
the course of f... |
static noinline void wait_for_commit(struct btrfs_root *root,
struct btrfs_transaction *commit)
{
wait_event(commit->commit_wait, commit->commit_done);
} | 0 | [
"CWE-310"
] | linux-2.6 | 9c52057c698fb96f8f07e7a4bcf4801a092bda89 | 291,768,918,230,408,370,000,000,000,000,000,000,000 | 5 | Btrfs: fix hash overflow handling
The handling for directory crc hash overflows was fairly obscure,
split_leaf returns EOVERFLOW when we try to extend the item and that is
supposed to bubble up to userland. For a while it did so, but along the
way we added better handling of errors and forced the FS readonly if we
hi... |
bool Shortcut::operator == (const Shortcut &other) const {
return (iIndex == other.iIndex) && (qlButtons == other.qlButtons) && (qvData == other.qvData) && (bSuppress == other.bSuppress);
} | 0 | [
"CWE-310"
] | mumble | 5632c35d6759f5e13a7dfe78e4ee6403ff6a8e3e | 306,654,408,108,026,660,000,000,000,000,000,000,000 | 3 | Explicitly remove file permissions for settings and DB |
strcmpic(const uschar *s, const uschar *t)
{
while (*s != 0)
{
int c = tolower(*s++) - tolower(*t++);
if (c != 0) return c;
}
return *t;
} | 0 | [
"CWE-264"
] | exim | 43ba2742c700d625dcdcdaf7bbadc2f72776854a | 11,950,799,382,698,432,000,000,000,000,000,000,000 | 9 | Fix CVE-2016-1531
Add keep_environment, add_environment.
Change the working directory to "/" during the early startup
phase.
(cherry picked from commit bc3c7bb7d4aba3e563434e5627fe1f2176aa18c0)
(cherry picked from commit 2b92b67bfc33efe05e6ff2ea3852731ac2273832)
(cherry picked from commit 14b82c8b736c8ed24eda... |
static void fd_watchdog(void)
{
debug_dcl(DP->flags, "calling disk change from watchdog\n");
if (disk_change(current_drive)) {
DPRINT("disk removed during i/o\n");
cancel_activity();
cont->done(0);
reset_fdc();
} else {
cancel_delayed_work(&fd_timer);
fd_timer_fn = fd_watchdog;
queue_delayed_work(flop... | 0 | [
"CWE-264",
"CWE-754"
] | linux | ef87dbe7614341c2e7bfe8d32fcb7028cc97442c | 119,982,253,070,867,370,000,000,000,000,000,000,000 | 15 | floppy: ignore kernel-only members in FDRAWCMD ioctl input
Always clear out these floppy_raw_cmd struct members after copying the
entire structure from userspace so that the in-kernel version is always
valid and never left in an interdeterminate state.
Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: L... |
int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen,
pgpDigParams mainkey, pgpDigParams **subkeys,
int *subkeysCount)
{
const uint8_t *p = pkts;
const uint8_t *pend = pkts + pktlen;
pgpDigParams *digps = NULL;
int count = 0;
int alloced = 10;
struct pgpPkt pkt;
int rc, i;
d... | 0 | [
"CWE-347",
"CWE-284"
] | rpm | bd36c5dc9fb6d90c46fbfed8c2d67516fc571ec8 | 295,489,270,767,095,340,000,000,000,000,000,000,000 | 55 | Validate and require subkey binding signatures on PGP public keys
All subkeys must be followed by a binding signature by the primary key
as per the OpenPGP RFC, enforce the presence and validity in the parser.
The implementation is as kludgey as they come to work around our
simple-minded parser structure without touc... |
get_selected_ews_source (EShellView *shell_view,
ESource **selected_source,
ESourceRegistry **registry)
{
ESource *source;
EShellSidebar *shell_sidebar;
ESourceSelector *selector = NULL;
g_return_val_if_fail (shell_view != NULL, FALSE);
shell_sidebar = e_shell_vi... | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 318,349,369,327,298,230,000,000,000,000,000,000,000 | 50 | I#27 - SSL Certificates are not validated
This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too.
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27 |
virtual Item *copy_andor_structure(THD *thd) { return this; } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 28,817,195,429,986,580,000,000,000,000,000,000,000 | 1 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
TEST_F(QueryPlannerTest, ProjNonCovering) {
addIndex(BSON("x" << 1));
runQuerySortProj(fromjson("{ x : {$gt: 1}}"), BSONObj(), fromjson("{x: 1}"));
ASSERT_EQUALS(getNumSolutions(), 2U);
assertSolutionExists(
"{proj: {spec: {x: 1}, node: {cscan: "
"{dir: 1, filter: {x: {$gt: 1}}}}}}");
... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 291,102,650,667,039,670,000,000,000,000,000,000,000 | 12 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
{
ext4_group_t prefetch_grp = 0, ngroups, group, i;
int cr = -1;
int err = 0, first_err = 0;
unsigned int nr = 0, prefetch_ios = 0;
struct ext4_sb_info *sbi;
struct super_block *sb;
struct ext4_buddy e4b;
sb = ac->ac_sb;
sbi = EXT4_SB(sb);
ngroups... | 0 | [
"CWE-703"
] | linux | ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1 | 89,317,021,967,136,540,000,000,000,000,000,000,000 | 188 | ext4: check journal inode extents more carefully
Currently, system zones just track ranges of block, that are "important"
fs metadata (bitmaps, group descriptors, journal blocks, etc.). This
however complicates how extent tree (or indirect blocks) can be checked
for inodes that actually track such metadata - currently... |
static long cuse_file_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct fuse_file *ff = file->private_data;
struct cuse_conn *cc = fc_to_cc(ff->fc);
unsigned int flags = 0;
if (cc->unrestricted_ioctl)
flags |= FUSE_IOCTL_UNRESTRICTED;
return fuse_do_ioctl(file, cmd, arg, flags);
} | 0 | [
"CWE-399"
] | linux | 2c5816b4beccc8ba709144539f6fdd764f8fa49c | 337,184,767,361,112,520,000,000,000,000,000,000,000 | 12 | cuse: fix memory leak
The problem is that fuse_dev_alloc() acquires an extra reference to cc.fc,
and the original ref count is never dropped.
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Fixes: cc080e9e9be1 ("fuse: introduce per-instance fuse_dev structure")... |
static int ctnetlink_new_conntrack(struct net *net, struct sock *ctnl,
struct sk_buff *skb,
const struct nlmsghdr *nlh,
const struct nlattr * const cda[],
struct netlink_ext_ack *extack)
{
struct nf_conntrack_tuple otuple, rtuple;
struct nf_conntrack_tuple_hash *h = NULL;
struct nfgenmsg ... | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 60,547,082,130,150,590,000,000,000,000,000,000,000 | 100 | netfilter: ctnetlink: add a range check for l3/l4 protonum
The indexes to the nf_nat_l[34]protos arrays come from userspace. So
check the tuple's family, e.g. l3num, when creating the conntrack in
order to prevent an OOB memory access during setup. Here is an example
kernel panic on 4.14.180 when userspace passes in ... |
int snd_pcm_drain_done(struct snd_pcm_substream *substream)
{
return snd_pcm_action_single(&snd_pcm_action_stop, substream,
SNDRV_PCM_STATE_SETUP);
} | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 281,016,760,488,625,970,000,000,000,000,000,000,000 | 5 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
tty_colours_fg(struct tty *tty, const struct grid_cell *gc)
{
struct grid_cell *tc = &tty->cell;
char s[32];
/* Is this a 24-bit or 256-colour colour? */
if (gc->fg & COLOUR_FLAG_RGB || gc->fg & COLOUR_FLAG_256) {
if (tty_try_colour(tty, gc->fg, "38") == 0)
goto save_fg;
/* Should not get here, already c... | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 83,248,745,793,822,210,000,000,000,000,000,000,000 | 27 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
void OSD::need_heartbeat_peer_update()
{
if (is_stopping())
return;
dout(20) << "need_heartbeat_peer_update" << dendl;
heartbeat_set_peers_need_update();
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 29,520,351,560,528,740,000,000,000,000,000,000,000 | 7 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
send_negotiate_unix_fd (DBusAuth *auth)
{
if (!_dbus_string_append (&auth->outgoing,
"NEGOTIATE_UNIX_FD\r\n"))
return FALSE;
goto_state (auth, &client_state_waiting_for_agree_unix_fd);
return TRUE;
} | 0 | [
"CWE-59"
] | dbus | 47b1a4c41004bf494b87370987b222c934b19016 | 211,004,237,085,498,600,000,000,000,000,000,000,000 | 9 | auth: Reject DBUS_COOKIE_SHA1 for users other than the server owner
The DBUS_COOKIE_SHA1 authentication mechanism aims to prove ownership
of a shared home directory by having the server write a secret "cookie"
into a .dbus-keyrings subdirectory of the desired identity's home
directory with 0700 permissions, and having... |
hyphenGetNewState (HyphenDict * dict, HyphenHashTab * hashTab, const
CharsString * string)
{
hyphenHashInsert (hashTab, string, dict->numStates);
/* predicate is true if dict->numStates is a power of two */
if (!(dict->numStates & (dict->numStates - 1)))
dict->states = realloc (dict->states, (dict->numSt... | 0 | [] | liblouis | dc97ef791a4fae9da11592c79f9f79e010596e0c | 319,944,629,326,607,030,000,000,000,000,000,000,000 | 16 | Merge branch 'table_resolver' |
max_min(typval_T *argvars, typval_T *rettv, int domax)
{
varnumber_T n = 0;
varnumber_T i;
int error = FALSE;
if (argvars[0].v_type == VAR_LIST)
{
list_T *l;
listitem_T *li;
l = argvars[0].vval.v_list;
if (l != NULL)
{
li = l->lv_first;
if (li != NULL)
{
n = tv_get_number_c... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 90,876,544,461,517,610,000,000,000,000,000,000,000 | 62 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
static int StreamTcpTest42 (void)
{
int ret = 0;
Flow f;
ThreadVars tv;
StreamTcpThread stt;
TCPHdr tcph;
PacketQueue pq;
Packet *p = SCMalloc(SIZE_OF_PACKET);
TcpSession *ssn;
if (unlikely(p == NULL))
return 0;
memset(p, 0, SIZE_OF_PACKET);
memset(&pq,0,sizeof(Pack... | 0 | [] | suricata | 843d0b7a10bb45627f94764a6c5d468a24143345 | 2,677,052,087,697,591,400,000,000,000,000,000,000 | 90 | stream: support RST getting lost/ignored
In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'.
However, the target of the RST may not have received it, or may not
have accepted it. Also, the RST may have been injected, so the supposed
sender may not actually be aware of the RST that was sent in it's ... |
iso9660_write_data(struct archive_write *a, const void *buff, size_t s)
{
struct iso9660 *iso9660 = a->format_data;
ssize_t r;
if (iso9660->cur_file == NULL)
return (0);
if (archive_entry_filetype(iso9660->cur_file->entry) != AE_IFREG)
return (0);
if (s > iso9660->bytes_remaining)
s = (size_t)iso9660->bytes... | 0 | [
"CWE-190"
] | libarchive | 3014e19820ea53c15c90f9d447ca3e668a0b76c6 | 68,958,827,732,297,690,000,000,000,000,000,000,000 | 19 | Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives
* Don't cast size_t to int, since this can lead to overflow
on machines where sizeof(int) < sizeof(size_t)
* Check a + b > limit by writing it as
a > limit || b > limit || a + b > limit
to avoid problems when a + b wraps... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.