func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static unsigned long klsi_105_status2linestate(const __u16 status)
{
unsigned long res = 0;
res = ((status & KL5KUSB105A_DSR) ? TIOCM_DSR : 0)
| ((status & KL5KUSB105A_CTS) ? TIOCM_CTS : 0)
;
return res;
} | 0 | [
"CWE-532"
] | linux | 146cc8a17a3b4996f6805ee5c080e7101277c410 | 162,444,118,350,895,880,000,000,000,000,000,000,000 | 10 | 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... |
void Item_udf_sum::print(String *str, enum_query_type query_type)
{
str->append(func_name());
str->append('(');
for (uint i=0 ; i < arg_count ; i++)
{
if (i)
str->append(',');
args[i]->print(str, query_type);
}
str->append(')');
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 53,473,914,784,083,170,000,000,000,000,000,000,000 | 12 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
struct urb *urb;
u32 val32;
int ret;
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb)
return -ENOMEM;
usb_fill_int_urb(urb, priv->udev, priv->pipe_interrupt,
priv->int_buf, USB_INTR_CONTENT_LENGTH,
rtl8x... | 1 | [
"CWE-400",
"CWE-401"
] | linux | a2cdd07488e666aa93a49a3fc9c9b1299e27ef3c | 163,893,258,625,798,130,000,000,000,000,000,000,000 | 28 | rtl8xxxu: prevent leaking urb
In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb
should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org> |
const UUIDCommand* Binary::uuid() const {
return command<UUIDCommand>();
} | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 230,931,105,060,472,560,000,000,000,000,000,000,000 | 3 | Resolve #764 |
static int count(struct user_arg_ptr argv, int max)
{
int i = 0;
if (argv.ptr.native != NULL) {
for (;;) {
const char __user *p = get_user_arg_ptr(argv, i);
if (!p)
break;
if (IS_ERR(p))
return -EFAULT;
if (i++ >= max)
return -E2BIG;
if (fatal_signal_pending(current))
return -ERE... | 0 | [
"CWE-200"
] | linux-2.6 | b66c5984017533316fd1951770302649baf1aa33 | 153,469,446,062,384,060,000,000,000,000,000,000,000 | 24 | exec: do not leave bprm->interp on stack
If a series of scripts are executed, each triggering module loading via
unprintable bytes in the script header, kernel stack contents can leak
into the command line.
Normally execution of binfmt_script and binfmt_misc happens recursively.
However, when modules are enabled, and... |
Magick::Blob Magick::Image::iptcProfile(void) const
{
const StringInfo
*iptc_profile;
iptc_profile=GetImageProfile(constImage(),"iptc");
if (iptc_profile == (StringInfo *) NULL)
return(Blob());
return(Blob(GetStringInfoDatum(iptc_profile),GetStringInfoLength(
iptc_profile)));
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 326,438,746,177,659,020,000,000,000,000,000,000,000 | 11 | Added missing return to avoid use after free. |
bool LEX::stmt_install_plugin(const DDL_options_st &opt,
const Lex_ident_sys_st &name,
const LEX_CSTRING &soname)
{
create_info.init();
if (add_create_options_with_check(opt))
return true;
sql_command= SQLCOM_INSTALL_PLUGIN;
comment= name;
ident=... | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 194,684,559,719,010,600,000,000,000,000,000,000,000 | 12 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int len, err = 0;
struct bt_voice voice;
u32 opt;
BT_DBG("sk %p", sk);
lock_sock(sk);
switch (optname) {
case BT_DEFER_SETUP:
if (sk->sk_state != BT_BOUND && ... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 121,962,857,973,922,740,000,000,000,000,000,000,000 | 63 | 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... |
XML_ErrorString(enum XML_Error code) {
switch (code) {
case XML_ERROR_NONE:
return NULL;
case XML_ERROR_NO_MEMORY:
return XML_L("out of memory");
case XML_ERROR_SYNTAX:
return XML_L("syntax error");
case XML_ERROR_NO_ELEMENTS:
return XML_L("no element found");
case XML_ERROR_INVALID_TOKEN:
... | 0 | [
"CWE-611",
"CWE-776",
"CWE-415",
"CWE-125"
] | libexpat | c20b758c332d9a13afbbb276d30db1d183a85d43 | 150,590,385,636,243,200,000,000,000,000,000,000,000 | 95 | xmlparse.c: Deny internal entities closing the doctype |
debug_stack(PInfo pi, const char *comment) {
char indent[128];
Helper h;
fill_indent(pi, indent, sizeof(indent));
printf("%s%s\n", indent, comment);
if (!helper_stack_empty(&pi->helpers)) {
for (h = pi->helpers.head; h < pi->helpers.tail; h++) {
const char *clas = "---";
const char *key ... | 0 | [
"CWE-20"
] | ox | e4565dbc167f0d38c3f93243d7a4fcfc391cbfc8 | 69,203,071,539,051,700,000,000,000,000,000,000,000 | 32 | Avoid crash with invalid XML passed to Oj.parse_obj() |
set_up_automatic_login_session_if_user_exists (GdmManager *manager,
GdmDisplay *display,
ActUser *user)
{
if (act_user_is_nonexistent (user))
set_up_greeter_session (manager, display);
else
... | 0 | [] | gdm | ff98b2817014684ae1acec78ff06f0f461a56a9f | 139,691,113,183,824,990,000,000,000,000,000,000,000 | 9 | manager: if falling back to X11 retry autologin
Right now, we get one shot to autologin. If it fails, we fall back to
the greeter. We should give it another go if the reason for the failure
was wayland fallback to X.
https://bugzilla.gnome.org/show_bug.cgi?id=780520 |
int unit_load_fragment_and_dropin_optional(Unit *u) {
int r;
assert(u);
/* Same as unit_load_fragment_and_dropin(), but whether
* something can be loaded or not doesn't matter. */
/* Load a .service/.socket/.slice/… file */
r = unit_load_fragment(u);
if (r < 0... | 0 | [
"CWE-269"
] | systemd | bf65b7e0c9fc215897b676ab9a7c9d1c688143ba | 275,162,411,901,405,020,000,000,000,000,000,000,000 | 19 | core: imply NNP and SUID/SGID restriction for DynamicUser=yes service
Let's be safe, rather than sorry. This way DynamicUser=yes services can
neither take benefit of, nor create SUID/SGID binaries.
Given that DynamicUser= is a recent addition only we should be able to
get away with turning this on, even though this i... |
}
GF_Err jp2h_box_read(GF_Box *s,GF_BitStream *bs)
{
return gf_isom_box_array_read_ex(s, bs, jp2h_on_child_box, s->type); | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 304,848,788,455,124,000,000,000,000,000,000,000,000 | 4 | fixed #1587 |
int32_t cli_bcapi_get_pe_section(struct cli_bc_ctx *ctx, struct cli_exe_section* section, uint32_t num)
{
if (num < ctx->hooks.pedata->nsections) {
memcpy(section, &ctx->sections[num], sizeof(*section));
return 0;
}
return -1;
} | 0 | [
"CWE-189"
] | clamav-devel | 3d664817f6ef833a17414a4ecea42004c35cc42f | 155,609,823,279,396,360,000,000,000,000,000,000,000 | 8 | fix recursion level crash (bb #3706).
Thanks to Stephane Chazelas for the analysis. |
unsigned find_best_partition_order_(
FLAC__StreamEncoderPrivate *private_,
const FLAC__int32 residual[],
FLAC__uint64 abs_residual_partition_sums[],
unsigned raw_bits_per_partition[],
unsigned residual_samples,
unsigned predictor_order,
unsigned rice_parameter,
unsigned rice_parameter_limit,
unsigned min_parti... | 0 | [] | flac | c06a44969c1145242a22f75fc8fb2e8b54c55303 | 34,083,471,900,656,240,000,000,000,000,000,000,000 | 96 | flac : Fix for https://sourceforge.net/p/flac/bugs/425/
* flac/encode.c : Validate num_tracks field of cuesheet.
* libFLAC/stream_encoder.c : Add check for a NULL pointer.
* flac/encode.c : Improve bounds checking.
Closes: https://sourceforge.net/p/flac/bugs/425/ |
snmpAddNodeStr(const char *base_str, int o, oid_ParseFn * parsefunction, instance_Fn * instancefunction, AggrType aggrType)
{
mib_tree_entry *m, *b;
oid *n;
int nl;
char s[1024];
/* Find base node */
b = snmpLookupNodeStr(mib_tree_head, base_str);
if (! b)
return NULL;
debugs(49... | 0 | [
"CWE-772"
] | squid | 983c5c36e5f109512ed1af38a329d0b5d0967498 | 328,575,986,030,752,300,000,000,000,000,000,000,000 | 27 | Fix memory leak when parsing SNMP packet (#313)
SNMP queries denied by snmp_access rules and queries with certain
unsupported SNMPv2 commands were leaking a few hundred bytes each. Such
queries trigger "SNMP agent query DENIED from..." WARNINGs in cache.log. |
ctmbstr TY_(HTMLVersionNameFromCode)( uint vers, Bool ARG_UNUSED(isXhtml) )
{
ctmbstr name = GetNameFromVers(vers);
/* this test has moved to ReportMarkupVersion() in localize.c, for localization reasons */
/*
if (!name)
name = "HTML Proprietary";
*/
return name;
} | 0 | [
"CWE-119"
] | tidy-html5 | c18f27a58792f7fbd0b30a0ff50d6b40a82f940d | 122,595,455,441,469,620,000,000,000,000,000,000,000 | 12 | Issue #217 - avoid len going negative, ever... |
void run(OperationContext* opCtx, rpc::ReplyBuilderInterface* result) {
// Although it is a command, a find command gets counted as a query.
globalOpCounters.gotQuery();
// Parse the command BSON to a QueryRequest.
const bool isExplain = false;
// Pas... | 0 | [
"CWE-20"
] | mongo | 722f06f3217c029ef9c50062c8cc775966fd7ead | 300,925,784,519,069,870,000,000,000,000,000,000,000 | 199 | SERVER-38275 ban find explain with UUID |
xsltParseStylesheetPI(const xmlChar *value) {
const xmlChar *cur;
const xmlChar *start;
xmlChar *val;
xmlChar tmp;
xmlChar *href = NULL;
int isXml = 0;
if (value == NULL)
return(NULL);
cur = value;
while (CUR != 0) {
SKIP_BLANKS;
if ((CUR == 't') && (NXT(1) == 'y') && (NXT(2) ==... | 0 | [] | libxslt | e03553605b45c88f0b4b2980adfbbb8f6fca2fd6 | 169,663,307,626,476,720,000,000,000,000,000,000,000 | 74 | Fix security framework bypass
xsltCheckRead and xsltCheckWrite return -1 in case of error but callers
don't check for this condition and allow access. With a specially
crafted URL, xsltCheckRead could be tricked into returning an error
because of a supposedly invalid URL that would still be loaded
succesfully later on... |
struct resource_pool *dce83_create_resource_pool(
uint8_t num_virtual_links,
struct dc *dc)
{
struct dce110_resource_pool *pool =
kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL);
if (!pool)
return NULL;
if (dce83_construct(num_virtual_links, dc, pool))
return &pool->base;
BREAK_TO_DEBUGGER();
r... | 0 | [
"CWE-400",
"CWE-703",
"CWE-401"
] | linux | 055e547478a11a6360c7ce05e2afc3e366968a12 | 241,643,073,404,320,120,000,000,000,000,000,000,000 | 16 | drm/amd/display: memory leak
In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated
clk_src needs release.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
BOOLEAN ParaNdis_BindRxBufferToPacket(
PARANDIS_ADAPTER *pContext,
pRxNetDescriptor p)
{
ULONG i;
PMDL *NextMdlLinkage = &p->Holder;
for(i = PARANDIS_FIRST_RX_DATA_PAGE; i < p->PagesAllocated; i++)
{
*NextMdlLinkage = NdisAllocateMdl(pContext->MiniportHandle, p->PhysicalPages[i].Virtual... | 0 | [
"CWE-20"
] | kvm-guest-drivers-windows | 723416fa4210b7464b28eab89cc76252e6193ac1 | 214,642,863,043,198,000,000,000,000,000,000,000,000 | 23 | NetKVM: BZ#1169718: Checking the length only on read
Signed-off-by: Joseph Hindin <yhindin@rehat.com> |
static int jas_icctxt_getsize(jas_iccattrval_t *attrval)
{
jas_icctxt_t *txt = &attrval->data.txt;
return JAS_CAST(int, strlen(txt->string) + 1);
} | 0 | [
"CWE-20",
"CWE-190"
] | jasper | d42b2388f7f8e0332c846675133acea151fc557a | 146,321,857,716,377,930,000,000,000,000,000,000,000 | 5 | The generation of the configuration file jas_config.h has been completely
reworked in order to avoid pollution of the global namespace.
Some problematic types like uchar, ulong, and friends have been replaced
with names with a jas_ prefix.
An option max_samples has been added to the BMP and JPEG decoders to
restrict ... |
static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
{
struct k_sigaction ka;
siginfo_t info;
int signr;
/*
* We want the common case to go fast, which
* is why we may in certain cases get here from
* kernel mode. Just return without doing anything
* if so.
*/
if (!user_mode(regs))
... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 280,780,162,772,951,500,000,000,000,000,000,000,000 | 80 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
ReadLineButton(Widget w,
XEvent *event, /* must be XButtonEvent */
String *params, /* selections */
Cardinal *num_params)
{
XtermWidget xw;
if ((xw = getXtermWidget(w)) != 0) {
TScreen *screen = TScreenOf(xw);
Char Line[6];
int line, col, ldelta = 0;
if (!IsBtnEvent(event)
|| ... | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 31,446,533,794,642,050,000,000,000,000,000,000,000 | 53 | snapshot of project "xterm", label xterm-365d |
static uint32_t cirrus_linear_readw(void *opaque, target_phys_addr_t addr)
{
uint32_t v;
#ifdef TARGET_WORDS_BIGENDIAN
v = cirrus_linear_readb(opaque, addr) << 8;
v |= cirrus_linear_readb(opaque, addr + 1);
#else
v = cirrus_linear_readb(opaque, addr);
v |= cirrus_linear_readb(opaque, addr + 1) << 8;... | 0 | [
"CWE-787"
] | qemu | b2eb849d4b1fdb6f35d5c46958c7f703cf64cfef | 141,937,641,423,140,400,000,000,000,000,000,000,000 | 12 | CVE-2007-1320 - Cirrus LGD-54XX "bitblt" heap overflow
I have just noticed that patch for CVE-2007-1320 has never been applied
to the QEMU CVS. Please find it below.
| Multiple heap-based buffer overflows in the cirrus_invalidate_region
| function in the Cirrus VGA extension in QEMU 0.8.2, as used in Xen and
| possib... |
_iasecc_sm_update_binary(struct sc_card *card, unsigned int offs,
const unsigned char *buff, size_t count)
{
struct sc_context *ctx = card->ctx;
const struct sc_acl_entry *entry = NULL;
int rv;
if (count == 0)
return SC_SUCCESS;
LOG_FUNC_CALLED(ctx);
sc_log(ctx,
"iasecc_sm_read_binary() card:%p offs... | 0 | [
"CWE-125"
] | OpenSC | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 60,100,507,704,533,070,000,000,000,000,000,000,000 | 32 | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. |
static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
int ret;
if (c->fc->nb_streams < 1)
return 0;
if (atom.size <= 40)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
if ((uint64_t)atom.size > (1<<30))
return AVERROR_INVALIDDATA;
... | 0 | [
"CWE-399",
"CWE-834"
] | FFmpeg | 9cb4eb772839c5e1de2855d126bf74ff16d13382 | 146,816,686,417,382,970,000,000,000,000,000,000,000 | 22 | avformat/mov: Fix DoS in read_tfra()
Fixes: Missing EOF check in loop
No testcase
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static int mxf_handle_missing_index_segment(MXFContext *mxf, AVStream *st)
{
MXFTrack *track = st->priv_data;
MXFIndexTableSegment *segment = NULL;
MXFPartition *p = NULL;
int essence_partition_count = 0;
int edit_unit_byte_count = 0;
int i, ret;
if (!track || track->wrapping != ClipWrapped... | 0 | [
"CWE-125"
] | FFmpeg | bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75 | 104,513,279,695,491,450,000,000,000,000,000,000,000 | 69 | avformat/mxfdec: Fix av_log context
Fixes: out of array access
Fixes: mxf-crash-1c2e59bf07a34675bfb3ada5e1ec22fa9f38f923
Found-by: Paul Ch <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
e1000_send_packet(E1000State *s, const uint8_t *buf, int size)
{
if (s->phy_reg[PHY_CTRL] & MII_CR_LOOPBACK) {
s->nic->nc.info->receive(&s->nic->nc, buf, size);
} else {
qemu_send_packet(&s->nic->nc, buf, size);
}
} | 0 | [
"CWE-120"
] | qemu | b0d9ffcd0251161c7c92f94804dcf599dfa3edeb | 152,087,388,197,327,210,000,000,000,000,000,000,000 | 8 | e1000: Discard packets that are too long if !SBP and !LPE
The e1000_receive function for the e1000 needs to discard packets longer than
1522 bytes if the SBP and LPE flags are disabled. The linux driver assumes
this behavior and allocates memory based on this assumption.
Signed-off-by: Michael Contreras <michael@inet... |
static void
routerlist_remove_old_cached_routers_with_id(time_t now,
time_t cutoff, int lo, int hi,
digestset_t *retain)
{
int i, n = hi-lo+1;
unsigned n_extra, n_rmv = 0;
struct duration_idx_t *lifespans;
uint8_t *rmv, *m... | 0 | [] | tor | 1afc2ed956a35b40dfd1d207652af5b50c295da7 | 289,640,691,751,050,000,000,000,000,000,000,000,000 | 79 | Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges
are small. But let's not tempt fate.
This patch also replaces the "cmp" functions here with just "eq"
functions, since nothing actually checked for anything besides 0 and
nonzero.
Related... |
xdr_krb5_flags(XDR *xdrs, krb5_flags *objp)
{
/* This assumes that int32 and krb5_flags are the same size.
This shouldn't be a problem, since we've got a unit test which
checks for this. */
if (!xdr_int32(xdrs, (int32_t *) objp)) {
return (FALSE);
}
return (TRUE);
} | 0 | [
"CWE-703"
] | krb5 | a197e92349a4aa2141b5dff12e9dd44c2a2166e3 | 313,908,222,644,036,850,000,000,000,000,000,000,000 | 10 | Fix kadm5/gssrpc XDR double free [CVE-2014-9421]
[MITKRB5-SA-2015-001] In auth_gssapi_unwrap_data(), do not free
partial deserialization results upon failure to deserialize. This
responsibility belongs to the callers, svctcp_getargs() and
svcudp_getargs(); doing it in the unwrap function results in freeing
the result... |
pq_getstring(StringInfo s)
{
int i;
resetStringInfo(s);
/* Read until we get the terminating '\0' */
for (;;)
{
while (PqRecvPointer >= PqRecvLength)
{
if (pq_recvbuf()) /* If nothing in buffer, then recv some */
return EOF; /* Failed to recv data */
}
for (i = PqRecvPointer; i < PqRecvLength;... | 1 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 266,912,787,197,933,430,000,000,000,000,000,000,000 | 33 | Be more careful to not lose sync in the FE/BE protocol.
If any error occurred while we were in the middle of reading a protocol
message from the client, we could lose sync, and incorrectly try to
interpret a part of another message as a new protocol message. That will
usually lead to an "invalid frontend message" erro... |
static void findConstInWhere(WhereConst *pConst, Expr *pExpr){
Expr *pRight, *pLeft;
if( pExpr==0 ) return;
if( ExprHasProperty(pExpr, EP_FromJoin) ) return;
if( pExpr->op==TK_AND ){
findConstInWhere(pConst, pExpr->pRight);
findConstInWhere(pConst, pExpr->pLeft);
return;
}
if( pExpr->op!=TK_EQ )... | 0 | [
"CWE-125"
] | sqlite | 39df24a3f02495e5ef6bb5ea8ce029a2c1e377e6 | 12,124,088,695,982,406,000,000,000,000,000,000,000 | 21 | Do not allow the constant-propagation optimization to apple to ON/USING clause
terms as it does not help and it might cause downstream problems.
FossilOrigin-Name: 1bc783da63d58b05c690468b569cb2787846357b63c1100d11777666c5787bf4 |
default_bg(SCREEN *sp)
{
#if NCURSES_EXT_FUNCS
return sp != 0 ? sp->_default_bg : COLOR_BLACK;
#else
return COLOR_BLACK;
#endif
} | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 47,035,257,978,902,020,000,000,000,000,000,000,000 | 8 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
static int intf_start_seq_timer(struct ipmi_smi *intf,
long msgid)
{
int rv = -ENODEV;
unsigned long flags;
unsigned char seq;
unsigned long seqid;
GET_SEQ_FROM_MSGID(msgid, seq, seqid);
spin_lock_irqsave(&intf->seq_lock, flags);
/*
* We do this verification because the user can be delet... | 0 | [
"CWE-416",
"CWE-284"
] | linux | 77f8269606bf95fcb232ee86f6da80886f1dfae8 | 83,215,805,381,517,640,000,000,000,000,000,000,000 | 26 | ipmi: fix use-after-free of user->release_barrier.rda
When we do the following test, we got oops in ipmi_msghandler driver
while((1))
do
service ipmievd restart & service ipmievd restart
done
---------------------------------------------------------------
[ 294.230186] Unable to handle kernel paging request at virt... |
static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime)
{
struct task_group *tgi;
unsigned long total = 0;
unsigned long global_ratio =
to_ratio(global_rt_period(), global_rt_runtime());
rcu_read_lock();
list_for_each_entry_rcu(tgi, &task_groups, list) {
if (tgi == tg)
continue;
tota... | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 289,794,051,503,812,200,000,000,000,000,000,000,000 | 19 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
static char *detoken(Token * tlist, bool expand_locals)
{
Token *t;
char *line, *p;
const char *q;
int len = 0;
list_for_each(t, tlist) {
if (t->type == TOK_PREPROC_ID && t->text[1] == '!') {
char *v;
char *q = t->text;
v = t->text + 2;
if (*... | 0 | [
"CWE-125"
] | nasm | 3144e84add8b152cc7a71e44617ce6f21daa4ba3 | 58,166,193,459,525,380,000,000,000,000,000,000,000 | 76 | preproc: Don't access offsting byte on unterminated strings
https://bugzilla.nasm.us/show_bug.cgi?id=3392446
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> |
static int rename_cb(const char *mboxname __attribute__((unused)),
uint32_t uid,
const char *entry,
const char *userid, const struct buf *value,
const struct annotate_metadata *mdata __attribute__((unused)),
void *r... | 0 | [
"CWE-732"
] | cyrus-imapd | 621f9e41465b521399f691c241181300fab55995 | 21,584,514,267,015,510,000,000,000,000,000,000,000 | 36 | annotate: don't allow everyone to write shared server entries |
queue_var_store(unsigned long *var, const char *page, size_t count)
{
int err;
unsigned long v;
err = kstrtoul(page, 10, &v);
if (err || v > UINT_MAX)
return -EINVAL;
*var = v;
return count;
} | 0 | [
"CWE-416"
] | linux | c3e2219216c92919a6bd1711f340f5faa98695e6 | 119,433,245,767,026,690,000,000,000,000,000,000,000 | 13 | block: free sched's request pool in blk_cleanup_queue
In theory, IO scheduler belongs to request queue, and the request pool
of sched tags belongs to the request queue too.
However, the current tags allocation interfaces are re-used for both
driver tags and sched tags, and driver tags is definitely host wide,
and doe... |
ex_ptag(exarg_T *eap)
{
g_do_tagpreview = p_pvh; /* will be reset to 0 in ex_tag_cmd() */
ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
} | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 112,384,596,205,306,830,000,000,000,000,000,000,000 | 5 | 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. |
void dopasv(int psvtype)
{
struct sockaddr_storage dataconn; /* my data connection endpoint */
unsigned long a = 0U;
unsigned int p;
int on;
unsigned int firstporttried;
if (loggedin == 0) {
addreply_noformat(530, MSG_NOT_LOGGED_IN);
return;
}
if (datafd != -1) { ... | 0 | [
"CWE-434"
] | pure-ftpd | 37ad222868e52271905b94afea4fc780d83294b4 | 324,850,731,831,666,760,000,000,000,000,000,000,000 | 94 | Initialize the max upload file size when quotas are enabled
Due to an unwanted check, files causing the quota to be exceeded
were deleted after the upload, but not during the upload.
The bug was introduced in 2009 in version 1.0.23
Spotted by @DroidTest, thanks! |
double Field_blob_compressed::val_real(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
THD *thd= get_thd();
String buf;
val_str(&buf, &buf);
return Converter_strntod_with_warn(thd, Warn_filter(thd), field_charset,
buf.ptr(), buf.length()).result();
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 151,709,496,560,338,490,000,000,000,000,000,000,000 | 9 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
midi_synth_send_sysex(int dev, unsigned char *bytes, int len)
{
int orig_dev = synth_devs[dev]->midi_dev;
int i;
for (i = 0; i < len; i++)
{
switch (bytes[i])
{
case 0xf0: /* Start sysex */
if (!prefix_cmd(orig_dev, 0xf0))
return 0;
sysex_state[dev] =... | 0 | [
"CWE-703",
"CWE-189"
] | linux | b769f49463711205d57286e64cf535ed4daf59e9 | 46,229,051,830,074,770,000,000,000,000,000,000,000 | 53 | sound/oss: remove offset from load_patch callbacks
Was: [PATCH] sound/oss/midi_synth: prevent underflow, use of
uninitialized value, and signedness issue
The offset passed to midi_synth_load_patch() can be essentially
arbitrary. If it's greater than the header length, this will result in
a copy_from_user(dst, src, n... |
int xt_register_target(struct xt_target *target)
{
u_int8_t af = target->family;
mutex_lock(&xt[af].mutex);
list_add(&target->list, &xt[af].target);
mutex_unlock(&xt[af].mutex);
return 0;
} | 0 | [
"CWE-119"
] | nf-next | d7591f0c41ce3e67600a982bab6989ef0f07b3ce | 152,925,794,592,538,560,000,000,000,000,000,000,000 | 9 | netfilter: x_tables: introduce and use xt_copy_counters_from_user
The three variants use same copy&pasted code, condense this into a
helper and use that.
Make sure info.name is 0-terminated.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |
OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
uint8 m;
assert(OJPEG_BUFFER>=2+8+sp->samples_per_pixel_per_plane*3);
assert(255>=8+sp->samples_per_pixel_per_plane*3);
sp->out_buffer[0]=255;
sp->out_buffer[1]=sp->sof_marker_id;
/* Lf */
sp->out_buffer[2]=0;
... | 0 | [
"CWE-369"
] | libtiff | 43bc256d8ae44b92d2734a3c5bc73957a4d7c1ec | 244,193,291,850,423,450,000,000,000,000,000,000,000 | 34 | * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611 |
static uECC_word_t EccPoint_compute_public_key(uECC_word_t *result,
uECC_word_t *private_key,
uECC_Curve curve) {
uECC_word_t tmp1[uECC_MAX_WORDS];
uECC_word_t tmp2[uECC_MAX_WORDS];
uECC_word_t *p2[2] = {tmp1, tmp2... | 0 | [
"CWE-415"
] | micro-ecc | 1b5f5cea5145c96dd8791b9b2c41424fc74c2172 | 76,114,690,977,373,770,000,000,000,000,000,000,000 | 19 | Fix for #168 |
void HGraph::InsertRepresentationChangesForValue(HValue* value) {
Representation r = value->representation();
if (r.IsNone()) return;
if (value->HasNoUses()) return;
for (HUseIterator it(value->uses()); !it.Done(); it.Advance()) {
HValue* use_value = it.value();
int use_index = it.index();
Represen... | 0 | [] | node | fd80a31e0697d6317ce8c2d289575399f4e06d21 | 126,321,087,961,336,260,000,000,000,000,000,000,000 | 23 | deps: backport 5f836c from v8 upstream
Original commit message:
Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.
BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org
Review URL: https://coderevie... |
ves_icall_System_Threading_Thread_VolatileWrite2 (void *ptr, gint16 value)
{
*((volatile gint16 *) ptr) = value;
} | 0 | [
"CWE-399",
"CWE-264"
] | mono | 722f9890f09aadfc37ae479e7d946d5fc5ef7b91 | 196,755,477,465,295,000,000,000,000,000,000,000,000 | 4 | 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 void __prep_new_huge_page(struct hstate *h, struct page *page)
{
free_huge_page_vmemmap(h, page);
INIT_LIST_HEAD(&page->lru);
set_compound_page_dtor(page, HUGETLB_PAGE_DTOR);
hugetlb_set_page_subpool(page, NULL);
set_hugetlb_cgroup(page, NULL);
set_hugetlb_cgroup_rsvd(page, NULL);
} | 0 | [] | linux | a4a118f2eead1d6c49e00765de89878288d4b890 | 243,693,266,708,638,800,000,000,000,000,000,000,000 | 9 | hugetlbfs: flush TLBs correctly after huge_pmd_unshare
When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing. This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place... |
static int handle_request_for_tables(char *tables, size_t length)
{
char *query, *end, options[100], message[100];
size_t query_length= 0, query_size= sizeof(char)*(length+110);
const char *op = 0;
options[0] = 0;
end = options;
switch (what_to_do) {
case DO_CHECK:
op = "CHECK";
if (opt_quick) ... | 0 | [
"CWE-319"
] | mysql-server | 0002e1380d5f8c113b6bce91f2cf3f75136fd7c7 | 152,638,211,884,884,490,000,000,000,000,000,000,000 | 64 | BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING SSL CONNECTION
MYSQL_OPT_SSL_MODE option introduced.
It is set in case of --ssl-mode=REQUIRED and permits only SSL connection.
(cherry picked from commit f91b941842d240b8a62645e507f5554e8be76aec) |
i_alloc_bytes(gs_memory_t * mem, uint size, client_name_t cname)
{
gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
obj_header_t *obj;
obj_header_t **pfl;
#ifdef MEMENTO
if (Memento_failThisEvent())
return NULL;
#endif
IF_FREELIST_ALLOC(obj, imem, size, &st_bytes, pfl)
alloc_... | 0 | [
"CWE-190"
] | ghostpdl | cfde94be1d4286bc47633c6e6eaf4e659bd78066 | 264,026,544,116,304,700,000,000,000,000,000,000,000 | 29 | Bug 697985: bounds check the array allocations methods
The clump allocator has four allocation functions that use 'number of elements'
and 'size of elements' parameters (rather than a simple 'number of bytes').
Those need specific bounds checking. |
uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select,
ha_rows limit, ha_rows *scanned_limit,
bool *need_sort, bool *reverse)
{
if (!order)
{
*need_sort= FALSE;
if (select && select->quick)
return select->quick->index; // index or MAX... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 51,010,408,772,316,060,000,000,000,000,000,000,000 | 82 | 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... |
int cli_unbuffered_fetch(MYSQL *mysql, char **row)
{
if (packet_error == cli_safe_read(mysql))
return 1;
*row= ((mysql->net.read_pos[0] == 254) ? NULL :
(char*) (mysql->net.read_pos+1));
return 0;
} | 0 | [] | mysql-server | 3d8134d2c9b74bc8883ffe2ef59c168361223837 | 155,131,545,280,071,200,000,000,000,000,000,000,000 | 9 | Bug#25988681: USE-AFTER-FREE IN MYSQL_STMT_CLOSE()
Description: If mysql_stmt_close() encountered error,
it recorded error in prepared statement
but then frees memory assigned to prepared
statement. If mysql_stmt_error() is used
to get error information, it will resu... |
main(int argc, char** argv)
{
if (argc < 2) {
PrintUsageAndExit();
}
// default options
Options.input = NULL;
Options.verbose = false;
Options.hls_version = 0;
Options.pmt_pid = 0x100;
... | 1 | [
"CWE-703"
] | Bento4 | 33331ce2d35d45d855af7441db6116b4a9e2b70f | 309,905,552,433,608,470,000,000,000,000,000,000,000 | 725 | fix #691 |
static u64 vmx_read_l1_tsc_offset(struct kvm_vcpu *vcpu)
{
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
if (is_guest_mode(vcpu) &&
(vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING))
return vcpu->arch.tsc_offset - vmcs12->tsc_offset;
return vcpu->arch.tsc_offset;
} | 0 | [
"CWE-284"
] | linux | 727ba748e110b4de50d142edca9d6a9b7e6111d8 | 5,191,876,624,371,376,400,000,000,000,000,000,000 | 10 | kvm: nVMX: Enforce cpl=0 for VMX instructions
VMX instructions executed inside a L1 VM will always trigger a VM exit
even when executed with cpl 3. This means we must perform the
privilege check in software.
Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks")
Cc: stable@vger.kernel.org
S... |
struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc,
const struct msghdr *msg,
size_t paylen)
{
struct sctp_chunk *retval;
void *payload = NULL;
int err;
retval = sctp_make_abort(asoc, NULL, sizeof(sctp_errhdr_t) + paylen);
if (!retval)
goto err_chunk;
if (paylen) {
/* Put ... | 0 | [
"CWE-20"
] | linux-2.6 | ba0166708ef4da7eeb61dd92bbba4d5a749d6561 | 315,756,456,851,145,700,000,000,000,000,000,000,000 | 39 | sctp: Fix kernel panic while process protocol violation parameter
Since call to function sctp_sf_abort_violation() need paramter 'arg' with
'struct sctp_chunk' type, it will read the chunk type and chunk length from
the chunk_hdr member of chunk. But call to sctp_sf_violation_paramlen()
always with 'struct sctp_paramh... |
getRGBFromOctcube(l_int32 cubeindex,
l_int32 level,
l_int32 *prval,
l_int32 *pgval,
l_int32 *pbval)
{
l_int32 rgbindex;
/* Bring to format in 21 bits: (r7 g7 b7 r6 g6 b6 ...) */
/* This is valid for levels from 0 to 6 */
... | 0 | [
"CWE-125"
] | leptonica | 5ee24b398bb67666f6d173763eaaedd9c36fb1e5 | 297,023,356,101,346,100,000,000,000,000,000,000,000 | 38 | Fixed issue 22140 in oss-fuzz: Heap-buffer-overflow
* color quantized pix must be 8 bpp before extra colors are added. |
compute_file_list_name (FrWindow *window,
FileData *fdata,
const char *current_dir,
int current_dir_len,
GHashTable *names_hash,
gboolean *different_name)
{
register char *scan, *end;
*different_name = FALSE;
if (! file_data_respects_filter (window, fdata))
return FALSE;
if (window... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 82,781,041,855,515,045,000,000,000,000,000,000,000 | 57 | libarchive: sanitize filenames before extracting |
int populateCommandTableParseFlags(struct redisCommand *c, char *strflags) {
int argc;
sds *argv;
/* Split the line into arguments for processing. */
argv = sdssplitargs(strflags,&argc);
if (argv == NULL) return C_ERR;
for (int j = 0; j < argc; j++) {
char *flag = argv[j];
if (... | 0 | [
"CWE-770"
] | redis | 5674b0057ff2903d43eaff802017eddf37c360f8 | 289,747,489,071,840,500,000,000,000,000,000,000,000 | 59 | Prevent unauthenticated client from easily consuming lots of memory (CVE-2021-32675)
This change sets a low limit for multibulk and bulk length in the
protocol for unauthenticated connections, so that they can't easily
cause redis to allocate massive amounts of memory by sending just a few
characters on the network.
T... |
static BOOL rdp_write_surface_commands_capability_set(wStream* s, const rdpSettings* settings)
{
size_t header;
UINT32 cmdFlags;
if (!Stream_EnsureRemainingCapacity(s, 32))
return FALSE;
header = rdp_capability_set_start(s);
cmdFlags = SURFCMDS_SET_SURFACE_BITS | SURFCMDS_STREAM_SURFACE_BITS;
if (settings->S... | 0 | [
"CWE-119",
"CWE-125"
] | FreeRDP | 3627aaf7d289315b614a584afb388f04abfb5bbf | 265,887,635,769,419,820,000,000,000,000,000,000,000 | 19 | Fixed #6011: Bounds check in rdp_read_font_capability_set |
static int genprime_cb(int p, int n, BN_GENCB *arg)
{
char c = '*';
if (p == 0)
c = '.';
if (p == 1)
c = '+';
if (p == 2)
c = '*';
if (p == 3)
c = '\n';
putc(c, stderr);
fflush(stderr);
return 1;
} | 0 | [
"CWE-200"
] | openssl | d73cc256c8e256c32ed959456101b73ba9842f72 | 229,087,024,923,630,300,000,000,000,000,000,000,000 | 16 | bn/asm/x86_64-mont5.pl: fix carry propagating bug (CVE-2015-3193).
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit e7c078db57908cbf16074c68034977565ffaf107) |
static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
struct genl_info *info)
{
if (info->user_ptr[1]) {
if (ops->internal_flags & NL80211_FLAG_NEED_WDEV) {
struct wireless_dev *wdev = info->user_ptr[1];
if (wdev->netdev)
dev_put(wdev->netdev);
} else {
dev_put(info-... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 266,504,741,488,192,740,000,000,000,000,000,000,000 | 28 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
note_request(const char *key, size_t bytes)
{
request_t *r;
ensure_request_map_initialized();
r = strmap_get(request_map, key);
if (!r) {
r = tor_malloc_zero(sizeof(request_t));
strmap_set(request_map, key, r);
}
r->bytes += bytes;
r->count++;
} | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 201,544,032,577,620,900,000,000,000,000,000,000,000 | 13 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
jpc_enc_tile_t *jpc_enc_tile_create(jpc_enc_cp_t *cp, jas_image_t *image, int tileno)
{
jpc_enc_tile_t *tile;
uint_fast32_t htileno;
uint_fast32_t vtileno;
uint_fast16_t lyrno;
uint_fast16_t cmptno;
jpc_enc_tcmpt_t *tcmpt;
if (!(tile = jas_malloc(sizeof(jpc_enc_tile_t)))) {
goto error;
}
/* Initialize a fe... | 1 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 281,449,265,000,076,830,000,000,000,000,000,000,000 | 102 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
static inline MagickBooleanType AcquireCacheNexusPixels(
const CacheInfo *magick_restrict cache_info,NexusInfo *nexus_info,
ExceptionInfo *exception)
{
if (nexus_info->length != (MagickSizeType) ((size_t) nexus_info->length))
return(MagickFalse);
nexus_info->mapped=MagickFalse;
nexus_info->cache=(Quantum ... | 0 | [
"CWE-119",
"CWE-787"
] | ImageMagick | aecd0ada163a4d6c769cec178955d5f3e9316f2f | 215,083,283,129,420,550,000,000,000,000,000,000,000 | 24 | Set pixel cache to undefined if any resource limit is exceeded |
void *ext4_kvzalloc(size_t size, gfp_t flags)
{
void *ret;
ret = kzalloc(size, flags | __GFP_NOWARN);
if (!ret)
ret = __vmalloc(size, flags | __GFP_ZERO, PAGE_KERNEL);
return ret;
} | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 336,970,878,134,884,400,000,000,000,000,000,000,000 | 9 | ext4: fix races between page faults and hole punching
Currently, page faults and hole punching are completely unsynchronized.
This can result in page fault faulting in a page into a range that we
are punching after truncate_pagecache_range() has been called and thus
we can end up with a page mapped to disk blocks that... |
gs_window_real_show (GtkWidget *widget)
{
GSWindow *window;
if (GTK_WIDGET_CLASS (gs_window_parent_class)->show) {
GTK_WIDGET_CLASS (gs_window_parent_class)->show (widget);
}
set_invisible_cursor (gtk_widget_get_window (widget), TRUE);
window = GS_WINDOW (widge... | 0 | [
"CWE-284"
] | cinnamon-screensaver | da7af55f1fa966c52e15cc288d4f8928eca8cc9f | 174,409,326,337,279,200,000,000,000,000,000,000,000 | 23 | Workaround gtk3 bug, don't allow GtkWindow to handle popup_menu. |
static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
{
return grp->my_q;
} | 0 | [] | linux-2.6 | 6a6029b8cefe0ca7e82f27f3904dbedba3de4e06 | 143,793,833,055,780,350,000,000,000,000,000,000,000 | 4 | sched: simplify sched_slice()
Use the existing calc_delta_mine() calculation for sched_slice(). This
saves a divide and simplifies the code because we share it with the
other /cfs_rq->load users.
It also improves code size:
text data bss dec hex filename
42659 2740 144 45543 b1e... |
void mg_tls_free(struct mg_connection *c) {
struct mg_tls *tls = (struct mg_tls *) c->tls;
if (tls == NULL) return;
free(tls->cafile);
mbedtls_ssl_free(&tls->ssl);
mbedtls_pk_free(&tls->pk);
mbedtls_x509_crt_free(&tls->ca);
mbedtls_x509_crl_free(&tls->crl);
mbedtls_x509_crt_free(&tls->cert);
mbedtls_s... | 0 | [
"CWE-552"
] | mongoose | c65c8fdaaa257e0487ab0aaae9e8f6b439335945 | 53,656,970,241,862,300,000,000,000,000,000,000,000 | 13 | Protect against the directory traversal in mg_upload() |
~CloseReq() {
uv_fs_req_cleanup(req());
promise_.Reset();
ref_.Reset();
} | 0 | [
"CWE-416"
] | node | 7f178663ebffc82c9f8a5a1b6bf2da0c263a30ed | 95,849,745,532,474,040,000,000,000,000,000,000,000 | 5 | src: use unique_ptr for WriteWrap
This commit attempts to avoid a use-after-free error by using unqiue_ptr
and passing a reference to it.
CVE-ID: CVE-2020-8265
Fixes: https://github.com/nodejs-private/node-private/issues/227
PR-URL: https://github.com/nodejs-private/node-private/pull/238
Reviewed-By: Michael Dawson <... |
short ByteVector::toShort(bool mostSignificantByteFirst) const
{
return toNumber<unsigned short>(d->data, mostSignificantByteFirst);
} | 0 | [
"CWE-189"
] | taglib | dcdf4fd954e3213c355746fa15b7480461972308 | 84,522,200,232,375,340,000,000,000,000,000,000,000 | 4 | Avoid uint overflow in case the length + index is over UINT_MAX |
static int selinux_socket_accept(struct socket *sock, struct socket *newsock)
{
int err;
struct inode_security_struct *isec;
struct inode_security_struct *newisec;
err = sock_has_perm(current, sock->sk, SOCKET__ACCEPT);
if (err)
return err;
newisec = SOCK_INODE(newsock)->i_security;
isec = SOCK_INODE(sock)-... | 0 | [
"CWE-264"
] | linux | 259e5e6c75a910f3b5e656151dc602f53f9d7548 | 98,966,736,815,846,800,000,000,000,000,000,000,000 | 19 | Add PR_{GET,SET}_NO_NEW_PRIVS to prevent execve from granting privs
With this change, calling
prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)
disables privilege granting operations at execve-time. For example, a
process will not be able to execute a setuid binary to change their uid
or gid if this bit is set. The same is t... |
val_unwrap_iov_args(
OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int *conf_state,
gss_qop_t *qop_state,
gss_iov_buffer_desc *iov,
int iov_count)
{
/* Initialize outputs. */
if (minor_status != NULL)
*minor_status = 0;
/* Validate arguments. */
if (minor_status == N... | 0 | [
"CWE-415"
] | krb5 | 56f7b1bc95a2a3eeb420e069e7655fb181ade5cf | 131,342,707,420,629,280,000,000,000,000,000,000,000 | 27 | Preserve GSS context on init/accept failure
After gss_init_sec_context() or gss_accept_sec_context() has created a
context, don't delete the mechglue context on failures from subsequent
calls, even if the mechanism deletes the mech-specific context (which
is allowed by RFC 2744 but not preferred). Check for union con... |
int RGWAsioFrontend::init()
{
return impl->init();
} | 0 | [
"CWE-400"
] | ceph | ff72c50a2c43c57aead933eb4903ad1ca6d1748a | 270,858,821,631,243,500,000,000,000,000,000,000,000 | 4 | rgw: improve beast
Avoid leaking connections that had partially-consumed
client data on unexpected disconnect.
Resolves CVE-2020-1700 (moderate impact flaw).
Fixes: https://tracker.ceph.com/issues/42531
Signed-off-by: Or Friedmann <ofriedma@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com> |
ext4_acl_to_disk(const struct posix_acl *acl, size_t *size)
{
ext4_acl_header *ext_acl;
char *e;
size_t n;
*size = ext4_acl_size(acl->a_count);
ext_acl = kmalloc(sizeof(ext4_acl_header) + acl->a_count *
sizeof(ext4_acl_entry), GFP_NOFS);
if (!ext_acl)
return ERR_PTR(-ENOMEM);
ext_acl->a_version = cpu_to_le... | 0 | [
"CWE-862",
"CWE-285"
] | linux | 073931017b49d9458aa351605b43a7e34598caef | 57,167,250,159,505,370,000,000,000,000,000,000,000 | 47 | posix_acl: Clear SGID bit when setting file permissions
When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't cl... |
static ssize_t sec_recv(struct Curl_easy *data, int sockindex,
char *buffer, size_t len, CURLcode *err)
{
size_t bytes_read;
size_t total_read = 0;
struct connectdata *conn = data->conn;
curl_socket_t fd = conn->sock[sockindex];
*err = CURLE_OK;
/* Handle clear text response. */
... | 0 | [] | curl | 6ecdf5136b52af747e7bda08db9a748256b1cd09 | 241,082,025,294,164,650,000,000,000,000,000,000,000 | 39 | krb5: return error properly on decode errors
Bug: https://curl.se/docs/CVE-2022-32208.html
CVE-2022-32208
Reported-by: Harry Sintonen
Closes #9051 |
GF_Box *url_New()
{
ISOM_DECL_BOX_ALLOC(GF_DataEntryURLBox, GF_ISOM_BOX_TYPE_URL);
return (GF_Box *)tmp;
} | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 302,211,042,450,736,800,000,000,000,000,000,000,000 | 5 | prevent dref memleak on invalid input (#1183) |
ves_icall_System_Reflection_Module_GetPEKind (MonoImage *image, gint32 *pe_kind, gint32 *machine)
{
if (image->dynamic) {
MonoDynamicImage *dyn = (MonoDynamicImage*)image;
*pe_kind = dyn->pe_kind;
*machine = dyn->machine;
}
else {
*pe_kind = ((MonoCLIImageInfo*)(image->image_info))->cli_cli_header.ch_flags &... | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 152,933,707,088,114,140,000,000,000,000,000,000,000 | 12 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
static int __net_init tcp4_proc_init_net(struct net *net)
{
return tcp_proc_register(net, &tcp4_seq_afinfo);
} | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 195,547,787,123,868,370,000,000,000,000,000,000,000 | 4 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *dev)
{
char desc[17];
memset(desc, 0, sizeof (desc));
snprintf(desc, (dev->id_code & 0x1f) + 1, "%s", dev->id_string);
if (!verbose) {
if (csv_output)
printf("%s,00h,ns,%d.%d\n",
dev->id_code ? desc : "",
dev->entity... | 1 | [
"CWE-120"
] | ipmitool | 7ccea283dd62a05a320c1921e3d8d71a87772637 | 324,665,364,075,844,100,000,000,000,000,000,000,000 | 46 | fru, sdr: Fix id_string buffer overflows
Final part of the fixes for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
9 variants of stack buffer overflow when parsing `id_string` field of
SDR records returned from `CMD_GET_SDR` command.
SDR record structs have an `id_co... |
vg_set_features(VuDev *dev, uint64_t features)
{
VuGpu *g = container_of(dev, VuGpu, dev.parent);
bool virgl = features & (1 << VIRTIO_GPU_F_VIRGL);
if (virgl && !g->virgl_inited) {
if (!vg_virgl_init(g)) {
vg_panic(dev, "Failed to initialize virgl");
}
g->virgl_inited =... | 0 | [] | qemu | 86dd8fac2acc366930a5dc08d3fb1b1e816f4e1e | 119,042,003,654,358,960,000,000,000,000,000,000,000 | 14 | vhost-user-gpu: fix resource leak in 'vg_resource_create_2d' (CVE-2021-3544)
Call 'vugbm_buffer_destroy' in error path to avoid resource leak.
Fixes: CVE-2021-3544
Reported-by: Li Qiang <liq3ea@163.com>
Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Li Qiang <liq3ea@163.com>
Reviewed-by: Marc-And... |
static bool print_admin_msg(THD* thd, uint len,
const char* msg_type,
const char* db_name, String &table_name,
const char* op_name, const char *fmt, ...)
{
va_list args;
Protocol *protocol= thd->protocol;
uint length;
uint msg_l... | 0 | [] | server | f305a7ce4bccbd56520d874e1d81a4f29bc17a96 | 182,802,585,946,729,200,000,000,000,000,000,000,000 | 56 | bugfix: long partition names |
static int pop3_endofresp(struct pingpong *pp,
int *resp)
{
char *line = pp->linestart_resp;
size_t len = pp->nread_resp;
if(((len >= 3) && !memcmp("+OK", line, 3)) ||
((len >= 4) && !memcmp("-ERR", line, 4))) {
*resp=line[1]; /* O or E */
return TRUE;
}
return FALSE; ... | 0 | [
"CWE-89"
] | curl | 75ca568fa1c19de4c5358fed246686de8467c238 | 100,761,119,575,715,180,000,000,000,000,000,000,000 | 14 | URL sanitize: reject URLs containing bad data
Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a
decoded manner now use the new Curl_urldecode() function to reject URLs
with embedded control codes (anything that is or decodes to a byte value
less than 32).
URLs containing such codes could easily oth... |
relpTcpChkPeerFingerprint(relpTcp_t *pThis, gnutls_x509_crt_t cert)
{
int r = 0;
int i;
char fingerprint[20];
char fpPrintable[512];
size_t size;
int8_t found;
/* obtain the SHA1 fingerprint */
size = sizeof(fingerprint);
r = gnutls_x509_crt_get_fingerprint(cert, GNUTLS_DIG_SHA1, fingerprint, &size);
if(chkG... | 0 | [
"CWE-787"
] | librelp | 2cfe657672636aa5d7d2a14cfcb0a6ab9d1f00cf | 107,521,735,626,081,940,000,000,000,000,000,000,000 | 37 | unify error message generation |
static int time_callback(sd_event_source *s, uint64_t usec, void *userdata) {
sd_bus *bus = userdata;
int r;
assert(bus);
r = sd_bus_process(bus, NULL);
if (r < 0) {
log_debug_errno(r, "Processing of bus failed, closing down: %m");
bus_enter_clos... | 0 | [
"CWE-416"
] | systemd | 1068447e6954dc6ce52f099ed174c442cb89ed54 | 56,417,018,026,215,320,000,000,000,000,000,000,000 | 14 | sd-bus: introduce API for re-enqueuing incoming messages
When authorizing via PolicyKit we want to process incoming method calls
twice: once to process and figure out that we need PK authentication,
and a second time after we aquired PK authentication to actually execute
the operation. With this new call sd_bus_enqueu... |
eat_whitespace(const char *s)
{
tor_assert(s);
while (1) {
switch (*s) {
case '\0':
default:
return s;
case ' ':
case '\t':
case '\n':
case '\r':
++s;
break;
case '#':
++s;
while (*s && *s != '\n')
++s;
}
}
} | 0 | [] | tor | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 | 256,782,067,308,428,140,000,000,000,000,000,000,000 | 22 | Fix assertion failure in tor_timegm.
Fixes bug 6811. |
static void clear_indicator_in_key_fields(KEY *key_info)
{
KEY_PART_INFO *key_part;
uint key_parts= key_info->user_defined_key_parts, i;
for (i= 0, key_part=key_info->key_part; i < key_parts; i++, key_part++)
key_part->field->flags&= (~GET_FIXED_FIELDS_FLAG);
} | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 54,338,851,599,817,920,000,000,000,000,000,000,000 | 7 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
size_t Curl_polarssl_version(char *buffer, size_t size)
{
unsigned int version = version_get_number();
return snprintf(buffer, size, "%s/%d.%d.%d",
version >= 0x01030A00?"mbedTLS":"PolarSSL",
version>>24, (version>>16)&0xff, (version>>8)&0xff);
} | 0 | [
"CWE-20"
] | curl | 6efd2fa529a189bf41736a610f6184cd8ad94b4d | 126,785,715,551,328,830,000,000,000,000,000,000,000 | 7 | mbedtls/polarssl: set "hostname" unconditionally
...as otherwise the TLS libs will skip the CN/SAN check and just allow
connection to any server. curl previously skipped this function when SNI
wasn't used or when connecting to an IP address specified host.
CVE-2016-3739
Bug: https://curl.haxx.se/docs/adv_20160518A.h... |
void send_mtu_probe(node_t *n) {
vpn_packet_t packet;
int len, i;
int timeout = 1;
n->mtuprobes++;
n->mtuevent = NULL;
if(!n->status.reachable || !n->status.validkey) {
ifdebug(TRAFFIC) logger(LOG_INFO, "Trying to send MTU probe to unreachable or rekeying node %s (%s)", n->name, n->hostname);
n->mtuprobes ... | 0 | [
"CWE-200",
"CWE-119"
] | tinc | 17a33dfd95b1a29e90db76414eb9622df9632320 | 332,093,051,789,419,470,000,000,000,000,000,000,000 | 83 | Drop packets forwarded via TCP if they are too big (CVE-2013-1428).
Normally all requests sent via the meta connections are checked so that they
cannot be larger than the input buffer. However, when packets are forwarded via
meta connections, they are copied into a packet buffer without checking whether
it fits into i... |
static int verify_auth_trunc(struct nlattr **attrs)
{
struct nlattr *rt = attrs[XFRMA_ALG_AUTH_TRUNC];
struct xfrm_algo_auth *algp;
if (!rt)
return 0;
algp = nla_data(rt);
if (nla_len(rt) < xfrm_alg_auth_len(algp))
return -EINVAL;
algp->alg_name[sizeof(algp->alg_name) - 1] = '\0';
return 0;
} | 0 | [
"CWE-416",
"CWE-284"
] | linux | 1137b5e2529a8f5ca8ee709288ecba3e68044df2 | 97,919,586,354,220,820,000,000,000,000,000,000,000 | 15 | ipsec: Fix aborted xfrm policy dump crash
An independent security researcher, Mohamed Ghannam, has reported
this vulnerability to Beyond Security's SecuriTeam Secure Disclosure
program.
The xfrm_dump_policy_done function expects xfrm_dump_policy to
have been called at least once or it will crash. This can be
trigger... |
QEMUGLContext dpy_gl_ctx_get_current(QemuConsole *con)
{
assert(con->gl);
return con->gl->ops->dpy_gl_ctx_get_current(con->gl);
} | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 61,979,115,946,732,060,000,000,000,000,000,000,000 | 5 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
void cgit_clone_head(void)
{
send_file(git_path("%s", "HEAD"));
} | 0 | [] | cgit | 53efaf30b50f095cad8c160488c74bba3e3b2680 | 228,651,909,319,124,600,000,000,000,000,000,000,000 | 4 | clone: fix directory traversal
This was introduced in the initial version of this code, way back when
in 2008.
$ curl http://127.0.0.1/cgit/repo/objects/?path=../../../../../../../../../etc/passwd
root:x:0:0:root:/root:/bin/sh
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reported-by: Jann Horn <jannh@goog... |
static jpc_dec_mstabent_t *jpc_dec_mstab_lookup(uint_fast16_t id)
{
jpc_dec_mstabent_t *mstabent;
for (mstabent = jpc_dec_mstab; mstabent->id != 0; ++mstabent) {
if (mstabent->id == id) {
break;
}
}
return mstabent;
} | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 76,451,182,387,496,990,000,000,000,000,000,000,000 | 10 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
GF_TrackBox *GetTrackbyID(GF_MovieBox *moov, GF_ISOTrackID TrackID)
{
GF_TrackBox *trak;
u32 i;
if (!moov) return NULL;
i=0;
while ((trak = (GF_TrackBox *)gf_list_enum(moov->trackList, &i))) {
if (trak->Header->trackID == TrackID) return trak;
}
return NULL;
} | 0 | [
"CWE-476"
] | gpac | df8fffd839fe5ae9acd82d26fd48280a397411d9 | 302,333,045,249,453,240,000,000,000,000,000,000,000 | 11 | fixed #1736 |
pci_emul_alloc_resource(uint64_t *baseptr, uint64_t limit, uint64_t size,
uint64_t *addr)
{
uint64_t base;
assert((size & (size - 1)) == 0); /* must be a power of 2 */
base = roundup2(*baseptr, size);
if (base + size <= limit) {
*addr = base;
*baseptr = base + size;
return 0;
} else
return -1;
} | 1 | [
"CWE-617",
"CWE-703"
] | acrn-hypervisor | 2b3dedfb9ba13f15887f22b935d373f36c9a59fa | 98,153,887,786,135,220,000,000,000,000,000,000,000 | 16 | dm: pci: clean up assert() in pci core
Tracked-On: #3252
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com> |
mmcl_set_min_max(MinMaxCharLen* l, OnigLen min, OnigLen max, int min_is_sure)
{
l->min = min;
l->max = max;
l->min_is_sure = min_is_sure;
} | 0 | [
"CWE-787"
] | oniguruma | cbe9f8bd9cfc6c3c87a60fbae58fa1a85db59df0 | 189,782,886,224,858,940,000,000,000,000,000,000,000 | 6 | #207: Out-of-bounds write |
static int decode_code_length(struct rar5* rar, const uint8_t* p,
uint16_t code)
{
int lbits, length = 2;
if(code < 8) {
lbits = 0;
length += code;
} else {
lbits = code / 4 - 1;
length += (4 | (code & 3)) << lbits;
}
if(lbits > 0) {
int add;
if(ARCHIVE_OK != read_consume_bits(rar, p, lbits, &add... | 0 | [
"CWE-20",
"CWE-125"
] | libarchive | 94821008d6eea81e315c5881cdf739202961040a | 268,534,864,017,225,330,000,000,000,000,000,000,000 | 23 | RAR5 reader: reject files that declare invalid header flags
One of the fields in RAR5's base block structure is the size of the
header. Some invalid files declare a 0 header size setting, which can
confuse the unpacker. Minimum header size for RAR5 base blocks is 7
bytes (4 bytes for CRC, and 3 bytes for the rest), so... |
GF_Err Media_RewriteODFrame(GF_MediaBox *mdia, GF_ISOSample *sample)
{
GF_Err e;
GF_ODCodec *ODdecode;
GF_ODCodec *ODencode;
GF_ODCom *com;
//the commands we proceed
GF_ESDUpdate *esdU, *esdU2;
GF_ESDRemove *esdR, *esdR2;
GF_ODUpdate *odU, *odU2;
//the desc they contain
GF_ObjectDescriptor *od;
GF_IsomObje... | 0 | [
"CWE-476"
] | gpac | f0ba83717b6e4d7a15a1676d1fe06152e199b011 | 70,307,577,295,047,260,000,000,000,000,000,000,000 | 199 | fixed #1772 (fuzz) |
static void kvm_destroy_vm_debugfs(struct kvm *kvm)
{
int i;
int kvm_debugfs_num_entries = kvm_vm_stats_header.num_desc +
kvm_vcpu_stats_header.num_desc;
if (IS_ERR(kvm->debugfs_dentry))
return;
debugfs_remove_recursive(kvm->debugfs_dentry);
if (kvm->debugfs_stat_data) {
for (i = 0; i < kvm_debug... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 5,365,007,426,066,330,000,000,000,000,000,000,000 | 17 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
inline bool gtid_client_init()
{
bool res=
(!(global_sid_lock= new Checkable_rwlock) ||
!(global_sid_map= new Sid_map(global_sid_lock)) ||
!(gtid_set_excluded= new Gtid_set(global_sid_map)) ||
!(gtid_set_included= new Gtid_set(global_sid_map)));
if (res)
{
gtid_client_cleanup();
}
retur... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 157,863,155,112,756,580,000,000,000,000,000,000,000 | 13 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.