func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int halt_interception(struct vcpu_svm *svm)
{
svm->next_rip = kvm_rip_read(&svm->vcpu) + 1;
skip_emulated_instruction(&svm->vcpu);
return kvm_emulate_halt(&svm->vcpu);
} | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 173,817,345,073,356,400,000,000,000,000,000,000,000 | 6 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
TEST_P(Http2CodecImplTest, WindowUpdateFloodOverride) {
max_inbound_window_update_frames_per_data_frame_sent_ = 2147483647;
windowUpdateFlood();
EXPECT_NO_THROW(client_->sendPendingFrames());
} | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 69,545,176,487,804,140,000,000,000,000,000,000,000 | 5 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
TestEnumeration() : i(0) {} | 0 | [
"CWE-190",
"CWE-787"
] | icu | b7d08bc04a4296982fcef8b6b8a354a9e4e7afca | 147,393,494,795,934,630,000,000,000,000,000,000,000 | 1 | ICU-20958 Prevent SEGV_MAPERR in append
See #971 |
set_errcontext_domain(const char *domain)
{
ErrorData *edata = &errordata[errordata_stack_depth];
/* we don't bother incrementing recursion_depth */
CHECK_STACK_DEPTH();
/* the default text domain is the backend's */
edata->context_domain = domain ? domain : PG_TEXTDOMAIN("postgres");
return 0; /* return ... | 0 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 198,061,835,420,723,440,000,000,000,000,000,000,000 | 12 | 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... |
**/
CImgDisplay& operator=(const CImgDisplay& disp) {
return assign(disp); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 252,612,574,786,965,330,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
void WebContents::EnableDeviceEmulation(
const blink::DeviceEmulationParams& params) {
if (type_ == Type::kRemote)
return;
DCHECK(web_contents());
auto* frame_host = web_contents()->GetMainFrame();
if (frame_host) {
auto* widget_host_impl = static_cast<content::RenderWidgetHostImpl*>(
frame... | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 190,956,863,132,212,300,000,000,000,000,000,000,000 | 16 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
delete_principal_2_svc(dprinc_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER;
gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER;
OM_uint32 ... | 0 | [
"CWE-119",
"CWE-772",
"CWE-401"
] | krb5 | 83ed75feba32e46f736fcce0d96a0445f29b96c2 | 64,802,101,193,892,790,000,000,000,000,000,000,000 | 55 | Fix leaks in kadmin server stubs [CVE-2015-8631]
In each kadmind server stub, initialize the client_name and
server_name variables, and release them in the cleanup handler. Many
of the stubs will otherwise leak the client and server name if
krb5_unparse_name() fails. Also make sure to free the prime_arg
variables in... |
static void unaccount_event(struct perf_event *event)
{
if (event->parent)
return;
if (event->attach_state & PERF_ATTACH_TASK)
static_key_slow_dec_deferred(&perf_sched_events);
if (event->attr.mmap || event->attr.mmap_data)
atomic_dec(&nr_mmap_events);
if (event->attr.comm)
atomic_dec(&nr_comm_events);
if... | 0 | [
"CWE-284",
"CWE-264"
] | linux | f63a8daa5812afef4f06c962351687e1ff9ccb2b | 24,286,197,293,374,148,000,000,000,000,000,000,000 | 22 | perf: Fix event->ctx locking
There have been a few reported issues wrt. the lack of locking around
changing event->ctx. This patch tries to address those.
It avoids the whole rwsem thing; and while it appears to work, please
give it some thought in review.
What I did fail at is sensible runtime checks on the use of
... |
void usb_device_handle_data(USBDevice *dev, USBPacket *p)
{
USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev);
if (klass->handle_data) {
klass->handle_data(dev, p);
}
} | 0 | [
"CWE-119"
] | qemu | 9f8e9895c504149d7048e9fc5eb5cbb34b16e49a | 62,628,772,781,418,550,000,000,000,000,000,000,000 | 7 | usb: sanity check setup_index+setup_len in post_load
CVE-2013-4541
s->setup_len and s->setup_index are fed into usb_packet_copy as
size/offset into s->data_buf, it's possible for invalid state to exploit
this to load arbitrary data.
setup_len and setup_index should be checked to make sure
they are not negative.
Cc:... |
_XimDecodeICATTRIBUTE(
Xic ic,
XIMResourceList res_list,
unsigned int res_num,
CARD16 *data,
INT16 data_len,
XIMArg *arg,
BITMASK32 mode)
{
register XIMArg *p;
XIMResourceList res;
int check;
INT16 len;
CARD16 *buf;
INT16 total;
char *name;
... | 0 | [
"CWE-190"
] | libx11 | 1703b9f3435079d3c6021e1ee2ec34fd4978103d | 169,149,219,411,288,190,000,000,000,000,000,000,000 | 74 | Change the data_len parameter of _XimAttributeToValue() to CARD16
It's coming from a length in the protocol (unsigned) and passed
to functions that expect unsigned int parameters (_XCopyToArg()
and memcpy()).
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Todd Carson <toc@daybefore.net> |
static int migrate_tmpl_match(const struct xfrm_migrate *m, const struct xfrm_tmpl *t)
{
int match = 0;
if (t->mode == m->mode && t->id.proto == m->proto &&
(m->reqid == 0 || t->reqid == m->reqid)) {
switch (t->mode) {
case XFRM_MODE_TUNNEL:
case XFRM_MODE_BEET:
if (xfrm_addr_equal(&t->id.daddr, &m->ol... | 0 | [
"CWE-125"
] | ipsec | 7bab09631c2a303f87a7eb7e3d69e888673b9b7e | 133,680,969,827,526,550,000,000,000,000,000,000,000 | 28 | xfrm: policy: check policy direction value
The 'dir' parameter in xfrm_migrate() is a user-controlled byte which is used
as an array index. This can lead to an out-of-bound access, kernel lockup and
DoS. Add a check for the 'dir' value.
This fixes CVE-2017-11600.
References: https://bugzilla.redhat.com/show_bug.cgi?... |
static void bin_object_decode_all_base64_strings(RzList *strings) {
rz_return_if_fail(strings);
RzBinString *bstr;
RzListIter *iter;
rz_list_foreach (strings, iter, bstr) {
rz_bin_string_decode_base64(bstr);
}
} | 0 | [
"CWE-200",
"CWE-787"
] | rizin | 07b43bc8aa1ffebd9b68d60624c9610cf7e460c7 | 284,928,574,129,410,350,000,000,000,000,000,000,000 | 9 | fix oob read on luac |
int memory_failure(unsigned long pfn, int flags)
{
struct page *p;
struct page *hpage;
struct page *orig_head;
struct dev_pagemap *pgmap;
int res;
unsigned long page_flags;
if (!sysctl_memory_failure_recovery)
panic("Memory failure on page %lx", pfn);
if (!pfn_valid(pfn)) {
pr_err("Memory failure: %#lx: m... | 0 | [] | linux | 46612b751c4941c5c0472ddf04027e877ae5990f | 214,661,618,081,850,320,000,000,000,000,000,000,000 | 172 | mm: hwpoison: fix thp split handing in soft_offline_in_use_page()
When soft_offline_in_use_page() runs on a thp tail page after pmd is
split, we trigger the following VM_BUG_ON_PAGE():
Memory failure: 0x3755ff: non anonymous thp
__get_any_page: 0x3755ff: unknown zero refcount page type 2fffff80000000
Soft offli... |
struct razer_report razer_chroma_extended_matrix_effect_reactive(unsigned char variable_storage, unsigned char led_id, unsigned char speed, struct razer_rgb *rgb)
{
struct razer_report report = razer_chroma_extended_matrix_effect_base(0x09, variable_storage, led_id, 0x05);
speed = clamp_u8(speed, 0x01, 0x04);
... | 0 | [
"CWE-787"
] | openrazer | 7e8a04feb378a679f1bcdcae079a5100cc45663b | 321,414,915,485,420,700,000,000,000,000,000,000,000 | 14 | Fix oob memcpy in matrix_custom_frame methods
Adjust row_length if it exeeds the arguments array |
parse_key (const unsigned char *data, size_t datalen,
struct _keybox_openpgp_key_info *ki)
{
gpg_error_t err;
const unsigned char *data_start = data;
int i, version, algorithm;
size_t n;
int npkey;
unsigned char hashbuffer[768];
const unsigned char *mpi_n = NULL;
size_t mpi_n_len = 0, mpi_e_l... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 187,317,862,248,408,630,000,000,000,000,000,000,000 | 162 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
build_hashcmd (self)
SHELL_VAR *self;
{
HASH_TABLE *h;
int i;
char *k, *v;
BUCKET_CONTENTS *item;
h = assoc_cell (self);
if (h)
assoc_dispose (h);
if (hashed_filenames == 0 || HASH_ENTRIES (hashed_filenames) == 0)
{
var_setvalue (self, (char *)NULL);
return self;
}
h = as... | 0 | [] | bash | 863d31ae775d56b785dc5b0105b6d251515d81d5 | 68,095,915,549,827,980,000,000,000,000,000,000,000 | 32 | commit bash-20120224 snapshot |
void sigchld_handler(int s) {
int status;
int* i;
pid_t pid;
while((pid=waitpid(-1, &status, WNOHANG)) > 0) {
if(WIFEXITED(status)) {
msg(LOG_INFO, "Child exited with %d", WEXITSTATUS(status));
}
i=g_hash_table_lookup(children, &pid);
if(!i) {
msg(LOG_INFO, "SIGCHLD received for an unknown chi... | 0 | [
"CWE-399",
"CWE-310"
] | nbd | 741495cb08503fd32a9d22648e63b64390c601f4 | 164,024,432,414,294,970,000,000,000,000,000,000,000 | 18 | nbd-server: handle modern-style negotiation in a child process
Previously, the modern style negotiation was carried out in the root
server (listener) process before forking the actual client handler. This
made it possible for a malfunctioning or evil client to terminate the
root process simply by querying a non-existe... |
long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
{
int i, al;
struct hm_header_st *msg_hdr;
unsigned char *p;
unsigned long msg_len;
/* s3->tmp is used to store messages that are unexpected, caused
* by the absence of an optional handshake message */
if (s->s3->tmp.reuse_message)
... | 0 | [] | openssl | c713a4c04d096fca04c42a95dddec235d9390136 | 246,298,152,697,781,860,000,000,000,000,000,000,000 | 80 | PR: 2230
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>
Fix various DTLS fragment reassembly bugs. |
pdf14_buf_new(gs_int_rect *rect, bool has_tags, bool has_alpha_g,
bool has_shape, bool idle, int n_chan, int num_spots,
gs_memory_t *memory)
{
/* Note that alpha_g is the alpha for the GROUP */
/* This is distinct from the alpha that may also exist */
/* for the obje... | 0 | [
"CWE-416"
] | ghostpdl | 90fd0c7ca3efc1ddff64a86f4104b13b3ac969eb | 208,521,316,555,337,250,000,000,000,000,000,000,000 | 92 | Bug 697456. Dont create new ctx when pdf14 device reenabled
This bug had yet another weird case where the user created a
file that pushed the pdf14 device twice. We were in that case,
creating a new ctx and blowing away the original one with out
proper clean up. To avoid, only create a new one when we need it. |
static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg)
{
struct crypto_stat_cipher rcipher;
memset(&rcipher, 0, sizeof(rcipher));
strscpy(rcipher.type, "cipher", sizeof(rcipher.type));
rcipher.stat_encrypt_cnt = atomic64_read(&alg->stats.cipher.encrypt_cnt);
rcipher.stat_encrypt_tlen = ato... | 0 | [
"CWE-400",
"CWE-284",
"CWE-401"
] | linux | c03b04dcdba1da39903e23cc4d072abf8f68f2dd | 74,134,402,451,450,580,000,000,000,000,000,000,000 | 16 | crypto: user - fix memory leak in crypto_reportstat
In crypto_reportstat, a new skb is created by nlmsg_new(). This skb is
leaked if crypto_reportstat_alg() fails. Required release for skb is
added.
Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics")
Cc: <stable@vger.kernel.org>
Signed-off-by... |
display_alloc_bitmap(gx_device_display * ddev, gx_device * param_dev)
{
int ccode;
const gx_device_memory *mdproto;
if (ddev->callback == NULL)
return gs_error_Fatal;
/* free old bitmap (if any) */
display_free_bitmap(ddev);
/* allocate a memory device for rendering */
mdproto = gd... | 0 | [] | ghostpdl | 1ef5f08f2c2e27efa978f0010669ff22355c385f | 115,312,398,625,457,650,000,000,000,000,000,000,000 | 82 | Fix display device DisplayFormat=16#a0800 (Separation mode) broken by f2cf6829
The ICC profile checking needs to be told that the device supports_devn, so
add a spec_op proc to return true when in separation mode, and add a proc for
fill_rectangle_hl_color so that fillpage will work in Separation mode.
This was fixed... |
sig_handler mysql_end(int sig)
{
#ifndef _WIN32
/*
Ingnoring SIGQUIT, SIGINT and SIGHUP signals when cleanup process starts.
This will help in resolving the double free issues, which occures in case
the signal handler function is started in between the clean up function.
*/
signal(SIGQUIT, SIG_IGN);
... | 0 | [
"CWE-319"
] | mysql-server | 0002e1380d5f8c113b6bce91f2cf3f75136fd7c7 | 229,272,281,713,624,250,000,000,000,000,000,000,000 | 59 | 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) |
get_number(NCURSES_CONST char *cap, const char *env)
{
int result = tgetnum(cap);
char *value = env ? getenv(env) : 0;
if (value != 0 && *value != 0) {
char *next = 0;
long check = strtol(value, &next, 10);
if (check > 0 && *next == '\0')
result = (int) check;
}
return result;
} | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 301,004,929,010,948,700,000,000,000,000,000,000,000 | 12 | 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... |
bool bindToPort() override { return bind_to_port_; } | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 3,645,522,660,368,914,000,000,000,000,000,000,000 | 1 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
static void get_log_identifier(string_t *str, struct auth_request *auth_request)
{
const char *ip;
if (auth_request->fields.user == NULL)
str_append(str, "?");
else
str_sanitize_append(str, auth_request->fields.user,
MAX_LOG_USERNAME_LEN);
ip = net_ip2addr(&auth_request->fields.remote_ip);
if ... | 0 | [
"CWE-284"
] | core | 7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904 | 58,722,511,702,666,360,000,000,000,000,000,000,000 | 20 | auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter
The passdb was wrongly deduplicated in this situation, causing wrong
mechanisms or username_filter setting to be used. This would be a rather
unlikely configuration though.
Fixed by moving mechanisms and username_filter fro... |
void Http2Session::New(const FunctionCallbackInfo<Value>& args) {
Http2State* state = Environment::GetBindingData<Http2State>(args);
Environment* env = state->env();
CHECK(args.IsConstructCall());
SessionType type =
static_cast<SessionType>(
args[0]->Int32Value(env->context()).ToChecked());
Ht... | 0 | [
"CWE-416"
] | node | a3c33d4ce78f74d1cf1765704af5b427aa3840a6 | 53,962,004,270,444,035,000,000,000,000,000,000,000 | 11 | 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... |
static cmpresult_t uECC_vli_cmp_unsafe(const uECC_word_t *left,
const uECC_word_t *right,
wordcount_t num_words) {
wordcount_t i;
for (i = num_words - 1; i >= 0; --i) {
if (left[i] > right[i]) {
return 1;
}... | 0 | [
"CWE-415"
] | micro-ecc | 1b5f5cea5145c96dd8791b9b2c41424fc74c2172 | 72,288,463,819,466,260,000,000,000,000,000,000,000 | 13 | Fix for #168 |
pkinit_create_td_dh_parameters(krb5_context context,
pkinit_plg_crypto_context plg_cryptoctx,
pkinit_req_crypto_context req_cryptoctx,
pkinit_identity_crypto_context id_cryptoctx,
pkinit_plg_opts ... | 0 | [
"CWE-476"
] | krb5 | f249555301940c6df3a2cdda13b56b5674eebc2e | 64,022,248,973,732,250,000,000,000,000,000,000,000 | 155 | PKINIT null pointer deref [CVE-2013-1415]
Don't dereference a null pointer when cleaning up.
The KDC plugin for PKINIT can dereference a null pointer when a
malformed packet causes processing to terminate early, leading to
a crash of the KDC process. An attacker would need to have a valid
PKINIT certificate or have ... |
static void cmp_and_merge_page(struct page *page, struct rmap_item *rmap_item)
{
struct rmap_item *tree_rmap_item;
struct page *tree_page = NULL;
struct stable_node *stable_node;
struct page *kpage;
unsigned int checksum;
int err;
remove_rmap_item_from_tree(rmap_item);
/* We first start with searching the pag... | 0 | [
"CWE-362",
"CWE-125"
] | linux | 2b472611a32a72f4a118c069c2d62a1a3f087afd | 127,599,719,170,455,700,000,000,000,000,000,000,000 | 75 | ksm: fix NULL pointer dereference in scan_get_next_rmap_item()
Andrea Righi reported a case where an exiting task can race against
ksmd::scan_get_next_rmap_item (http://lkml.org/lkml/2011/6/1/742) easily
triggering a NULL pointer dereference in ksmd.
ksm_scan.mm_slot == &ksm_mm_head with only one registered mm
CPU 1... |
static const char *wsgi_set_auth_group_script(cmd_parms *cmd, void *mconfig,
const char *args)
{
WSGIDirectoryConfig *dconfig = NULL;
WSGIScriptFile *object = NULL;
const char *option = NULL;
const char *value = NULL;
object = newWSGIScriptFile(cmd->p... | 0 | [
"CWE-264"
] | mod_wsgi | d9d5fea585b23991f76532a9b07de7fcd3b649f4 | 251,865,415,302,648,160,000,000,000,000,000,000,000 | 39 | Local privilege escalation when using daemon mode. (CVE-2014-0240) |
int server_open_native_socket(Server *s) {
static const union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
.un.sun_path = "/run/systemd/journal/socket",
};
int r;
assert(s);
if (s->native_fd < 0) {
s->native_fd = socket(AF_UNI... | 0 | [
"CWE-770"
] | systemd | 052c57f132f04a3cf4148f87561618da1a6908b4 | 279,053,979,272,063,600,000,000,000,000,000,000,000 | 51 | journald: set a limit on the number of fields (1k)
We allocate a iovec entry for each field, so with many short entries,
our memory usage and processing time can be large, even with a relatively
small message size. Let's refuse overly long entries.
CVE-2018-16865
https://bugzilla.redhat.com/show_bug.cgi?id=1653861
W... |
static inline void tcp_push_pending_frames(struct sock *sk)
{
if (tcp_send_head(sk)) {
struct tcp_sock *tp = tcp_sk(sk);
__tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle);
}
} | 0 | [
"CWE-416",
"CWE-269"
] | linux | bb1fceca22492109be12640d49f5ea5a544c6bb4 | 208,787,202,067,989,680,000,000,000,000,000,000,000 | 8 | tcp: fix use after free in tcp_xmit_retransmit_queue()
When tcp_sendmsg() allocates a fresh and empty skb, it puts it at the
tail of the write queue using tcp_add_write_queue_tail()
Then it attempts to copy user data into this fresh skb.
If the copy fails, we undo the work and remove the fresh skb.
Unfortunately, t... |
TEST_F(NgramKernelTest, TestOverlappingSinglyPaddedNGramsNoOutput) {
MakeOp("|", {5}, "LP", "RP", 1, false);
// Batch items are:
// 0: "a"
// 1: "b", "c", "d"
// 2: "e", "f"
AddInputFromArray<tstring>(TensorShape({6}), {"a", "b", "c", "d", "e", "f"});
AddInputFromArray<int64>(TensorShape({4}), {0, 1, 4, 6... | 0 | [
"CWE-703",
"CWE-787"
] | tensorflow | ba424dd8f16f7110eea526a8086f1a155f14f22b | 197,561,048,658,358,930,000,000,000,000,000,000,000 | 16 | Enhance validation of ngram op and handle case of 0 tokens.
PiperOrigin-RevId: 369940178
Change-Id: Ia82f42c09d14efe76e7dc013505b832a42282f0b |
R_API char *r_buf_to_string(RBuffer *b) {
ut64 sz = r_buf_size (b);
char *s = malloc (sz + 1);
if (!s) {
return NULL;
}
if (r_buf_read_at (b, 0, (ut8 *)s, sz) < 0) {
free (s);
return NULL;
}
s[sz] = '\0';
return s;
} | 0 | [
"CWE-400",
"CWE-703"
] | radare2 | 634b886e84a5c568d243e744becc6b3223e089cf | 246,828,658,928,031,160,000,000,000,000,000,000,000 | 13 | Fix DoS in PE/QNX/DYLDCACHE/PSX parsers ##crash
* Reported by lazymio
* Reproducer: AAA4AAAAAB4= |
static void destruct_tty_driver(struct kref *kref)
{
struct tty_driver *driver = container_of(kref, struct tty_driver, kref);
int i;
struct ktermios *tp;
if (driver->flags & TTY_DRIVER_INSTALLED) {
/*
* Free the termios and termios_locked structures because
* we don't want to get memory leaks when modular ... | 0 | [
"CWE-200",
"CWE-362"
] | linux | 5c17c861a357e9458001f021a7afa7aab9937439 | 300,166,376,655,149,800,000,000,000,000,000,000,000 | 31 | tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios via ioctl(TCSETS*) without actually
changing the line discipline via ioctl(TIOCSETD).
However... |
pdf_filter_TL(fz_context *ctx, pdf_processor *proc, float leading)
{
pdf_filter_processor *p = (pdf_filter_processor*)proc;
filter_flush(ctx, p, 0);
p->gstate->pending.text.leading = leading;
} | 0 | [
"CWE-125"
] | mupdf | 97096297d409ec6f206298444ba00719607e8ba8 | 59,479,562,449,931,220,000,000,000,000,000,000,000 | 6 | Bug 701292: Fix test for missing/empty string. |
decay_load_missed(unsigned long load, unsigned long missed_updates, int idx)
{
int j = 0;
if (!missed_updates)
return load;
if (missed_updates >= degrade_zero_ticks[idx])
return 0;
if (idx == 1)
return load >> missed_updates;
while (missed_updates) {
if (missed_updates % 2)
load = (load * degrade_fa... | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 269,473,217,172,224,950,000,000,000,000,000,000,000 | 22 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr) {
const char *start;
if (ptr >= end)
return XML_TOK_NONE;
else if (! HAS_CHAR(enc, ptr, end)) {
/* This line cannot be executed. The incoming data has already
* been to... | 0 | [
"CWE-116"
] | libexpat | 3f0a0cb644438d4d8e3294cd0b1245d0edb0c6c6 | 293,104,733,417,002,530,000,000,000,000,000,000,000 | 67 | lib: Add missing validation of encoding (CVE-2022-25235) |
static void task_numa_compare(struct task_numa_env *env,
long taskimp, long groupimp, bool maymove)
{
struct rq *dst_rq = cpu_rq(env->dst_cpu);
struct task_struct *cur;
long src_load, dst_load;
long load;
long imp = env->p->numa_group ? groupimp : taskimp;
long moveimp = imp;
int dist = env->dist;
if ... | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 295,326,485,668,862,680,000,000,000,000,000,000,000 | 118 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
static int ocfs2_write_cluster(struct address_space *mapping,
u32 *phys, unsigned int new,
unsigned int clear_unwritten,
unsigned int should_zero,
struct ocfs2_alloc_context *data_ac,
struct ocfs2_alloc_context *meta_ac,
struct ocfs2_write_ctxt *wc, u32 cpos,
... | 0 | [
"CWE-362"
] | linux | 3e4c56d41eef5595035872a2ec5a483f42e8917f | 233,010,205,353,855,620,000,000,000,000,000,000,000 | 103 | ocfs2: ip_alloc_sem should be taken in ocfs2_get_block()
ip_alloc_sem should be taken in ocfs2_get_block() when reading file in
DIRECT mode to prevent concurrent access to extent tree with
ocfs2_dio_end_io_write(), which may cause BUGON in the following
situation:
read file 'A' end_io... |
int sock_common_setsockopt(struct socket *sock, int level, int optname,
sockptr_t optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
return sk->sk_prot->setsockopt(sk, level, optname, optval, optlen);
} | 0 | [] | net | 35306eb23814444bd4021f8a1c3047d3cb0c8b2b | 308,561,212,873,795,480,000,000,000,000,000,000,000 | 7 | af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
Jann Horn reported that SO_PEERCRED and SO_PEERGROUPS implementations
are racy, as af_unix can concurrently change sk_peer_pid and sk_peer_cred.
In order to fix this issue, this patch adds a new spinlock that needs
to be used whenever these fields are read o... |
gst_asf_demux_get_bytes (guint8 ** p_buf, guint num_bytes_to_read,
guint8 ** p_data, guint64 * p_size)
{
*p_buf = NULL;
if (*p_size < num_bytes_to_read)
return FALSE;
*p_buf = g_memdup (*p_data, num_bytes_to_read);
*p_data += num_bytes_to_read;
*p_size -= num_bytes_to_read;
return TRUE;
} | 0 | [
"CWE-125",
"CWE-787"
] | gst-plugins-ugly | d21017b52a585f145e8d62781bcc1c5fefc7ee37 | 154,037,565,070,407,100,000,000,000,000,000,000,000 | 13 | asfdemux: Check that we have enough data available before parsing bool/uint extended content descriptors
https://bugzilla.gnome.org/show_bug.cgi?id=777955 |
mono_custom_attrs_from_assembly (MonoAssembly *assembly)
{
guint32 idx;
if (assembly->image->dynamic)
return lookup_custom_attr (assembly->image, assembly);
idx = 1; /* there is only one assembly */
idx <<= MONO_CUSTOM_ATTR_BITS;
idx |= MONO_CUSTOM_ATTR_ASSEMBLY;
return mono_custom_attrs_from_index (assembly-... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 306,229,929,884,870,550,000,000,000,000,000,000,000 | 11 | 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 |
void message_parser_parse_body(struct message_parser_ctx *ctx,
message_part_header_callback_t *hdr_callback,
void *context)
{
struct message_block block;
int ret;
while ((ret = message_parser_parse_next_block(ctx, &block)) > 0) {
if (block.size == 0 && hdr_callback != NULL)
hdr_callback(blo... | 0 | [
"CWE-20"
] | core | fb97a1cddbda4019e327fa736972a1c7433fedaa | 71,524,167,282,517,085,000,000,000,000,000,000,000 | 13 | lib-mail: message-parser - Fix assert-crash when enforcing MIME part limit
The limit could have been exceeded with message/rfc822 parts. |
static void __io_sqe_files_unregister(struct io_ring_ctx *ctx)
{
#if !defined(IO_URING_SCM_ALL)
int i;
for (i = 0; i < ctx->nr_user_files; i++) {
struct file *file = io_file_from_index(ctx, i);
if (!file)
continue;
if (io_fixed_file_slot(&ctx->file_table, i)->file_ptr & FFS_SCM)
continue;
io_file_bit... | 0 | [
"CWE-416"
] | linux | 9cae36a094e7e9d6e5fe8b6dcd4642138b3eb0c7 | 60,538,577,917,697,730,000,000,000,000,000,000,000 | 31 | io_uring: reinstate the inflight tracking
After some debugging, it was realized that we really do still need the
old inflight tracking for any file type that has io_uring_fops assigned.
If we don't, then trivial circular references will mean that we never get
the ctx cleaned up and hence it'll leak.
Just bring back t... |
PHP_FUNCTION(imagegammacorrect)
{
zval *IM;
gdImagePtr im;
int i;
double input, output;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) {
return;
}
if ( input <= 0.0 || output <= 0.0 ) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positi... | 0 | [
"CWE-787"
] | php-src | 1bd103df00f49cf4d4ade2cfe3f456ac058a4eae | 22,732,451,293,419,570,000,000,000,000,000,000,000 | 45 | Fix bug #72730 - imagegammacorrect allows arbitrary write access |
static int devinet_conf_ifindex(struct net *net, struct ipv4_devconf *cnf)
{
if (cnf == net->ipv4.devconf_dflt)
return NETCONFA_IFINDEX_DEFAULT;
else if (cnf == net->ipv4.devconf_all)
return NETCONFA_IFINDEX_ALL;
else {
struct in_device *idev
= container_of(cnf, struct in_device, cnf);
return idev->dev->i... | 0 | [
"CWE-399"
] | net-next | fbd40ea0180a2d328c5adc61414dc8bab9335ce2 | 224,714,667,888,112,300,000,000,000,000,000,000,000 | 12 | ipv4: Don't do expensive useless work during inetdev destroy.
When an inetdev is destroyed, every address assigned to the interface
is removed. And in this scenerio we do two pointless things which can
be very expensive if the number of assigned interfaces is large:
1) Address promotion. We are deleting all address... |
static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off)
{
u8 *prog = *pprog;
int cnt = 0;
switch (size) {
case BPF_B:
/* Emit 'movzx rax, byte ptr [rax + off]' */
EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB6);
break;
case BPF_H:
/* Emit 'movzx rax, word ptr [rax + off]' */
EM... | 0 | [
"CWE-77"
] | linux | e4d4d456436bfb2fe412ee2cd489f7658449b098 | 68,755,560,935,073,980,000,000,000,000,000,000,000 | 29 | bpf, x86: Validate computation of branch displacements for x86-64
The branch displacement logic in the BPF JIT compilers for x86 assumes
that, for any generated branch instruction, the distance cannot
increase between optimization passes.
But this assumption can be violated due to how the distances are
computed. Spec... |
RZ_API ut64 rz_core_analysis_address(RzCore *core, ut64 addr) {
ut64 types = 0;
RzRegSet *rs = NULL;
if (!core) {
return 0;
}
if (core->dbg && core->dbg->reg) {
rs = rz_reg_regset_get(core->dbg->reg, RZ_REG_TYPE_GPR);
}
if (rs) {
RzRegItem *r;
RzListIter *iter;
rz_list_foreach (rs->regs, iter, r) {
... | 0 | [
"CWE-703"
] | rizin | 6ce71d8aa3dafe3cdb52d5d72ae8f4b95916f939 | 333,106,078,348,067,700,000,000,000,000,000,000,000 | 138 | Initialize retctx,ctx before freeing the inner elements
In rz_core_analysis_type_match retctx structure was initialized on the
stack only after a "goto out_function", where a field of that structure
was freed. When the goto path is taken, the field is not properly
initialized and it cause cause a crash of Rizin or hav... |
void Server::saveBans() {
TransactionHolder th;
QSqlQuery &query = *th.qsqQuery;
SQLPREP("DELETE FROM `%1bans` WHERE `server_id` = ? ");
query.addBindValue(iServerNum);
SQLEXEC();
SQLPREP("INSERT INTO `%1bans` (`server_id`, `base`,`mask`,`name`,`hash`,`reason`,`start`,`duration`) VALUES (?,?,?,?,?,?,?,?)");
fo... | 0 | [
"CWE-20"
] | mumble | 6b33dda344f89e5a039b7d79eb43925040654242 | 254,461,172,020,065,840,000,000,000,000,000,000,000 | 21 | Don't crash on long usernames |
static inline void le32_to_cpu_array(u32 *buf, unsigned int words)
{
while (words--) {
__le32_to_cpus(buf);
buf++;
}
} | 0 | [
"CWE-703"
] | linux | bc0b96b54a21246e377122d54569eef71cec535f | 226,424,499,553,354,930,000,000,000,000,000,000,000 | 7 | crypto: Move md5_transform to lib/md5.c
We are going to use this for TCP/IP sequence number and fragment ID
generation.
Signed-off-by: David S. Miller <davem@davemloft.net> |
cockpit_web_response_headers_full (CockpitWebResponse *self,
guint status,
const gchar *reason,
gssize length,
GHashTable *headers)
{
GString *string;
GBytes *block;
g_... | 0 | [
"CWE-1021"
] | cockpit | 8d9bc10d8128aae03dfde62fd00075fe492ead10 | 150,067,809,392,422,490,000,000,000,000,000,000,000 | 25 | common: Restrict frame embedding to same origin
Declare `X-Frame-Options: sameorigin` [1] so that cockpit frames can
only be embedded into pages coming from the same origin. This is similar
to setting CORP in commit 2b38b8de92f9a (which applies to `<script>`,
`<img>`, etc.).
The main use case for embedding is to run ... |
void InstanceKlass::oop_print_on(oop obj, outputStream* st) {
Klass::oop_print_on(obj, st);
if (this == SystemDictionary::String_klass()) {
typeArrayOop value = java_lang_String::value(obj);
juint length = java_lang_String::length(obj);
if (value != NULL &&
value->is_typeArray() &&
... | 0 | [] | jdk11u-dev | 41825fa33d605f8501164f9296572e4378e8183b | 157,374,369,651,091,830,000,000,000,000,000,000,000 | 44 | 8270386: Better verification of scan methods
Reviewed-by: mbaesken
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
static int __init efi_update_mem_attr(struct mm_struct *mm, efi_memory_desc_t *md)
{
unsigned long pf = 0;
if (md->attribute & EFI_MEMORY_XP)
pf |= _PAGE_NX;
if (!(md->attribute & EFI_MEMORY_RO))
pf |= _PAGE_RW;
if (sev_active())
pf |= _PAGE_ENC;
return efi_update_mappings(md, pf);
} | 0 | [
"CWE-388"
] | tip | 4e78921ba4dd0aca1cc89168f45039add4183f8e | 79,373,808,193,074,170,000,000,000,000,000,000,000 | 15 | efi/x86/Add missing error handling to old_memmap 1:1 mapping code
The old_memmap flow in efi_call_phys_prolog() performs numerous memory
allocations, and either does not check for failure at all, or it does
but fails to propagate it back to the caller, which may end up calling
into the firmware with an incomplete 1:1 ... |
static void uas_log_cmd_state(struct scsi_cmnd *cmnd, const char *prefix,
int status)
{
struct uas_cmd_info *ci = (void *)&cmnd->SCp;
struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
scmd_printk(KERN_INFO, cmnd,
"%s %d uas-tag %d inflight:%s%s%s%s%s%s%s%s%s%s%s%s ",
prefix, status, cmdinfo->u... | 0 | [
"CWE-125"
] | linux | 786de92b3cb26012d3d0f00ee37adf14527f35c4 | 212,432,544,870,455,860,000,000,000,000,000,000,000 | 23 | USB: uas: fix bug in handling of alternate settings
The uas driver has a subtle bug in the way it handles alternate
settings. The uas_find_uas_alt_setting() routine returns an
altsetting value (the bAlternateSetting number in the descriptor), but
uas_use_uas_driver() then treats that value as an index to the
intf->al... |
static void test_message_parser_truncated_mime_headers3(void)
{
static const char input_msg[] =
"Content-Type: multipart/mixed; boundary=\"ab\"\n";
struct istream *input;
struct message_part *parts;
pool_t pool;
test_begin("message parser truncated mime headers 3");
pool = pool_alloconly_create("message parser", ... | 0 | [
"CWE-20"
] | core | fb97a1cddbda4019e327fa736972a1c7433fedaa | 140,750,113,224,998,860,000,000,000,000,000,000,000 | 29 | lib-mail: message-parser - Fix assert-crash when enforcing MIME part limit
The limit could have been exceeded with message/rfc822 parts. |
server_palette(struct xrdp_mod* mod, int* palette)
{
struct xrdp_wm* wm;
wm = (struct xrdp_wm*)(mod->wm);
if (g_memcmp(wm->palette, palette, 255 * sizeof(int)) != 0)
{
g_memcpy(wm->palette, palette, 256 * sizeof(int));
xrdp_wm_send_palette(wm);
}
return 0;
} | 0 | [] | xrdp | d8f9e8310dac362bb9578763d1024178f94f4ecc | 248,031,469,015,203,740,000,000,000,000,000,000,000 | 12 | move temp files from /tmp to /tmp/.xrdp |
get_locale_langs_from_accounts_dbus (GDBusProxy *proxy, GPtrArray *langs)
{
const char *accounts_bus_name = "org.freedesktop.Accounts";
const char *accounts_interface_name = "org.freedesktop.Accounts.User";
g_auto(GStrv) object_paths = NULL;
int i;
g_autoptr(GVariant) ret = NULL;
ret = g_dbus_proxy_call_sy... | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 174,373,181,782,767,830,000,000,000,000,000,000,000 | 55 | Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.
However, when installing ... |
template<typename T>
inline T _hypot(const T x, const T y) { // Slower but more precise version
T nx = cimg::abs(x), ny = cimg::abs(y), t;
if (nx<ny) { t = nx; nx = ny; } else t = ny;
if (nx>0) { t/=nx; return nx*std::sqrt(1 + t*t); }
return 0; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 336,271,097,100,158,300,000,000,000,000,000,000,000 | 6 | Fix other issues in 'CImg<T>::load_bmp()'. |
static inline void kvm_memslot_delete(struct kvm_memslots *slots,
struct kvm_memory_slot *memslot)
{
struct kvm_memory_slot *mslots = slots->memslots;
int i;
if (WARN_ON(slots->id_to_index[memslot->id] == -1))
return;
slots->used_slots--;
for (i = slots->id_to_index[memslot->id]; i < slots->used_slo... | 1 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 222,311,292,455,674,330,000,000,000,000,000,000,000 | 18 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
BSONObj spec() {
return BSON("$eq" << BSON_ARRAY(1 << "$a"));
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 61,997,195,389,464,870,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
static inline Quantum GetPixelIndex(const Image *magick_restrict image,
const Quantum *magick_restrict pixel)
{
if (image->channel_map[IndexPixelChannel].traits == UndefinedPixelTrait)
return((Quantum) 0);
return(pixel[image->channel_map[IndexPixelChannel].offset]);
} | 0 | [
"CWE-20",
"CWE-125"
] | ImageMagick | 8187d2d8fd010d2d6b1a3a8edd935beec404dddc | 263,426,688,211,197,840,000,000,000,000,000,000,000 | 7 | https://github.com/ImageMagick/ImageMagick/issues/1610 |
static int mpls_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{
struct mpls_route_config *cfg;
int err;
cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
if (!cfg)
return -ENOMEM;
err = rtm_to_route_config(skb, nlh, cfg, extack);
if (err < 0)
goto out;
err = mpls_r... | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 2,827,538,766,125,245,500,000,000,000,000,000,000 | 20 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
remove_from_destroy_list_cb (GtkWidget *widget, EphyEmbed *embed)
{
GSList *list;
list = embed->priv->destroy_on_transition_list;
list = g_slist_remove (list, widget);
embed->priv->destroy_on_transition_list = list;
} | 0 | [] | epiphany | 3e0f7dea754381c5ad11a06ccc62eb153382b498 | 37,834,570,079,122,350,000,000,000,000,000,000,000 | 8 | Report broken certs through the padlock icon
This uses a new feature in libsoup that reports through a
SoupMessageFlag whether the message is talking to a server that has a
trusted server.
Bug #600663 |
R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref, int mode) {
ut8 *buf = (ut8 *)malloc (core->blocksize);
if (!buf) {
return -1;
}
int ptrdepth = r_config_get_i (core->config, "anal.ptrdepth");
int i, count = 0;
RAnalOp op = R_EMPTY;
ut64 at;
char bckwrds, do_bckwrd_srch;
int arch = -1;... | 0 | [
"CWE-416"
] | radare2 | 10517e3ff0e609697eb8cde60ec8dc999ee5ea24 | 264,449,262,687,043,830,000,000,000,000,000,000,000 | 154 | aaef on arm/thumb switches causes uaf ##crash
* Reported by peacock-doris via huntr.dev
* Reproducer: poc_uaf_r_reg_get |
static void init_pack_info(const char *infofile, int force)
{
struct packed_git *p;
int stale;
int i = 0;
objdir = get_object_directory();
objdirlen = strlen(objdir);
prepare_packed_git();
for (p = packed_git; p; p = p->next) {
/* we ignore things on alternate path since they are
* not available to the pu... | 0 | [] | git | c173dad58787a7f11a526dbcdaa5a2fe9ff1c87f | 271,370,634,162,177,540,000,000,000,000,000,000,000 | 46 | update-server-info: Shorten read_pack_info_file()
The correct responses to a D and a T line in .git/objects/info/packs
are the same, so combine their case arms. In both cases we already
‘goto’ out of the switch so while at it, remove a redundant ‘break’
to avoid yet another line of code.
Signed-off-by: Ralf Thielow ... |
static void _out_verify(conn_t out, nad_t nad) {
int attr, ns;
jid_t from, to;
conn_t in;
char *rkey;
int valid;
attr = nad_find_attr(nad, 0, -1, "from", NULL);
if(attr < 0 || (from = jid_new(NAD_AVAL(nad, attr), NAD_AVAL_L(nad, attr))) == NULL) {
log_debug(ZONE, "missing or invalid... | 0 | [
"CWE-20"
] | jabberd2 | aabcffae560d5fd00cd1d2ffce5d760353cf0a4d | 5,760,410,396,374,006,000,000,000,000,000,000,000 | 84 | Fixed possibility of Unsolicited Dialback Attacks |
static int cm_init_qp_rts_attr(struct cm_id_private *cm_id_priv,
struct ib_qp_attr *qp_attr,
int *qp_attr_mask)
{
unsigned long flags;
int ret;
spin_lock_irqsave(&cm_id_priv->lock, flags);
switch (cm_id_priv->id.state) {
/* Allow transition to RTS before sending REP */
case IB_CM_REQ_RCVD:
c... | 0 | [
"CWE-20"
] | linux | b2853fd6c2d0f383dbdf7427e263eb576a633867 | 129,392,363,730,092,130,000,000,000,000,000,000,000 | 58 | IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler
The code that resolves the passive side source MAC within the rdma_cm
connection request handler was both redundant and buggy, so remove it.
It was redundant since later, when an RC QP is modified to RTR state,
the resolution will take place in th... |
PHP_FUNCTION(iconv_set_encoding)
{
char *type;
zend_string *charset;
size_t type_len, retval;
zend_string *name;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &type, &type_len, &charset) == FAILURE)
return;
if (ZSTR_LEN(charset) >= ICONV_CSNMAXLEN) {
php_error_docref(NULL, E_WARNING, "Charset parameter e... | 0 | [
"CWE-125"
] | php-src | 7cf7148a8f8f4f55fb04de2a517d740bb6253eac | 215,094,711,762,222,040,000,000,000,000,000,000,000 | 34 | Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow |
filter_dealloc(filterobject *lz)
{
PyObject_GC_UnTrack(lz);
Py_XDECREF(lz->func);
Py_XDECREF(lz->it);
Py_TYPE(lz)->tp_free(lz);
} | 0 | [
"CWE-125"
] | cpython | dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c | 6,915,548,615,704,079,000,000,000,000,000,000,000 | 7 | bpo-35766: Merge typed_ast back into CPython (GH-11645) |
copyObject(const void *from)
{
void *retval;
if (from == NULL)
return NULL;
/* Guard against stack overflow due to overly complex expressions */
check_stack_depth();
switch (nodeTag(from))
{
/*
* PLAN NODES
*/
case T_PlannedStmt:
retval = _copyPlannedStmt(from);
break;
case T_Plan:
... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 170,906,646,288,424,860,000,000,000,000,000,000,000 | 739 | 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... |
static int decode_deviceid(struct xdr_stream *xdr, struct nfs4_deviceid *devid)
{
__be32 *p;
p = xdr_inline_decode(xdr, NFS4_DEVICEID4_SIZE);
if (unlikely(!p))
return -ENOBUFS;
memcpy(devid, p, NFS4_DEVICEID4_SIZE);
nfs4_print_deviceid(devid);
return 0;
} | 0 | [
"CWE-787"
] | linux | ed34695e15aba74f45247f1ee2cf7e09d449f925 | 107,567,577,815,505,650,000,000,000,000,000,000,000 | 11 | pNFS/flexfiles: fix incorrect size check in decode_nfs_fh()
We (adam zabrocki, alexander matrosov, alexander tereshkin, maksym
bazalii) observed the check:
if (fh->size > sizeof(struct nfs_fh))
should not use the size of the nfs_fh struct which includes an extra two
bytes from the size field.
struct nfs_fh {
unsi... |
void streamDelConsumer(streamCG *cg, streamConsumer *consumer) {
/* Iterate all the consumer pending messages, deleting every corresponding
* entry from the global entry. */
raxIterator ri;
raxStart(&ri,consumer->pel);
raxSeek(&ri,"^",NULL,0);
while(raxNext(&ri)) {
streamNACK *nack = ri... | 0 | [
"CWE-703",
"CWE-401"
] | redis | 4a7a4e42db8ff757cdf3f4a824f66426036034ef | 231,520,975,825,626,000,000,000,000,000,000,000,000 | 18 | Fix memory leak in streamGetEdgeID (#10753)
si is initialized by streamIteratorStart(), we should call
streamIteratorStop() on it when done.
regression introduced in #9127 (redis 7.0) |
static std::string make_relative_path(const std::string& path) {
if (path.empty()) {
return path;
}
// First get the path to a state where we don't have .. in the middle of it
// etc. canonicalize handles Windows paths too.
std::string canonical(FileUtil::canonicalize(path));
// If we have a slash at ... | 0 | [
"CWE-22"
] | hhvm | 65c95a01541dd2fbc9c978ac53bed235b5376686 | 200,846,782,744,581,030,000,000,000,000,000,000,000 | 41 | ZipArchive::extractTo bug 70350
Summary:Don't allow upward directory traversal when extracting zip archive files.
Files in zip files with `..` or starting at main root `/` should be normalized
to something where the file being extracted winds up within the directory or
a subdirectory where the actual extraction is ta... |
TEST_F(RenameCollectionTest, RenameSameDatabaseStayTempFalseSourceNotTemporary) {
_testRenameCollectionStayTemp(_opCtx.get(), _sourceNss, _targetNss, false, false);
} | 0 | [
"CWE-20"
] | mongo | 35c1b1f588f04926a958ad2fe4d9c59d79f81e8b | 178,906,631,472,849,930,000,000,000,000,000,000,000 | 3 | SERVER-35636 renameCollectionForApplyOps checks for complete namespace |
static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
struct net_device *dev,
struct geneve_sock *gs6,
struct flowi6 *fl6,
const struct ip_tunnel_info *info,
__be16 dport, __be16 sport)
{
bool use_cache = ip_tunnel_dst_cache_usable(skb, info);
struct geneve_dev *genev... | 0 | [
"CWE-319"
] | net | 34beb21594519ce64a55a498c2fe7d567bc1ca20 | 275,445,483,676,405,700,000,000,000,000,000,000,000 | 54 | geneve: add transport ports in route lookup for geneve
This patch adds transport ports information for route lookup so that
IPsec can select Geneve tunnel traffic to do encryption. This is
needed for OVS/OVN IPsec with encrypted Geneve tunnels.
This can be tested by configuring a host-host VPN using an IKE
daemon and... |
pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode )
{
if (!ensure_initialized()) {
ssl_log_error("Unable to initialize OpenSSL library");
return NULL;
}
pn_ssl_domain_t *domain = (pn_ssl_domain_t *) calloc(1, sizeof(pn_ssl_domain_t));
if (!domain) return NULL;
domain->ref_count = 1;
domain->mo... | 0 | [] | qpid-proton | 4aea0fd8502f5e9af7f22fd60645eeec07bce0b2 | 42,721,464,586,948,000,000,000,000,000,000,000,000 | 72 | PROTON-2014: [c] Ensure SSL mutual authentication
(cherry picked from commit 97c7733f07712665f3d08091c82c393e4c3adbf7) |
set16(uint8_t *buffer, int pos, uint16_t value)
{
buffer[pos++] = value >> 8;
buffer[pos++] = value & 0xff;
} | 0 | [
"CWE-703"
] | contiki-ng | 587ae59956e00316fd44fd7072ac3a6a07b4b20f | 320,973,931,399,694,600,000,000,000,000,000,000,000 | 5 | Check RPL Target prefix length and buffer boundary. |
RemoveKeyboardLayoutPackages (
IN HII_DATABASE_PRIVATE_DATA *Private,
IN EFI_HII_HANDLE Handle,
IN OUT HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList
)
{
LIST_ENTRY *ListHead;
HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE *Package;
EFI_HII_PAC... | 0 | [
"CWE-416"
] | edk2 | c32be82e99ef272e7fa742c2f06ff9a4c3756613 | 113,507,002,680,750,260,000,000,000,000,000,000,000 | 40 | MdeModulePkg/HiiDB: Remove configuration table when it's freed (CVE-2019-14586)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1995
Fix the corner case issue that the original configuration runtime
memory is freed, but it is still exposed to the OS runtime.
So this patch is to remove the configuration table to a... |
void Compute(OpKernelContext* context) override {
// boxes: [num_boxes, 4]
const Tensor& boxes = context->input(0);
// scores: [num_boxes]
const Tensor& scores = context->input(1);
// max_output_size: scalar
const Tensor& max_output_size = context->input(2);
OP_REQUIRES(
context, T... | 0 | [
"CWE-703",
"CWE-681"
] | tensorflow | 3a7362750d5c372420aa8f0caf7bf5b5c3d0f52d | 322,594,048,145,175,070,000,000,000,000,000,000,000 | 66 | Prevent crash/heap OOB due to integer conversion to unsigned in NMS kernels
PiperOrigin-RevId: 387938262
Change-Id: Id361a715307e7179977cf5c64391c199a966f2ad |
static void* swoole_unserialize_object(void *buffer, zval *return_value, zend_uchar bucket_len, zval *args, long flag)
{
zval property;
uint32_t arr_num = 0;
size_t name_len = *((unsigned short*) buffer);
if (!name_len)
{
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "illegal unserialize data")... | 1 | [
"CWE-200",
"CWE-502"
] | swoole-src | 4cdbce5d9bf2fe596bb6acd7d6611f9e8c253a76 | 9,471,244,567,604,290,000,000,000,000,000,000,000 | 115 | add buffer end check |
Status ValidateInputs(const Tensor *a_indices, const Tensor *a_values,
const Tensor *a_shape, const Tensor *b) {
if (!TensorShapeUtils::IsMatrix(a_indices->shape())) {
return errors::InvalidArgument(
"Input a_indices should be a matrix but received shape: ",
a_indices->shape(... | 1 | [
"CWE-20",
"CWE-476"
] | tensorflow | 11ced8467eccad9c7cb94867708be8fa5c66c730 | 313,787,551,478,648,260,000,000,000,000,000,000,000 | 31 | Fix UB in SparseTensorDenseAdd
Added more input validation to avoid nullptr dereferencing and array index
out of bounds issues.
PiperOrigin-RevId: 446192704 |
do_command (unsigned char c)
{
static int dtr_up = 0;
int newbaud, newflow, newparity, newbits;
const char *xfr_cmd;
char *fname;
int r;
switch (c) {
case KEY_EXIT:
return 1;
case KEY_QUIT:
term_set_hupcl(tty_fd, 0);
term_flush(tty_fd);
term_apply(tty_fd);
term_erase(tty_fd);
return 1;
case KEY_ST... | 0 | [
"CWE-77",
"CWE-125"
] | picocom | 1ebc60b20fbe9a02436d5cbbf8951714e749ddb1 | 81,395,096,320,825,950,000,000,000,000,000,000,000 | 125 | Do not use "/bin/sh" to run external commands.
Picocom no longer uses /bin/sh to run external commands for
file-transfer operations. Parsing the command line and spliting it into
arguments is now performed internally by picocom, using quoting rules
very similar to those of the Unix shell. Hopefully, this makes it
impo... |
void Compute(OpKernelContext* ctx) override {
const Tensor& input_0 = ctx->input(0);
const Tensor& input_1 = ctx->input(1);
const Device& eigen_device = ctx->eigen_device<Device>();
bool error = false;
bool* const error_ptr = Functor::has_errors ? &error : nullptr;
// NOTE: Handle three simpl... | 0 | [
"CWE-476",
"CWE-787"
] | tensorflow | 93f428fd1768df147171ed674fee1fc5ab8309ec | 19,591,253,900,223,722,000,000,000,000,000,000,000 | 131 | Fix nullptr deref and heap OOB access in binary cwise ops.
PiperOrigin-RevId: 387936777
Change-Id: I608b8074cec36a982cca622b7144cb2c43e6e19f |
static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
int *insn_idx_p)
{
const struct bpf_func_proto *fn = NULL;
struct bpf_reg_state *regs;
struct bpf_call_arg_meta meta;
int insn_idx = *insn_idx_p;
bool changes_data;
int i, err, func_id;
/* find function prototype */
func_... | 0 | [
"CWE-367"
] | bpf | 353050be4c19e102178ccc05988101887c25ae53 | 28,002,545,826,110,473,000,000,000,000,000,000,000 | 288 | bpf: Fix toctou on read-only map's constant scalar tracking
Commit a23740ec43ba ("bpf: Track contents of read-only maps as scalars") is
checking whether maps are read-only both from BPF program side and user space
side, and then, given their content is constant, reading out their data via
map->ops->map_direct_value_ad... |
AGGR_OP::prepare_tmp_table()
{
TABLE *table= join_tab->table;
JOIN *join= join_tab->join;
int rc= 0;
if (!join_tab->table->is_created())
{
if (instantiate_tmp_table(table, join_tab->tmp_table_param->keyinfo,
join_tab->tmp_table_param->start_recinfo,
... | 0 | [
"CWE-89"
] | server | 5ba77222e9fe7af8ff403816b5338b18b342053c | 68,806,962,324,750,300,000,000,000,000,000,000,000 | 32 | MDEV-21028 Server crashes in Query_arena::set_query_arena upon SELECT from view
if the view has algorithm=temptable it is not updatable,
so DEFAULT() for its fields is meaningless,
and thus it's NULL or 0/'' for NOT NULL columns. |
CImg<T>& draw_gaussian(const int xc, const int yc, const float r1, const float r2, const float ru, const float rv,
const tc *const color, const float opacity=1) {
const double
a = r1*ru*ru + r2*rv*rv,
b = (r1-r2)*ru*rv,
c = r1*rv*rv + r2*ru*ru;
const CI... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 9,986,612,548,103,112,000,000,000,000,000,000,000 | 9 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
int create_pipe_files(struct file **res, int flags)
{
int err;
struct inode *inode = get_pipe_inode();
struct file *f;
struct path path;
static struct qstr name = { .name = "" };
if (!inode)
return -ENFILE;
err = -ENOMEM;
path.dentry = d_alloc_pseudo(pipe_mnt->mnt_sb, &name);
if (!path.dentry)
goto err_i... | 0 | [
"CWE-399"
] | linux | 759c01142a5d0f364a462346168a56de28a80f52 | 52,353,747,224,818,410,000,000,000,000,000,000,000 | 52 | pipe: limit the per-user amount of pages allocated in pipes
On no-so-small systems, it is possible for a single process to cause an
OOM condition by filling large pipes with data that are never read. A
typical process filling 4000 pipes with 1 MB of data will use 4 GB of
memory. On small systems it may be tricky to se... |
static int bpf_lwt_input_reroute(struct sk_buff *skb)
{
int err = -EINVAL;
if (skb->protocol == htons(ETH_P_IP)) {
struct net_device *dev = skb_dst(skb)->dev;
struct iphdr *iph = ip_hdr(skb);
dev_hold(dev);
skb_dst_drop(skb);
err = ip_route_input_noref(skb, iph->daddr, iph->saddr,
iph->tos, dev);
... | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 80,694,230,909,079,670,000,000,000,000,000,000,000 | 28 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
TEST_F(SQLiteUtilTests, test_reset) {
auto internal_db = SQLiteDBManager::get()->db();
ASSERT_NE(nullptr, internal_db);
sqlite3_exec(internal_db,
"create view test_view as select 'test';",
nullptr,
nullptr,
nullptr);
SQLiteDBManager::resetPrimary();
... | 0 | [
"CWE-77",
"CWE-295"
] | osquery | c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c | 155,870,997,650,574,250,000,000,000,000,000,000,000 | 19 | Merge pull request from GHSA-4g56-2482-x7q8
* Proposed fix for attach tables vulnerability
* Add authorizer to ATC tables and cleanups
- Add unit test for authorizer function |
static __poll_t ep_eventpoll_poll(struct file *file, poll_table *wait)
{
struct eventpoll *ep = file->private_data;
int depth = 0;
/* Insert inside our poll wait queue */
poll_wait(file, &ep->poll_wait, wait);
/*
* Proceed to find out if wanted events are really available inside
* the ready list.
*/
retur... | 0 | [
"CWE-416"
] | linux | a9ed4a6560b8562b7e2e2bed9527e88001f7b682 | 231,260,843,009,780,060,000,000,000,000,000,000,000 | 15 | epoll: Keep a reference on files added to the check list
When adding a new fd to an epoll, and that this new fd is an
epoll fd itself, we recursively scan the fds attached to it
to detect cycles, and add non-epool files to a "check list"
that gets subsequently parsed.
However, this check list isn't completely safe wh... |
dns_zone_setkeydirectory(dns_zone_t *zone, const char *directory) {
isc_result_t result = ISC_R_SUCCESS;
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
result = dns_zone_setstring(zone, &zone->keydirectory, directory);
UNLOCK_ZONE(zone);
return (result);
} | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 188,236,083,071,849,560,000,000,000,000,000,000,000 | 11 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
entry_guard_succeeded(circuit_guard_state_t **guard_state_p)
{
if (BUG(*guard_state_p == NULL))
return GUARD_USABLE_NEVER;
entry_guard_t *guard = entry_guard_handle_get((*guard_state_p)->guard);
if (! guard || BUG(guard->in_selection == NULL))
return GUARD_USABLE_NEVER;
unsigned newstate =
entry_g... | 0 | [
"CWE-200"
] | tor | 665baf5ed5c6186d973c46cdea165c0548027350 | 265,323,770,773,510,370,000,000,000,000,000,000,000 | 22 | Consider the exit family when applying guard restrictions.
When the new path selection logic went into place, I accidentally
dropped the code that considered the _family_ of the exit node when
deciding if the guard was usable, and we didn't catch that during
code review.
This patch makes the guard_restriction_t code ... |
char* crypto_cert_fingerprint(X509* xcert)
{
return crypto_cert_fingerprint_by_hash(xcert, "sha256");
} | 0 | [
"CWE-787"
] | FreeRDP | 8305349a943c68b1bc8c158f431dc607655aadea | 115,650,122,252,764,940,000,000,000,000,000,000,000 | 4 | Fixed GHSL-2020-102 heap overflow
(cherry picked from commit 197b16cc15a12813c2e4fa2d6ae9cd9c4a57e581) |
static int count_args(const char **argv)
{
int i = 0;
if (argv) {
while (argv[i] != NULL)
i++;
}
return i;
} | 0 | [] | rsync | eac858085e3ac94ec0ab5061d11f52652c90a869 | 36,636,948,113,202,883,000,000,000,000,000,000,000 | 11 | Add compat flag to allow proper seed checksum order.
Fixes the equivalent of librsync's CVE-2014-8242 issue. |
void unit_start_on_failure(Unit *u) {
Unit *other;
Iterator i;
assert(u);
if (set_size(u->dependencies[UNIT_ON_FAILURE]) <= 0)
return;
log_info_unit(u->id, "Triggering OnFailure= dependencies of %s.", u->id);
SET_FOREACH(other, u->dependencies[UNIT_ON_... | 0 | [] | systemd | 5ba6985b6c8ef85a8bcfeb1b65239c863436e75b | 290,313,738,076,514,540,000,000,000,000,000,000,000 | 19 | core: allow PIDs to be watched by two units at the same time
In some cases it is interesting to map a PID to two units at the same
time. For example, when a user logs in via a getty, which is reexeced to
/sbin/login that binary will be explicitly referenced as main pid of the
getty service, as well as implicitly refer... |
static int check_cfg(struct bpf_verifier_env *env)
{
struct bpf_insn *insns = env->prog->insnsi;
int insn_cnt = env->prog->len;
int ret = 0;
int i, t;
insn_state = kcalloc(insn_cnt, sizeof(int), GFP_KERNEL);
if (!insn_state)
return -ENOMEM;
insn_stack = kcalloc(insn_cnt, sizeof(int), GFP_KERNEL);
if (!insn_... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 | 20,620,857,610,183,863,000,000,000,000,000,000,000 | 114 | bpf: prevent out of bounds speculation on pointer arithmetic
Jann reported that the original commit back in b2157399cc98
("bpf: prevent out-of-bounds speculation") was not sufficient
to stop CPU from speculating out of bounds memory access:
While b2157399cc98 only focussed on masking array map access
for unprivileged ... |
struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
struct mddev *mddev)
{
struct bio *b;
if (!mddev || !mddev->bio_set)
return bio_alloc(gfp_mask, nr_iovecs);
b = bio_alloc_bioset(gfp_mask, nr_iovecs, mddev->bio_set);
if (!b)
return NULL;
return b;
} | 0 | [
"CWE-200"
] | linux | b6878d9e03043695dbf3fa1caa6dfc09db225b16 | 30,979,842,510,328,793,000,000,000,000,000,000,000 | 13 | md: use kzalloc() when bitmap is disabled
In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".
5769 file = kmalloc(sizeof(*file), GFP_NOIO);
5770 if (!file)
5771 return -ENOMEM;
This structure is copied to user space at the end of the fun... |
XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status)
{
if (parser == NULL)
return;
assert(status != NULL);
*status = parser->m_parsingStatus;
} | 0 | [
"CWE-611"
] | libexpat | c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f | 310,289,399,719,156,420,000,000,000,000,000,000,000 | 7 | xmlparse.c: Fix external entity infinite loop bug (CVE-2017-9233) |
void jpc_mqdec_dump(jpc_mqdec_t *mqdec, FILE *out)
{
fprintf(out, "MQDEC A = %08lx, C = %08lx, CT=%08lx, ",
(unsigned long) mqdec->areg, (unsigned long) mqdec->creg,
(unsigned long) mqdec->ctreg);
fprintf(out, "CTX = %d, ", mqdec->curctx - mqdec->ctxs);
fprintf(out, "IND %d, MPS %d, QEVAL %x\n", *mqdec->curctx... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 325,736,977,465,751,650,000,000,000,000,000,000,000 | 9 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.