func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
SetTriggerFlags(TriggerDesc *trigdesc, Trigger *trigger)
{
int16 tgtype = trigger->tgtype;
trigdesc->trig_insert_before_row |=
TRIGGER_TYPE_MATCHES(tgtype, TRIGGER_TYPE_ROW,
TRIGGER_TYPE_BEFORE, TRIGGER_TYPE_INSERT);
trigdesc->trig_insert_after_row |=
TRIGGER_TYPE_MATCHES(tgtype, TRIGGER_TYPE_ROW,
... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 127,407,135,137,368,870,000,000,000,000,000,000,000 | 57 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
uint32_t smb2cli_conn_max_read_size(struct smbXcli_conn *conn)
{
return conn->smb2.server.max_read_size;
} | 0 | [
"CWE-20"
] | samba | a819d2b440aafa3138d95ff6e8b824da885a70e9 | 273,227,438,736,895,460,000,000,000,000,000,000,000 | 4 | CVE-2015-5296: libcli/smb: make sure we require signing when we demand encryption on a session
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org> |
template<typename tz, typename tc>
CImg<T>& draw_triangle(CImg<tz>& zbuffer,
int x0, int y0, const float z0,
int x1, int y1, const float z1,
int x2, int y2, const float z2,
const tc *const color,
... | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 59,153,175,287,040,870,000,000,000,000,000,000,000 | 76 | . |
static int ctnetlink_change_protoinfo(struct nf_conn *ct,
const struct nlattr * const cda[])
{
const struct nlattr *attr = cda[CTA_PROTOINFO];
const struct nf_conntrack_l4proto *l4proto;
struct nlattr *tb[CTA_PROTOINFO_MAX+1];
int err = 0;
err = nla_parse_nested_deprecated(tb, CTA_PROTOINFO_MAX, attr,
... | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 108,745,854,145,270,770,000,000,000,000,000,000,000 | 19 | 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 ... |
MagickExport XWindows *XSetWindows(XWindows *windows_info)
{
static XWindows
*windows = (XWindows *) NULL;
if (windows_info != (XWindows *) ~0)
{
windows=(XWindows *) RelinquishMagickMemory(windows);
windows=windows_info;
}
return(windows);
} | 0 | [
"CWE-401"
] | ImageMagick6 | 13801f5d0bd7a6fdb119682d34946636afdb2629 | 39,650,467,375,739,330,000,000,000,000,000,000,000 | 12 | https://github.com/ImageMagick/ImageMagick/issues/1531 |
static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
{
struct commit_list *p;
int left_count = 0, right_count = 0;
int left_first;
struct patch_ids ids;
/* First count the commits on the left and on the right */
for (p = list; p; p = p->next) {
struct commit *commit = p->item;
unsign... | 0 | [
"CWE-119"
] | git | fd55a19eb1d49ae54008d932a65f79cd6fda45c9 | 40,207,808,541,764,570,000,000,000,000,000,000,000 | 84 | Fix buffer overflow in git diff
If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com> |
static void mark_ptr_or_null_regs(struct bpf_verifier_state *vstate, u32 regno,
bool is_null)
{
struct bpf_func_state *state = vstate->frame[vstate->curframe];
struct bpf_reg_state *regs = state->regs;
u32 ref_obj_id = regs[regno].ref_obj_id;
u32 id = regs[regno].id;
int i;
if (ref_obj_id && ref_obj_id == ... | 0 | [
"CWE-119",
"CWE-681",
"CWE-787"
] | linux | 5b9fbeb75b6a98955f628e205ac26689bcb1383e | 208,114,140,071,838,340,000,000,000,000,000,000,000 | 19 | bpf: Fix scalar32_min_max_or bounds tracking
Simon reported an issue with the current scalar32_min_max_or() implementation.
That is, compared to the other 32 bit subreg tracking functions, the code in
scalar32_min_max_or() stands out that it's using the 64 bit registers instead
of 32 bit ones. This leads to bounds tra... |
Curl_sec_login(struct connectdata *conn)
{
return choose_mech(conn);
} | 0 | [
"CWE-415"
] | curl | 9069838b30fb3b48af0123e39f664cea683254a5 | 264,386,478,911,192,420,000,000,000,000,000,000,000 | 4 | security:read_data fix bad realloc()
... that could end up a double-free
CVE-2019-5481
Bug: https://curl.haxx.se/docs/CVE-2019-5481.html |
ip_optprint(netdissect_options *ndo,
register const u_char *cp, u_int length)
{
register u_int option_len;
const char *sep = "";
for (; length > 0; cp += option_len, length -= option_len) {
u_int option_code;
ND_PRINT((ndo, "%s", sep));
sep = ",";
ND_TCHECK(*cp);
option_code = *cp;
ND_PRI... | 0 | [
"CWE-125",
"CWE-787"
] | tcpdump | 2c2cfbd2b771ac888bc5c4a6d922f749d3822538 | 80,259,220,127,797,700,000,000,000,000,000,000,000 | 75 | CVE-2017-13037/IP: Add bounds checks when printing time stamp options.
This fixes a buffer over-read discovered by Bhargava Shastry,
SecT/TU Berlin.
Add a test using the capture file supplied by the reporter(s), modified
so the capture file won't be rejected as an invalid capture. |
void Compute(OpKernelContext *ctx) override {
const Tensor *a_indices_t, *a_values_t, *a_shape_t, *b_indices_t,
*b_values_t, *b_shape_t;
OP_REQUIRES_OK(ctx, ctx->input("a_indices", &a_indices_t));
OP_REQUIRES_OK(ctx, ctx->input("a_values", &a_values_t));
OP_REQUIRES_OK(ctx, ctx->input("a_shape... | 0 | [
"CWE-369",
"CWE-754"
] | tensorflow | f6fde895ef9c77d848061c0517f19d0ec2682f3a | 146,102,284,664,006,540,000,000,000,000,000,000,000 | 112 | Validate that a and b are proper sparse tensors
PiperOrigin-RevId: 373274848
Change-Id: I3a665ac3a29dee9fb69bdf408a939330cb93ea75 |
static void kvm_hv_hypercall_read_xmm(struct kvm_hv_hcall *hc)
{
int reg;
kvm_fpu_get();
for (reg = 0; reg < HV_HYPERCALL_MAX_XMM_REGISTERS; reg++)
_kvm_read_sse_reg(reg, &hc->xmm[reg]);
kvm_fpu_put();
} | 0 | [
"CWE-476"
] | linux | 7ec37d1cbe17d8189d9562178d8b29167fe1c31a | 152,050,801,521,324,650,000,000,000,000,000,000,000 | 9 | KVM: x86: Check lapic_in_kernel() before attempting to set a SynIC irq
When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for
irqchip_in_kernel() so normally SynIC irqs should never be set. It is,
however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs
causing erroneous behavior.
The immedi... |
void Field_null::sql_type(String &res) const
{
res.set_ascii(STRING_WITH_LEN("null"));
} | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 186,115,728,176,987,900,000,000,000,000,000,000,000 | 4 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
static void event_duplicate_channel(IRC_SERVER_REC *server, const char *data)
{
CHANNEL_REC *chanrec;
char *params, *channel, *p;
g_return_if_fail(data != NULL);
/* this new addition to ircd breaks completely with older
"standards", "nick Duplicate ::!!channel ...." */
params = event_get_params(data, 3, NULL... | 0 | [
"CWE-416"
] | irssi | 43e44d553d44e313003cee87e6ea5e24d68b84a1 | 266,912,215,209,468,600,000,000,000,000,000,000,000 | 24 | Merge branch 'security' into 'master'
Security
Closes GL#12, GL#13, GL#14, GL#15, GL#16
See merge request irssi/irssi!23 |
_put_anchor_news(Buffer *buf, char *p1, char *p2, int line, int pos)
{
Str tmp;
if (*p1 == '<') {
p1++;
if (*(p2 - 1) == '>')
p2--;
}
tmp = Strnew_charp("news:");
Strcat_charp_n(tmp, p1, p2 - p1);
return registerHref(buf, url_encode(tmp->ptr, baseURL(buf),
buf->document_charset),
... | 0 | [
"CWE-119"
] | w3m | 4e464819dd360ffd3d58fa2a89216fe413cfcc74 | 35,698,544,698,088,170,000,000,000,000,000,000,000 | 16 | Prevent segfault due to buffer overflows in addMultirowsForm
Bug-Debian: https://github.com/tats/w3m/issues/21
Bug-Debian: https://github.com/tats/w3m/issues/26 |
static double mp_bitwise_and(_cimg_math_parser& mp) {
return (double)((longT)_mp_arg(2) & (longT)_mp_arg(3)); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 15,485,265,833,295,640,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
TEST_F(StreamInfoImplTest, RequestHeadersTest) {
StreamInfoImpl stream_info(Http::Protocol::Http2, test_time_.timeSystem(), nullptr);
EXPECT_FALSE(stream_info.getRequestHeaders());
Http::TestRequestHeaderMapImpl headers;
stream_info.setRequestHeaders(headers);
EXPECT_EQ(&headers, stream_info.getRequestHeader... | 0 | [
"CWE-416"
] | envoy | fe7c69c248f4fe5a9080c7ccb35275b5218bb5ab | 198,590,721,318,881,860,000,000,000,000,000,000,000 | 8 | internal redirect: fix a lifetime bug (#785)
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
bool vgacon_text_force(void)
{
return vgacon_text_mode_force;
} | 0 | [
"CWE-125"
] | linux | 973c096f6a85e5b5f2a295126ba6928d9a6afd45 | 182,049,336,403,022,830,000,000,000,000,000,000,000 | 4 | vgacon: remove software scrollback support
Yunhai Zhang recently fixed a VGA software scrollback bug in commit
ebfdfeeae8c0 ("vgacon: Fix for missing check in scrollback handling"),
but that then made people look more closely at some of this code, and
there were more problems on the vgacon side, but also the fbcon sof... |
remove_upattern (param, pattern, op)
char *param, *pattern;
int op;
{
register int len;
register char *end;
register char *p, *ret, c;
len = STRLEN (param);
end = param + len;
switch (op)
{
case RP_LONG_LEFT: /* remove longest match at start */
for (p = end; p >= param; p--)
{
... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 35,805,870,687,002,048,000,000,000,000,000,000,000 | 69 | bash-4.4-rc2 release |
on_reauthentication_conversation_started (GdmSession *session,
const char *service_name,
ReauthenticationRequest *request)
{
g_debug ("GdmSessionWorker: reauthentication service '%s' started",
... | 0 | [
"CWE-362"
] | gdm | dcdbaaa04012541ad2813cf83559d91d52f208b9 | 297,652,806,861,450,200,000,000,000,000,000,000,000 | 7 | session-worker: Don't switch back VTs until session is fully exited
There's a race condition on shutdown where the session worker is
switching VTs back to the initial VT at the same time as the session
exit is being processed.
This means that manager may try to start a login screen (because of
the VT switch) when aut... |
~MemoryBuffer() FMT_OVERRIDE { deallocate(); } | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 36,103,380,237,198,965,000,000,000,000,000,000,000 | 1 | Fix segfault on complex pointer formatting (#642) |
void Http2Settings::RefreshDefaults(Http2State* http2_state) {
AliasedUint32Array& buffer = http2_state->settings_buffer;
uint32_t flags = 0;
#define V(name) \
do { \
buffer[IDX_SETT... | 0 | [
"CWE-416"
] | node | a3c33d4ce78f74d1cf1765704af5b427aa3840a6 | 235,411,870,262,049,900,000,000,000,000,000,000,000 | 14 | http2: update handling of rst_stream with error code NGHTTP2_CANCEL
The PR updates the handling of rst_stream frames and adds all streams
to the pending list on receiving rst frames with the error code
NGHTTP2_CANCEL.
The changes will remove dependency on the stream state that may allow
bypassing the checks in certai... |
TEST_F(ConnectionManagerUtilityTest, DoNotRemoveConnectionUpgradeForWebSocketRequests) {
TestRequestHeaderMapImpl headers{{"connection", "upgrade"}, {"upgrade", "websocket"}};
EXPECT_EQ((MutateRequestRet{"10.0.0.3:50000", false, Tracing::Reason::NotTraceable}),
callMutateRequestHeaders(headers, Protoco... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 54,894,971,046,174,370,000,000,000,000,000,000,000 | 8 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
{
edge_connection_t *n_stream;
relay_header_t rh;
char *address = NULL;
uint16_t port = 0;
or_circuit_t *or_circ = NULL;
origin_circuit_t *origin_circ = NULL;
crypt_path_t *layer_hint = NULL;
const or_options_t *options = get_options();
begin_c... | 0 | [
"CWE-532"
] | tor | 80c404c4b79f3bcba3fc4585d4c62a62a04f3ed9 | 152,799,313,355,103,910,000,000,000,000,000,000,000 | 189 | Log warning when connecting to soon-to-be-deprecated v2 onions. |
ar6000_free_cookie(struct ar6_softc *ar, struct ar_cookie * cookie)
{
/* Insert first */
A_ASSERT(ar != NULL);
A_ASSERT(cookie != NULL);
cookie->arc_list_next = ar->arCookieList;
ar->arCookieList = cookie;
ar->arCookieCount++;
} | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 252,136,912,714,733,200,000,000,000,000,000,000,000 | 10 | 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... |
void RtmpProtocol::sendRtmp(uint8_t type, uint32_t stream_index, const std::string &buffer, uint32_t stamp, int chunk_id) {
sendRtmp(type, stream_index, std::make_shared<BufferString>(buffer), stamp, chunk_id);
} | 0 | [
"CWE-703"
] | ZLMediaKit | 7d8b212a3c3368bc2f6507cb74664fc419eb9327 | 163,382,498,600,768,100,000,000,000,000,000,000,000 | 3 | 修复rtmp汇报窗口太小导致循环递归的bug:#1839 |
extern "C" void enc_set_error_handler(
void (*abort_handler)(const char *message)) {
error_handler = abort_handler;
} | 0 | [
"CWE-125"
] | asylo | 90d7619e9dd99bcdb6cd28c7649d741d254d9a1a | 244,178,526,018,590,120,000,000,000,000,000,000,000 | 4 | Add sysno check in MessageReader
The sysno in MessageReader is interpreted from the Message header passed
from the host. A malicious Message header may provide a modified sysno
to bypass the validation, and overwrites enclave memory. This change
adds a check for sysno to make sure it matches the expected value.
This ... |
int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
const ASN1_ITEM *it)
{
ASN1_BOOLEAN *tbool = NULL;
ASN1_STRING *strtmp;
ASN1_OBJECT *otmp;
int utype;
const unsigned char *cont;
unsigned char c;
int len;
const ASN1_PRIMITIVE_FUNCS *pf;
pf = it->fun... | 1 | [
"CWE-119"
] | openssl | f5da52e308a6aeea6d5f3df98c4da295d7e9cc27 | 297,074,737,720,793,100,000,000,000,000,000,000,000 | 121 | Fix ASN1_INTEGER handling.
Only treat an ASN1_ANY type as an integer if it has the V_ASN1_INTEGER
tag: V_ASN1_NEG_INTEGER is an internal only value which is never used
for on the wire encoding.
Thanks to David Benjamin <davidben@google.com> for reporting this bug.
This was found using libFuzzer.
RT#4364 (part)CVE-2... |
HotStandbyActiveInReplay(void)
{
Assert(AmStartupProcess());
return LocalHotStandbyActive;
} | 0 | [
"CWE-119"
] | postgres | 01824385aead50e557ca1af28640460fa9877d51 | 40,169,266,226,615,086,000,000,000,000,000,000,000 | 5 | Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that a
string being copied into a fixed-size buffer would fit. We believe that
most, perhaps all of these are in fact safe, or are copying data that is
coming from a trusted source so that any overrun i... |
path_is_valid (GKeyfileSettingsBackend *kfsb,
const gchar *path)
{
return convert_path (kfsb, path, NULL, NULL);
} | 0 | [
"CWE-732"
] | glib | 5e4da714f00f6bfb2ccd6d73d61329c6f3a08429 | 335,125,006,321,107,080,000,000,000,000,000,000,000 | 5 | keyfile settings: Use tighter permissions
When creating directories, create them with 700 permissions,
instead of 777.
Closes: #1658 |
subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts,
MY_BITMAP *partial_match_key_parts)
{
THD *thd= get_thd();
/* The length in bytes of the rowids (positions) of tmp_table. */
uint rowid_length= tmp_table->file->ref_length;
ha_rows row_count= tmp_table->file->st... | 0 | [
"CWE-89"
] | server | 3c209bfc040ddfc41ece8357d772547432353fd2 | 268,028,267,929,135,450,000,000,000,000,000,000,000 | 161 | MDEV-25994: Crash with union of my_decimal type in ORDER BY clause
When single-row subquery fails with "Subquery reutrns more than 1 row"
error, it will raise an error and return NULL.
On the other hand, Item_singlerow_subselect sets item->maybe_null=0
for table-less subqueries like "(SELECT not_null_value)" (*)
Th... |
static int packet_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen)
{
int len;
int val, lv = sizeof(val);
struct sock *sk = sock->sk;
struct packet_sock *po = pkt_sk(sk);
void *data = &val;
union tpacket_stats_u st;
struct tpacket_rollover_stats rstats;
int... | 0 | [
"CWE-787"
] | linux | acf69c946233259ab4d64f8869d4037a198c7f06 | 194,842,900,516,787,260,000,000,000,000,000,000,000 | 121 | net/packet: fix overflow in tpacket_rcv
Using tp_reserve to calculate netoff can overflow as
tp_reserve is unsigned int and netoff is unsigned short.
This may lead to macoff receving a smaller value then
sizeof(struct virtio_net_hdr), and if po->has_vnet_hdr
is set, an out-of-bounds write will occur when
calling virt... |
static int genev_tun_opt_from_nlattr(const struct nlattr *a,
struct sw_flow_match *match, bool is_mask,
bool log)
{
unsigned long opt_key_offset;
if (nla_len(a) > sizeof(match->key->tun_opts)) {
OVS_NLERR(log, "Geneve option length err (len %d, max %zu).",
nla_len(a), sizeof(match->key->tun_... | 0 | [
"CWE-362",
"CWE-787"
] | linux | cefa91b2332d7009bc0be5d951d6cbbf349f90f8 | 8,779,328,496,557,147,000,000,000,000,000,000,000 | 50 | openvswitch: fix OOB access in reserve_sfa_size()
Given a sufficiently large number of actions, while copying and
reserving memory for a new action of a new flow, if next_offset is
greater than MAX_ACTIONS_BUFSIZE, the function reserve_sfa_size() does
not return -EMSGSIZE as expected, but it allocates MAX_ACTIONS_BUFS... |
static const char *cmd_marker(cmd_parms *cmd, void *_dcfg, const char *p1)
{
directory_config *dcfg = (directory_config *)_dcfg;
const char *action = apr_pstrcat(dcfg->mp, SECMARKER_BASE_ACTIONS, p1, NULL);
return add_marker(cmd, (directory_config *)_dcfg, SECMARKER_TARGETS, SECMARKER_ARGS, action);
} | 0 | [
"CWE-20",
"CWE-611"
] | ModSecurity | d4d80b38aa85eccb26e3c61b04d16e8ca5de76fe | 230,378,487,594,959,900,000,000,000,000,000,000,000 | 6 | Added SecXmlExternalEntity |
static int issue_discard_thread(void *data)
{
struct f2fs_sb_info *sbi = data;
struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
wait_queue_head_t *q = &dcc->discard_wait_queue;
set_freezable();
do {
wait_event_interruptible(*q, kthread_should_stop() ||
freezing(current) ||
atomic_read(&dcc->dis... | 0 | [
"CWE-200",
"CWE-476"
] | linux | d4fdf8ba0e5808ba9ad6b44337783bd9935e0982 | 248,581,164,856,418,420,000,000,000,000,000,000,000 | 24 | f2fs: fix a panic caused by NULL flush_cmd_control
Mount fs with option noflush_merge, boot failed for illegal address
fcc in function f2fs_issue_flush:
if (!test_opt(sbi, FLUSH_MERGE)) {
ret = submit_flush_wait(sbi);
atomic_inc(&fcc->issued_flush); -> Here, fcc illegal
... |
static ssize_t generic_perform_write_2copy(struct file *file,
struct iov_iter *i, loff_t pos)
{
struct address_space *mapping = file->f_mapping;
const struct address_space_operations *a_ops = mapping->a_ops;
struct inode *inode = mapping->host;
long status = 0;
ssize_t written = 0;
do {
struct page *src_pa... | 0 | [
"CWE-193"
] | linux-2.6 | 94ad374a0751f40d25e22e036c37f7263569d24c | 20,914,530,940,183,921,000,000,000,000,000,000,000 | 167 | Fix off-by-one error in iov_iter_advance()
The iov_iter_advance() function would look at the iov->iov_len entry
even though it might have iterated over the whole array, and iov was
pointing past the end. This would cause DEBUG_PAGEALLOC to trigger a
kernel page fault if the allocation was at the end of a page, and th... |
int recv_files(int f_in, int f_out, char *local_name)
{
int fd1,fd2;
STRUCT_STAT st;
int iflags, xlen;
char *fname, fbuf[MAXPATHLEN];
char xname[MAXPATHLEN];
char *fnametmp, fnametmpbuf[MAXPATHLEN];
char *fnamecmp, *partialptr;
char fnamecmpbuf[MAXPATHLEN];
uchar fnamecmp_type;
struct file_struct *file;
int ... | 0 | [] | rsync | b7231c7d02cfb65d291af74ff66e7d8c507ee871 | 272,314,085,063,953,300,000,000,000,000,000,000,000 | 461 | Some extra file-list safety checks. |
static int ieee80211_parse_info_param(struct ieee80211_info_element
*info_element, u16 length,
struct ieee80211_network *network)
{
u8 i;
#ifdef CONFIG_IEEE80211_DEBUG
char rates_str[64];
char *p;
#endif
while (length >= sizeof(*info_element)) {
if (sizeof(*info_element) + info_element->len >... | 0 | [
"CWE-189"
] | linux-2.6 | 04045f98e0457aba7d4e6736f37eed189c48a5f7 | 280,087,613,369,696,830,000,000,000,000,000,000,000 | 220 | [IEEE80211]: avoid integer underflow for runt rx frames
Reported by Chris Evans <scarybeasts@gmail.com>:
> The summary is that an evil 80211 frame can crash out a victim's
> machine. It only applies to drivers using the 80211 wireless code, and
> only then to certain drivers (and even then depends on a card's
> firmw... |
lA2la(UINT8 *out, const UINT8 *in, int xsize) {
int x;
unsigned int alpha, pixel, tmp;
for (x = 0; x < xsize; x++, in += 4) {
alpha = in[3];
pixel = MULDIV255(in[0], alpha, tmp);
*out++ = (UINT8)pixel;
*out++ = (UINT8)pixel;
*out++ = (UINT8)pixel;
*out++ = (UI... | 0 | [
"CWE-120"
] | Pillow | 518ee3722a99d7f7d890db82a20bd81c1c0327fb | 314,484,680,462,569,300,000,000,000,000,000,000,000 | 12 | Use snprintf instead of sprintf |
void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) {
assert(UseVectorizedMismatchIntrinsic, "need AVX instruction support");
// Make all state_for calls early since they can emit code
LIR_Opr result = rlock_result(x);
LIRItem a(x->argument_at(0), this); // Object
LIRItem aOffset(x->argument_at(1), this)... | 0 | [] | jdk17u | 268c0159253b3de5d72eb826ef2329b27bb33fea | 31,809,355,793,660,260,000,000,000,000,000,000,000 | 74 | 8272014: Better array indexing
Reviewed-by: thartmann
Backport-of: 937c31d896d05aa24543b74e98a2ea9f05b5d86f |
static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p)
{
int error;
DEFINE_WAIT(wait);
prepare_to_wait_exclusive(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
/* Socket errors? */
error = sock_error(sk);
if (error)
goto out;
if (!skb_queue_empty(&sk->sk_receive_queue))
goto ready;
/* Soc... | 0 | [
"CWE-400"
] | linux-2.6 | c377411f2494a931ff7facdbb3a6839b1266bcf6 | 181,844,530,136,943,670,000,000,000,000,000,000,000 | 53 | net: sk_add_backlog() take rmem_alloc into account
Current socket backlog limit is not enough to really stop DDOS attacks,
because user thread spend many time to process a full backlog each
round, and user might crazy spin on socket lock.
We should add backlog size and receive_queue size (aka rmem_alloc) to
pace writ... |
intrusive_ptr<Expression> ExpressionMeta::parse(
const boost::intrusive_ptr<ExpressionContext>& expCtx,
BSONElement expr,
const VariablesParseState& vpsIn) {
uassert(17307, "$meta only supports string arguments", expr.type() == String);
const auto iter = kMetaNameToMetaType.find(expr.valueStringDat... | 0 | [
"CWE-190"
] | mongo | 21d8699ed6c517b45e1613e20231cd8eba894985 | 73,050,460,012,990,390,000,000,000,000,000,000,000 | 13 | SERVER-43699 $mod should not overflow for large negative values |
static BOOL nego_tcp_connect(rdpNego* nego)
{
if (!nego->TcpConnected)
{
if (nego->GatewayEnabled)
{
if (nego->GatewayBypassLocal)
{
/* Attempt a direct connection first, and then fallback to using the gateway */
WLog_INFO(TAG,
"Detecting if host can be reached locally. - This might ta... | 0 | [
"CWE-125"
] | FreeRDP | 6b485b146a1b9d6ce72dfd7b5f36456c166e7a16 | 312,842,330,926,295,980,000,000,000,000,000,000,000 | 32 | Fixed oob read in irp_write and similar |
const char *ssl_get_ciphersuite_name( const int ciphersuite_id )
{
switch( ciphersuite_id )
{
#if defined(POLARSSL_ARC4_C)
case TLS_RSA_WITH_RC4_128_MD5:
return( "TLS-RSA-WITH-RC4-128-MD5" );
case TLS_RSA_WITH_RC4_128_SHA:
return( "TLS-RSA-WITH-RC4-128-SHA" );
#endif
#i... | 0 | [
"CWE-310"
] | polarssl | 4582999be608c9794d4518ae336b265084db9f93 | 288,597,243,564,115,530,000,000,000,000,000,000,000 | 116 | Fixed timing difference resulting from badly formatted padding. |
re_compile_pattern (pattern, length, bufp)
const char *pattern;
size_t length;
struct re_pattern_buffer *bufp;
{
reg_errcode_t ret;
/* GNU code is written to assume at least RE_NREGS registers will be set
(and at least one extra will be -1). */
bufp->regs_allocated = REGS_UNALLOCATED;
/* ... | 0 | [
"CWE-190",
"CWE-252"
] | glibc | 2864e767053317538feafa815046fff89e5a16be | 173,447,428,478,840,500,000,000,000,000,000,000,000 | 25 | Update.
1999-11-09 Ulrich Drepper <drepper@cygnus.com>
* elf/dl-load.c (_dl_dst_count): Allow $ORIGIN to point to
directory with the reference since this is as secure as using the
object with the dependency.
(_dl_dst_substitute): Likewise.
* elf/dl-load.c (_dl_dst_count): Change strings in first two
strncmp ... |
Timestamp PipelineD::getLatestOplogTimestamp(const Pipeline* pipeline) {
if (auto docSourceCursor =
dynamic_cast<DocumentSourceCursor*>(pipeline->_sources.front().get())) {
return docSourceCursor->getLatestOplogTimestamp();
}
return Timestamp();
} | 0 | [
"CWE-617"
] | mongo | f3604b901d688c194de5e430c7fbab060c9dc8e0 | 188,188,498,433,043,700,000,000,000,000,000,000,000 | 7 | SERVER-59071 Treat '$sample' as unsharded when connecting directly to shards |
static int loop_clr_fd(struct loop_device *lo)
{
struct file *filp = lo->lo_backing_file;
gfp_t gfp = lo->old_gfp_mask;
struct block_device *bdev = lo->lo_device;
if (lo->lo_state != Lo_bound)
return -ENXIO;
/*
* If we've explicitly asked to tear down the loop device,
* and it has an elevated reference cou... | 0 | [
"CWE-416",
"CWE-362"
] | linux | ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5 | 328,379,206,366,827,250,000,000,000,000,000,000,000 | 83 | loop: fix concurrent lo_open/lo_release
范龙飞 reports that KASAN can report a use-after-free in __lock_acquire.
The reason is due to insufficient serialization in lo_release(), which
will continue to use the loop device even after it has decremented the
lo_refcnt to zero.
In the meantime, another process can come in, o... |
eval_index(
char_u **arg,
typval_T *rettv,
evalarg_T *evalarg,
int verbose) // give error messages
{
int evaluate = evalarg != NULL
&& (evalarg->eval_flags & EVAL_EVALUATE);
int empty1 = FALSE, empty2 = FALSE;
typval_T var1, var2;
int range = FALSE;
char_u *key = NULL;
... | 0 | [
"CWE-786",
"CWE-119",
"CWE-787"
] | vim | fe6fb267e6ee5c5da2f41889e4e0e0ac5bf4b89d | 10,294,853,419,267,004,000,000,000,000,000,000,000 | 139 | patch 8.2.4206: condition with many "(" causes a crash
Problem: Condition with many "(" causes a crash.
Solution: Limit recursion to 1000. |
xfs_iflush(
struct xfs_inode *ip,
struct xfs_buf **bpp)
{
struct xfs_mount *mp = ip->i_mount;
struct xfs_buf *bp;
struct xfs_dinode *dip;
int error;
XFS_STATS_INC(xs_iflush_count);
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));
ASSERT(xfs_isiflocked(ip));
ASSERT(ip->i_d.di_format != XFS_DIN... | 0 | [
"CWE-19"
] | linux | fc0561cefc04e7803c0f6501ca4f310a502f65b8 | 176,513,895,287,149,430,000,000,000,000,000,000,000 | 93 | xfs: optimise away log forces on timestamp updates for fdatasync
xfs: timestamp updates cause excessive fdatasync log traffic
Sage Weil reported that a ceph test workload was writing to the
log on every fdatasync during an overwrite workload. Event tracing
showed that the only metadata modification being made was the... |
PrePutWinMsg(s, start, max)
char *s;
int start, max;
{
/* Avoid double-encoding problem for a UTF-8 message on a UTF-8 locale.
Ideally, this would not be necessary. But fixing it the Right Way will
probably take way more time. So this will have to do for now. */
if (D_encoding == UTF8)
{
int cha... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 151,682,783,177,846,320,000,000,000,000,000,000,000 | 24 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
MonoBoolean
mono_declsec_get_class_action (MonoClass *klass, guint32 action, MonoDeclSecurityEntry *entry)
{
/* use cache */
guint32 flags = mono_declsec_flags_from_class (klass);
if (declsec_flags_map [action] & flags) {
guint32 idx = mono_metadata_token_index (klass->type_token);
idx <<= MONO_HAS_DECL_SECURITY... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 109,228,599,878,442,360,000,000,000,000,000,000,000 | 12 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
static int vmx_set_identity_map_addr(struct kvm *kvm, u64 ident_addr)
{
to_kvm_vmx(kvm)->ept_identity_map_addr = ident_addr;
return 0;
} | 0 | [
"CWE-284"
] | linux | 727ba748e110b4de50d142edca9d6a9b7e6111d8 | 296,594,691,366,627,840,000,000,000,000,000,000,000 | 5 | 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... |
static int sk_comp_cmp(const SSL_COMP * const *a,
const SSL_COMP * const *b)
{
return((*a)->id-(*b)->id);
} | 0 | [] | openssl | edc032b5e3f3ebb1006a9c89e0ae00504f47966f | 15,061,140,516,636,310,000,000,000,000,000,000,000 | 5 | Add SRP support. |
static int parse_update_recurse(const char *opt, const char *arg,
int die_on_error)
{
switch (git_config_maybe_bool(opt, arg)) {
case 1:
return RECURSE_SUBMODULES_ON;
case 0:
return RECURSE_SUBMODULES_OFF;
default:
if (die_on_error)
die("bad %s argument: %s", opt, arg);
return RECURSE_SUBMODULES_ERRO... | 0 | [
"CWE-88"
] | git | f6adec4e329ef0e25e14c63b735a5956dc67b8bc | 127,446,989,925,785,950,000,000,000,000,000,000,000 | 14 | submodule-config: ban submodule urls that start with dash
The previous commit taught the submodule code to invoke our
"git clone $url $path" with a "--" separator so that we
aren't confused by urls or paths that start with dashes.
However, that's just one code path. It's not clear if there
are others, and it would be... |
check_method_noarg(mrb_state *mrb, const mrb_callinfo *ci)
{
mrb_int argc = ci->n == CALL_MAXARGS ? RARRAY_LEN(ci->stack[1]) : ci->n;
if (ci->nk > 0) {
mrb_value kdict = ci->stack[mrb_ci_kidx(ci)];
if (!(mrb_hash_p(kdict) && mrb_hash_empty_p(mrb, kdict))) {
argc++;
}
}
if (argc > 0) {
mrb_... | 0 | [
"CWE-703",
"CWE-125"
] | mruby | a4d97934d51cb88954cc49161dc1d151f64afb6b | 4,161,914,851,806,326,700,000,000,000,000,000,000 | 13 | vm.c: check if target_class is NULL (when prepended). |
arg_all(void)
{
int len;
int idx;
char_u *retval = NULL;
char_u *p;
// Do this loop two times:
// first time: compute the total length
// second time: concatenate the names
for (;;)
{
len = 0;
for (idx = 0; idx < ARGCOUNT; ++idx)
{
p = alist_name(&ARGLIST[idx]);
if (p... | 0 | [
"CWE-416",
"CWE-125"
] | vim | 6f98371532fcff911b462d51bc64f2ce8a6ae682 | 251,335,064,143,635,300,000,000,000,000,000,000,000 | 60 | patch 8.2.3884: crash when clearing the argument list while using it
Problem: Crash when clearing the argument list while using it.
Solution: Lock the argument list for ":all". |
ResetSelectionState(TScreen *screen)
{
screen->selection_count = 0;
screen->startH = zeroCELL;
screen->endH = zeroCELL;
} | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 332,212,492,717,478,930,000,000,000,000,000,000,000 | 6 | snapshot of project "xterm", label xterm-365d |
rb_check_string_type(str)
VALUE str;
{
str = rb_check_convert_type(str, T_STRING, "String", "to_str");
if (!NIL_P(str) && !RSTRING(str)->ptr) {
FL_SET(str, ELTS_SHARED);
RSTRING(str)->ptr = null_str;
}
return str;
} | 0 | [
"CWE-20"
] | ruby | e926ef5233cc9f1035d3d51068abe9df8b5429da | 202,216,020,714,716,100,000,000,000,000,000,000,000 | 10 | * random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
* string.c (rb_str_tmp_new), intern.h: New function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
static inline int ipv6_prefix_equal(const struct in6_addr *a1,
const struct in6_addr *a2,
unsigned int prefixlen)
{
return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32,
prefixlen);
} | 0 | [
"CWE-703"
] | linux | 87c48fa3b4630905f98268dde838ee43626a060c | 332,022,789,482,177,570,000,000,000,000,000,000,000 | 7 | ipv6: make fragment identifications less predictable
IPv6 fragment identification generation is way beyond what we use for
IPv4 : It uses a single generator. Its not scalable and allows DOS
attacks.
Now inetpeer is IPv6 aware, we can use it to provide a more secure and
scalable frag ident generator (per destination, ... |
static void coroutine_fn v9fs_version(void *opaque)
{
ssize_t err;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
V9fsString version;
size_t offset = 7;
v9fs_string_init(&version);
err = pdu_unmarshal(pdu, offset, "ds", &s->msize, &version);
if (err < 0) {
goto out;
}
tra... | 0 | [
"CWE-362"
] | qemu | 89fbea8737e8f7b954745a1ffc4238d377055305 | 184,759,479,476,759,730,000,000,000,000,000,000,000 | 56 | 9pfs: Fully restart unreclaim loop (CVE-2021-20181)
Depending on the client activity, the server can be asked to open a huge
number of file descriptors and eventually hit RLIMIT_NOFILE. This is
currently mitigated using a reclaim logic : the server closes the file
descriptors of idle fids, based on the assumption that... |
static int assess_device_allow(
const struct security_assessor *a,
const struct security_info *info,
const void *data,
uint64_t *ret_badness,
char **ret_description) {
char *d = NULL;
uint64_t b;
assert(info);
... | 0 | [
"CWE-269"
] | systemd | 9d880b70ba5c6ca83c82952f4c90e86e56c7b70c | 130,507,348,477,299,000,000,000,000,000,000,000,000 | 36 | analyze: check for RestrictSUIDSGID= in "systemd-analyze security"
And let's give it a heigh weight, since it pretty much can be used for
bad things only. |
ofputil_packet_in_format_to_string(enum nx_packet_in_format packet_in_format)
{
switch (packet_in_format) {
case NXPIF_STANDARD:
return "standard";
case NXPIF_NXT_PACKET_IN:
return "nxt_packet_in";
case NXPIF_NXT_PACKET_IN2:
return "nxt_packet_in2";
default:
OVS_NOT_R... | 0 | [
"CWE-772"
] | ovs | 77ad4225d125030420d897c873e4734ac708c66b | 255,034,799,545,002,900,000,000,000,000,000,000,000 | 13 | ofp-util: Fix memory leaks on error cases in ofputil_decode_group_mod().
Found by libFuzzer.
Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
void X509_email_free(STACK_OF(OPENSSL_STRING) *sk)
{
sk_OPENSSL_STRING_pop_free(sk, str_free);
} | 0 | [] | openssl | a70da5b3ecc3160368529677006801c58cb369db | 31,405,058,922,358,490,000,000,000,000,000,000,000 | 4 | New functions to check a hostname email or IP address against a
certificate. Add options to s_client, s_server and x509 utilities
to print results of checks. |
int open_tmpinfile(rzip_control *control)
{
int fd_in = -1;
/* Use temporary directory if there is one */
if (control->tmpdir) {
control->infile = malloc(strlen(control->tmpdir) + 15);
if (unlikely(!control->infile))
fatal_return(("Failed to allocate infile name\n"), -1);
strcpy(control->infile, control->t... | 0 | [
"CWE-703"
] | lrzip | 4b3942103b57c639c8e0f31d6d5fd7bac53bbdf4 | 4,057,440,968,141,421,500,000,000,000,000,000,000 | 49 | Fix possible race condition between zpaq_decompress_buf() and clear_rulist() function as reported by wcventure. |
Status InferenceContext::MakeShapeFromShapeTensor(int input_idx,
ShapeHandle* out) {
ShapeHandle input_shape;
TF_RETURN_IF_ERROR(WithRank(input(input_idx), 1, &input_shape));
request_input_tensor_as_partial_shape(input_idx);
const int input_tensors_as_shapes_si... | 0 | [
"CWE-190"
] | tensorflow | acd56b8bcb72b163c834ae4f18469047b001fadf | 253,332,198,367,692,200,000,000,000,000,000,000,000 | 18 | Fix security vulnerability with SpaceToBatchNDOp.
PiperOrigin-RevId: 445527615 |
void reset_vc(struct vc_data *vc)
{
vc->vc_mode = KD_TEXT;
vt_reset_unicode(vc->vc_num);
vc->vt_mode.mode = VT_AUTO;
vc->vt_mode.waitv = 0;
vc->vt_mode.relsig = 0;
vc->vt_mode.acqsig = 0;
vc->vt_mode.frsig = 0;
put_pid(vc->vt_pid);
vc->vt_pid = NULL;
vc->vt_newvt = -1;
if (!in_interrupt()) /* Via keyboard... | 0 | [
"CWE-662"
] | linux | 90bfdeef83f1d6c696039b6a917190dcbbad3220 | 815,618,657,743,328,200,000,000,000,000,000,000 | 15 | tty: make FONTX ioctl use the tty pointer they were actually passed
Some of the font tty ioctl's always used the current foreground VC for
their operations. Don't do that then.
This fixes a data race on fg_console.
Side note: both Michael Ellerman and Jiri Slaby point out that all these
ioctls are deprecated, and s... |
PHP_FUNCTION(ldap_modify_batch)
{
ldap_linkdata *ld;
zval *link, *mods, *mod, *modinfo, *modval;
zval *attrib, *modtype, *vals;
zval **fetched;
char *dn;
int dn_len;
int i, j, k;
int num_mods, num_modprops, num_modvals;
LDAPMod **ldap_mods;
uint oper;
/*
$mods = array(
array(
"attrib" => "unicodePwd",... | 0 | [
"CWE-476"
] | php-src | 49782c54994ecca2ef2a061063bd5a7079c43527 | 243,324,757,606,147,230,000,000,000,000,000,000,000 | 296 | Fix bug #76248 - Malicious LDAP-Server Response causes Crash |
static bool IsEnabled() {
static bool is_enabled = IsEnabledImpl();
return is_enabled;
} | 0 | [
"CWE-20"
] | tensorflow | 14755416e364f17fb1870882fa778c7fec7f16e3 | 10,022,216,990,070,943,000,000,000,000,000,000,000 | 4 | Prevent CHECK-fail in LSTM/GRU with zero-length input.
PiperOrigin-RevId: 346239181
Change-Id: I5f233dbc076aab7bb4e31ba24f5abd4eaf99ea4f |
readraster(void)
{
unsigned char *fill = raster;
unsigned char buf[255];
register int bits=0;
register unsigned long datum=0;
register unsigned char *ch;
register int count, code;
int status = 1;
datasize = getc(infile);
if (datasize > 12)
return 0;
clear = 1 << datasize;
e... | 0 | [
"CWE-119",
"CWE-787"
] | libtiff | ce6841d9e41d621ba23cf18b190ee6a23b2cc833 | 20,782,630,614,373,684,000,000,000,000,000,000,000 | 56 | fix possible OOB write in gif2tiff.c |
png_set_compression_level(png_structrp png_ptr, int level)
{
png_debug(1, "in png_set_compression_level");
if (png_ptr == NULL)
return;
png_ptr->zlib_level = level;
} | 0 | [
"CWE-120"
] | libpng | 81f44665cce4cb1373f049a76f3904e981b7a766 | 29,223,636,560,958,915,000,000,000,000,000,000,000 | 9 | [libpng16] Reject attempt to write over-length PLTE chunk |
xmlXPtrNewRangeNodeObject(xmlNodePtr start, xmlXPathObjectPtr end) {
xmlXPathObjectPtr ret;
if (start == NULL)
return(NULL);
if (end == NULL)
return(NULL);
switch (end->type) {
case XPATH_POINT:
case XPATH_RANGE:
break;
case XPATH_NODESET:
/*
* Empty set ...
*/
if (end->... | 1 | [
"CWE-119"
] | libxml2 | c1d1f7121194036608bf555f08d3062a36fd344b | 235,942,505,000,228,130,000,000,000,000,000,000,000 | 53 | Disallow namespace nodes in XPointer ranges
Namespace nodes must be copied to avoid use-after-free errors.
But they don't necessarily have a physical representation in a
document, so simply disallow them in XPointer ranges.
Found with afl-fuzz.
Fixes CVE-2016-4658. |
void sc_call_snap_update_ns_as_user(int snap_update_ns_fd,
const char *snap_name,
struct sc_apparmor *apparmor)
{
char *snap_name_copy SC_CLEANUP(sc_cleanup_string) = NULL;
snap_name_copy = sc_strdup(snap_name);
char aa_profile[PATH_MAX] = { 0 };
sc_must_snprintf(aa_profile, sizeof aa_profile, "sna... | 0 | [
"CWE-94"
] | snapd | 54e71e7750f73a28f5a47fe04dd058360e24c0e9 | 30,770,886,459,846,546,000,000,000,000,000,000,000 | 37 | cmd/libsnap-confine-private: Defend against hardlink attacks
When snap-confine goes to execute other helper binaries (snap-update-ns
etc) via sc_open_snapd_tool(), these other binaries are located relative to
the currently executing snap-confine process via /proc/self/exe. Since it
is possible for regular users to har... |
int set_char(DviContext *dvi, int opcode)
{
int num;
int h;
int hh;
DviFontChar *ch;
DviFont *font;
if(opcode < 128)
num = opcode;
else
num = dugetn(dvi, opcode - DVI_SET1 + 1);
if(dvi->currfont == NULL) {
dvierr(dvi, _("no default font set yet\n"));
return -1;
}
font = dvi->currfont->ref;
ch = fon... | 0 | [
"CWE-20"
] | evince | d4139205b010ed06310d14284e63114e88ec6de2 | 139,545,916,213,609,520,000,000,000,000,000,000,000 | 54 | backends: Fix several security issues in the dvi-backend.
See CVE-2010-2640, CVE-2010-2641, CVE-2010-2642 and CVE-2010-2643. |
dissect_kafka_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int end_offset)
{
gint8 magic_byte;
guint32 message_size;
if (offset + 12 > end_offset) {
// in this case we deal with truncated message, where the size part may be also truncated
// actually we... | 0 | [
"CWE-401"
] | wireshark | f4374967bbf9c12746b8ec3cd54dddada9dd353e | 313,126,940,809,231,900,000,000,000,000,000,000,000 | 26 | Kafka: Limit our decompression size.
Don't assume that the Internet has our best interests at heart when it
gives us the size of our decompression buffer. Assign an arbitrary limit
of 50 MB.
This fixes #16739 in that it takes care of
** (process:17681): WARNING **: 20:03:07.440: Dissector bug, protocol Kafka, in pac... |
static OPJ_BOOL opj_j2k_calculate_tp( opj_j2k_t *p_j2k,
opj_cp_t *cp,
OPJ_UINT32 * p_nb_tiles,
opj_image_t *image,
... | 0 | [
"CWE-416"
] | openjpeg | 940100c28ae28931722290794889cf84a92c5f6f | 152,919,021,500,196,980,000,000,000,000,000,000,000 | 77 | Fix potential use-after-free in opj_j2k_write_mco function
Fixes #563 |
static int xps_finish_copydevice(gx_device *dev, const gx_device *from_dev)
{
gx_device_xps *xps = (gx_device_xps*)dev;
memset(xps->PrinterName, 0x00, MAXPRINTERNAME);
return 0;
} | 0 | [] | ghostpdl | 94d8955cb7725eb5f3557ddc02310c76124fdd1a | 130,030,370,246,518,990,000,000,000,000,000,000,000 | 7 | Bug 701818: better handling of error during PS/PDF image
In the xps device, if an error occurred after xps_begin_image() but before
xps_image_end_image(), *if* the Postscript had called 'restore' as part of the
error handling, the image enumerator would have been freed (by the restore)
despite the xps device still hol... |
TPMT_KDF_SCHEME_Marshal(TPMT_KDF_SCHEME *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPMI_ALG_KDF_Marshal(&source->scheme, buffer, size);
written += TPMU_KDF_SCHEME_Marshal(&source->details, buffer, size, source->scheme);
return written;
} | 0 | [
"CWE-787"
] | libtpms | 3ef9b26cb9f28bd64d738bff9505a20d4eb56acd | 163,201,684,737,926,490,000,000,000,000,000,000,000 | 8 | tpm2: Add maxSize parameter to TPM2B_Marshal for sanity checks
Add maxSize parameter to TPM2B_Marshal and assert on it checking
the size of the data intended to be marshaled versus the maximum
buffer size.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
static void __unlink_end_trans(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
{
if (trans->block_rsv->type == BTRFS_BLOCK_RSV_GLOBAL) {
btrfs_block_rsv_release(root, trans->block_rsv,
trans->bytes_reserved);
trans->block_rsv = &root->fs_info->trans_block_rsv;
BUG_ON(!root->fs_info->eno... | 0 | [
"CWE-310"
] | linux-2.6 | 9c52057c698fb96f8f07e7a4bcf4801a092bda89 | 79,301,520,022,396,890,000,000,000,000,000,000,000 | 12 | 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... |
Payload FileBody::NextPayload(bool /*free_previous*/) {
if (ifstream_.read(&chunk_[0], chunk_.size()).gcount() > 0) {
return {
boost::asio::buffer(chunk_.data(), (std::size_t)ifstream_.gcount())
};
}
return {};
} | 0 | [
"CWE-22"
] | webcc | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | 194,745,893,413,433,800,000,000,000,000,000,000,000 | 8 | fix static file serving security issue; fix url path encoding issue |
void PropertiesWidget::loadDynamicData()
{
// Refresh only if the torrent handle is valid and if visible
if (!m_torrent || (main_window->currentTabWidget() != transferList) || (state != VISIBLE)) return;
// Transfer infos
switch (stackedProperties->currentIndex()) {
case PropTabBar::MAIN_TAB: {
... | 0 | [
"CWE-20",
"CWE-79"
] | qBittorrent | 6ca3e4f094da0a0017cb2d483ec1db6176bb0b16 | 277,211,336,899,570,400,000,000,000,000,000,000,000 | 119 | Add Utils::String::toHtmlEscaped |
send_dbus_void_method (DBusConnection *connection,
const char *method)
{
DBusError error;
DBusMessage *message;
DBusMessage *reply;
g_debug ("GdmSessionWorker: Calling %s", method);
message = dbus_message_new_method_call (NULL,
... | 0 | [] | gdm | c25ef9245be4e0be2126ef3d075df4401949b570 | 201,540,712,150,918,530,000,000,000,000,000,000,000 | 38 | Store the face and dmrc files in a cache. Refer to bug #565151. |
void gd_error(const char *format, ...)
{
va_list args;
va_start(args, format);
_gd_error_ex(GD_WARNING, format, args);
va_end(args);
} | 0 | [
"CWE-20"
] | libgd | 1846f48e5fcdde996e7c27a4bbac5d0aef183e4b | 233,296,581,818,295,930,000,000,000,000,000,000,000 | 8 | Fix #340: System frozen
gdImageCreate() doesn't check for oversized images and as such is prone
to DoS vulnerabilities. We fix that by applying the same overflow check
that is already in place for gdImageCreateTrueColor().
CVE-2016-9317 |
static void cleanup_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int err)
{
struct btrfs_transaction *cur_trans = trans->transaction;
WARN_ON(trans->use_count > 1);
btrfs_abort_transaction(trans, root, err);
spin_lock(&root->fs_info->trans_lock);
list_del_init(&cur_trans->list);
i... | 0 | [
"CWE-310"
] | linux-2.6 | 9c52057c698fb96f8f07e7a4bcf4801a092bda89 | 46,775,599,348,567,250,000,000,000,000,000,000,000 | 31 | 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... |
static struct tipc_sock *tipc_sk_lookup(struct net *net, u32 portid)
{
struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_sock *tsk;
rcu_read_lock();
tsk = rhashtable_lookup(&tn->sk_rht, &portid, tsk_rht_params);
if (tsk)
sock_hold(&tsk->sk);
rcu_read_unlock();
return tsk;
} | 0 | [
"CWE-200",
"CWE-909"
] | linux | d6d86830705f173fca6087a3e67ceaf68db80523 | 332,995,854,048,908,900,000,000,000,000,000,000,000 | 13 | net ticp:fix a kernel-infoleak in __tipc_sendmsg()
struct tipc_socket_addr.ref has a 4-byte hole,and __tipc_getname() currently
copying it to user space,causing kernel-infoleak.
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:121 [inline]
BUG: KMSAN: kernel-infoleak in instrument_c... |
static int acp_poweroff(struct generic_pm_domain *genpd)
{
struct acp_pm_domain *apd;
struct amdgpu_device *adev;
apd = container_of(genpd, struct acp_pm_domain, gpd);
if (apd != NULL) {
adev = apd->adev;
/* call smu to POWER GATE ACP block
* smu will
* 1. turn off the acp clock
* 2. power off the acp til... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 57be09c6e8747bf48704136d9e3f92bfb93f5725 | 153,362,590,648,759,450,000,000,000,000,000,000,000 | 20 | drm/amdgpu: fix multiple memory leaks in acp_hw_init
In acp_hw_init there are some allocations that needs to be released in
case of failure:
1- adev->acp.acp_genpd should be released if any allocation attemp for
adev->acp.acp_cell, adev->acp.acp_res or i2s_pdata fails.
2- all of those allocations should be released i... |
void ring_buffer_iter_advance(struct ring_buffer_iter *iter)
{
struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer;
unsigned long flags;
raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
rb_advance_iter(iter);
raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
} | 0 | [
"CWE-362"
] | linux | bbeb97464eefc65f506084fd9f18f21653e01137 | 62,032,522,506,099,235,000,000,000,000,000,000,000 | 11 | tracing: Fix race in trace_open and buffer resize call
Below race can come, if trace_open and resize of
cpu buffer is running parallely on different cpus
CPUX CPUY
ring_buffer_resize
atomic_read(&buffer->resize_disabled)
tracing_open
tracing_reset_online_cpus
ring_buffer_... |
conn_not_found(struct conntrack *ct, struct dp_packet *pkt,
struct conn_lookup_ctx *ctx, bool commit, long long now,
const struct nat_action_info_t *nat_action_info,
struct conn *conn_for_un_nat_copy,
const char *helper,
const struct alg_exp_nod... | 0 | [
"CWE-400"
] | ovs | 35c280072c1c3ed58202745b7d27fbbd0736999b | 206,573,355,197,613,950,000,000,000,000,000,000,000 | 114 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
void __fd_install(struct files_struct *files, unsigned int fd,
struct file *file)
{
struct fdtable *fdt;
rcu_read_lock_sched();
if (unlikely(files->resize_in_progress)) {
rcu_read_unlock_sched();
spin_lock(&files->file_lock);
fdt = files_fdtable(files);
BUG_ON(fdt->fd[fd] != NULL);
rcu_assign_pointer(f... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 54,794,395,178,250,790,000,000,000,000,000,000,000 | 23 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
bitcmp(PG_FUNCTION_ARGS)
{
VarBit *arg1 = PG_GETARG_VARBIT_P(0);
VarBit *arg2 = PG_GETARG_VARBIT_P(1);
int32 result;
result = bit_cmp(arg1, arg2);
PG_FREE_IF_COPY(arg1, 0);
PG_FREE_IF_COPY(arg2, 1);
PG_RETURN_INT32(result);
} | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 249,243,390,350,722,300,000,000,000,000,000,000,000 | 13 | 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... |
expr_context_name(expr_context_ty ctx)
{
switch (ctx) {
case Load:
return "Load";
case Store:
return "Store";
case Del:
return "Del";
case AugLoad:
return "AugLoad";
case AugStore:
return "AugStore";
case Param:
return "Param";
default:
... | 0 | [
"CWE-125"
] | cpython | a4d78362397fc3bced6ea80fbc7b5f4827aec55e | 283,777,645,785,254,700,000,000,000,000,000,000,000 | 19 | bpo-36495: Fix two out-of-bounds array reads (GH-12641)
Research and fix by @bradlarsen. |
static int atusb_start(struct ieee802154_hw *hw)
{
struct atusb *atusb = hw->priv;
struct usb_device *usb_dev = atusb->usb_dev;
int ret;
dev_dbg(&usb_dev->dev, "%s\n", __func__);
schedule_delayed_work(&atusb->work, 0);
atusb_command(atusb, ATUSB_RX_MODE, 1);
ret = atusb_get_and_clear_error(atusb);
if (ret < 0)... | 0 | [
"CWE-416"
] | linux | 7fd25e6fc035f4b04b75bca6d7e8daa069603a76 | 124,465,403,132,730,700,000,000,000,000,000,000,000 | 14 | ieee802154: atusb: fix use-after-free at disconnect
The disconnect callback was accessing the hardware-descriptor private
data after having having freed it.
Fixes: 7490b008d123 ("ieee802154: add support for atusb transceiver")
Cc: stable <stable@vger.kernel.org> # 4.2
Cc: Alexander Aring <alex.aring@gmail.com>
Re... |
static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
{
pte_t res;
/* xchg acts as a barrier before the setting of the high bits */
res.pte_low = xchg(&ptep->pte_low, 0);
res.pte_high = ptep->pte_high;
ptep->pte_high = 0;
return res;
} | 0 | [
"CWE-362",
"CWE-401"
] | linux | 26c191788f18129af0eb32a358cdaea0c7479626 | 263,321,971,473,337,230,000,000,000,000,000,000,000 | 11 | mm: pmd_read_atomic: fix 32bit PAE pmd walk vs pmd_populate SMP race condition
When holding the mmap_sem for reading, pmd_offset_map_lock should only
run on a pmd_t that has been read atomically from the pmdp pointer,
otherwise we may read only half of it leading to this crash.
PID: 11679 TASK: f06e8000 CPU: 3 CO... |
TEST(ExistsMatchExpression, MatchesArray) {
ExistsMatchExpression exists("a");
ASSERT(exists.matchesBSON(BSON("a" << BSON_ARRAY(4 << 5.5)), NULL));
} | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 318,613,994,206,560,960,000,000,000,000,000,000,000 | 4 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
QPDFOutlineObjectHelper::getParent()
{
return this->m->parent;
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 46,391,056,844,628,380,000,000,000,000,000,000,000 | 4 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static struct port_buffer *get_inbuf(struct port *port)
{
struct port_buffer *buf;
unsigned int len;
if (port->inbuf)
return port->inbuf;
buf = virtqueue_get_buf(port->in_vq, &len);
if (buf) {
buf->len = min_t(size_t, len, buf->size);
buf->offset = 0;
port->stats.bytes_received += len;
}
return buf;
} | 0 | [
"CWE-120"
] | linux | d00d8da5869a2608e97cfede094dfc5e11462a46 | 113,305,972,806,752,540,000,000,000,000,000,000,000 | 16 | virtio_console: Assure used length from device is limited
The buf->len might come from an untrusted device. This
ensures the value would not exceed the size of the buffer
to avoid data corruption or loss.
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore... |
void Fill(OpKernelContext* ctx, random::PhiloxRandom random,
Tensor* output) override {
const Tensor& alpha_t = ctx->input(2);
TensorShape samples_shape = output->shape();
OP_REQUIRES(ctx, TensorShapeUtils::EndsWith(samples_shape, alpha_t.shape()),
errors::InvalidArgument(
... | 0 | [
"CWE-703",
"CWE-197"
] | tensorflow | ca8c013b5e97b1373b3bb1c97ea655e69f31a575 | 30,718,747,788,388,500,000,000,000,000,000,000,000 | 150 | Prevent integer truncation from 64 to 32 bits.
The `tensorflow::Shard` functions last argument must be a 2 argument function where both arguments are `int64` (`long long`, 64 bits). However, there are usages where code passes in a function where arguments are `int` or `int32` (32 bits). In these cases, it is possible ... |
xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
xmlParserNodeInfo node_info;
xmlNodePtr ret = ctxt->node;
if (ctxt->nameNr <= 0)
return;
/*
* parse the end of tag: '</' should be here.
*/
if (ctxt->sax2) {
const xmlChar *prefix = ctxt->pushTab[ctxt->nameNr * 3 - 3];
c... | 0 | [] | libxml2 | 0e1a49c8907645d2e155f0d89d4d9895ac5112b5 | 121,375,128,597,166,040,000,000,000,000,000,000,000 | 33 | Fix infinite loop in xmlStringLenDecodeEntities
When ctxt->instate == XML_PARSER_EOF,xmlParseStringEntityRef
return NULL which cause a infinite loop in xmlStringLenDecodeEntities
Found with libFuzzer.
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com> |
static void build_sit_entries(struct f2fs_sb_info *sbi)
{
struct sit_info *sit_i = SIT_I(sbi);
struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA);
struct f2fs_journal *journal = curseg->journal;
struct seg_entry *se;
struct f2fs_sit_entry sit;
int sit_blk_cnt = SIT_BLK_CNT(sbi);
unsigned int i, start, ... | 0 | [
"CWE-20"
] | linux | 638164a2718f337ea224b747cf5977ef143166a4 | 155,301,052,462,051,570,000,000,000,000,000,000,000 | 84 | f2fs: fix potential panic during fstrim
As Ju Hyung Park reported:
"When 'fstrim' is called for manual trim, a BUG() can be triggered
randomly with this patch.
I'm seeing this issue on both x86 Desktop and arm64 Android phone.
On x86 Desktop, this was caused during Ubuntu boot-up. I have a
cronjob installed which c... |
put_setnum(
FILE *fd,
char *cmd,
char *name,
long *valuep)
{
long wc;
if (fprintf(fd, "%s %s=", cmd, name) < 0)
return FAIL;
if (wc_use_keyname((char_u *)valuep, &wc))
{
// print 'wildchar' and 'wildcharm' as a key name
if (fputs((char *)get_special_key_name((int)wc, 0), fd) < 0)
... | 0 | [
"CWE-122"
] | vim | b7081e135a16091c93f6f5f7525a5c58fb7ca9f9 | 186,183,569,185,841,530,000,000,000,000,000,000,000 | 22 | patch 8.2.3402: invalid memory access when using :retab with large value
Problem: Invalid memory access when using :retab with large value.
Solution: Check the number is positive. |
static struct page *new_page_node(struct page *p, unsigned long private,
int **result)
{
struct page_to_node *pm = (struct page_to_node *)private;
while (pm->node != MAX_NUMNODES && pm->page != p)
pm++;
if (pm->node == MAX_NUMNODES)
return NULL;
*result = &pm->status;
return alloc_pages_node(pm->node,
... | 0 | [
"CWE-20"
] | linux-2.6 | 89f5b7da2a6bad2e84670422ab8192382a5aeb9f | 285,217,743,974,090,300,000,000,000,000,000,000,000 | 16 | Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP
KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") removed
the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
generally now populate the VM with real emp... |
static inline bool test_if_sum_overflows_ull(ulonglong arg1, ulonglong arg2)
{
return ULONGLONG_MAX - arg1 < arg2;
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 122,625,660,195,679,920,000,000,000,000,000,000,000 | 4 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.