func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
bfad_im_get_starget_port_id(struct scsi_target *starget)
{
struct Scsi_Host *shost;
struct bfad_im_port_s *im_port;
struct bfad_s *bfad;
struct bfad_itnim_s *itnim = NULL;
u32 fc_id = -1;
unsigned long flags;
shost = dev_to_shost(starget->dev.parent);
im_port = (struct bfad_im_port_s *) shos... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 0e62395da2bd5166d7c9e14cbc7503b256a34cb0 | 96,727,188,272,848,010,000,000,000,000,000,000,000 | 21 | scsi: bfa: release allocated memory in case of error
In bfad_im_get_stats if bfa_port_get_stats fails, allocated memory needs to
be released.
Link: https://lore.kernel.org/r/20190910234417.22151-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Martin K. Petersen <m... |
void nf_tables_deactivate_flowtable(const struct nft_ctx *ctx,
struct nft_flowtable *flowtable,
enum nft_trans_phase phase)
{
switch (phase) {
case NFT_TRANS_PREPARE:
case NFT_TRANS_ABORT:
case NFT_TRANS_RELEASE:
flowtable->use--;
fallthrough;
default:
return;
}
} | 0 | [
"CWE-665"
] | linux | ad9f151e560b016b6ad3280b48e42fa11e1a5440 | 223,449,472,927,625,840,000,000,000,000,000,000,000 | 14 | netfilter: nf_tables: initialize set before expression setup
nft_set_elem_expr_alloc() needs an initialized set if expression sets on
the NFT_EXPR_GC flag. Move set fields initialization before expression
setup.
[4512935.019450] ==================================================================
[4512935.019456] BUG: ... |
static void MSLWarning(void *context,const char *format,...)
{
char
*message,
reason[MagickPathExtent];
MSLInfo
*msl_info;
va_list
operands;
/**
Display and format a warning messages, gives file, line, position and
extra parameters.
*/
va_start(operands,format);
(void) LogMagick... | 0 | [
"CWE-772",
"CWE-787"
] | ImageMagick | e793eb203e5e0f91f5037aed6585e81b1e27395b | 49,723,597,594,361,200,000,000,000,000,000,000,000 | 31 | https://github.com/ImageMagick/ImageMagick/issues/636 |
GF_Err leva_dump(GF_Box *a, FILE * trace)
{
u32 i;
GF_LevelAssignmentBox *p = (GF_LevelAssignmentBox *)a;
gf_isom_box_dump_start(a, "LevelAssignmentBox", trace);
fprintf(trace, "level_count=\"%d\" >\n", p->level_count);
for (i = 0; i < p->level_count; i++) {
fprintf(trace, "<Assignement track_id=\"%d\" padding_... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 54,149,713,859,854,920,000,000,000,000,000,000,000 | 16 | fixed 2 possible heap overflows (inc. #1088) |
static int property_get_working_directory(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *reply,
void *userdata,
sd_bus_error *error) {
ExecContext *c = u... | 0 | [
"CWE-269"
] | systemd | f69567cbe26d09eac9d387c0be0fc32c65a83ada | 287,932,836,381,334,620,000,000,000,000,000,000,000 | 26 | core: expose SUID/SGID restriction as new unit setting RestrictSUIDSGID= |
static void set_cursor_if_appropriate(GtkTextView *text_view,
gint x,
gint y)
{
GSList *tags = NULL, *tagp = NULL;
GtkTextIter iter;
gboolean hovering = FALSE;
gtk_text_view_get_iter_at_location(text_view, &iter, x, y);
ta... | 0 | [
"CWE-200"
] | libreport | 257578a23d1537a2d235aaa2b1488ee4f818e360 | 63,463,087,365,461,970,000,000,000,000,000,000,000 | 36 | wizard: fix save users changes after reviewing dump dir files
If the user reviewed the dump dir's files during reporting the crash, the
changes was thrown away and original data was passed to the bugzilla bug
report.
report-gtk saves the first text view buffer and then reloads data from the
reported problem directory... |
void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id)
{
ssd->worker->destroy_primary_surface(ssd->worker, id);
} | 1 | [] | qemu-kvm | 5ff4e36c804157bd84af43c139f8cd3a59722db9 | 71,919,588,775,585,830,000,000,000,000,000,000,000 | 4 | qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server to
complete certain actions. Add async versions for these commands, so we
don't block the vcpu while the spice server processses the command.
Instead the qxl device will raise an IRQ when done.
The async comm... |
stop_conversation_now (GdmSessionConversation *conversation)
{
close_conversation (conversation);
gdm_session_worker_job_stop_now (conversation->job);
g_clear_object (&conversation->job);
} | 0 | [] | gdm | 5ac224602f1d603aac5eaa72e1760d3e33a26f0a | 184,206,768,827,977,820,000,000,000,000,000,000,000 | 7 | session: disconnect signals from worker proxy when conversation is freed
We don't want an outstanding reference on the worker proxy to lead to
signal handlers getting dispatched after the conversation is freed.
https://bugzilla.gnome.org/show_bug.cgi?id=758032 |
static int ff_layout_read_prepare_common(struct rpc_task *task,
struct nfs_pgio_header *hdr)
{
if (unlikely(test_bit(NFS_CONTEXT_BAD, &hdr->args.context->flags))) {
rpc_exit(task, -EIO);
return -EIO;
}
ff_layout_read_record_layoutstats_start(task, hdr);
return 0;
} | 0 | [
"CWE-787"
] | linux | ed34695e15aba74f45247f1ee2cf7e09d449f925 | 157,729,610,648,494,300,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... |
compile_load_lhs(
lhs_T *lhs,
char_u *var_start,
type_T *rhs_type,
cctx_T *cctx)
{
if (lhs->lhs_dest == dest_expr)
{
size_t varlen = lhs->lhs_varlen;
int c = var_start[varlen];
int lines_len = cctx->ctx_ufunc->uf_lines.ga_len;
char_u *p = var_start;
garray_T *stack = &cctx->ctx_type_... | 0 | [
"CWE-416"
] | vim | 9c23f9bb5fe435b28245ba8ac65aa0ca6b902c04 | 316,239,201,890,237,700,000,000,000,000,000,000,000 | 44 | patch 8.2.3902: Vim9: double free with nested :def function
Problem: Vim9: double free with nested :def function.
Solution: Pass "line_to_free" from compile_def_function() and make sure
cmdlinep is valid. |
nfs3svc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args)
{
p = decode_fh(p, &args->fh);
if (!p)
return 0;
return xdr_argsize_check(rqstp, p);
} | 0 | [
"CWE-119",
"CWE-703"
] | linux | 13bf9fbff0e5e099e2b6f003a0ab8ae145436309 | 83,022,731,356,504,790,000,000,000,000,000,000,000 | 7 | nfsd: stricter decoding of write-like NFSv2/v3 ops
The NFSv2/v3 code does not systematically check whether we decode past
the end of the buffer. This generally appears to be harmless, but there
are a few places where we do arithmetic on the pointers involved and
don't account for the possibility that a length could b... |
virtual bool slaveOk() const {
// ok on --slave setups
return repl::getGlobalReplicationCoordinator()->getSettings().isSlave();
} | 0 | [
"CWE-20"
] | mongo | 5c7c6729c37514760fd34da462b6961a2e385417 | 80,747,844,769,646,210,000,000,000,000,000,000,000 | 4 | SERVER-38275 ban explain with UUID |
void incNumConnections() override {
++num_listener_connections_;
config_->openConnections().inc();
} | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 120,745,723,606,323,620,000,000,000,000,000,000,000 | 4 | 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 l2tp_ip_destroy_sock(struct sock *sk)
{
struct sk_buff *skb;
while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL)
kfree_skb(skb);
sk_refcnt_debug_dec(sk);
} | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 125,051,119,450,319,870,000,000,000,000,000,000,000 | 9 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
unlink_external_pid_file(int status, Datum arg)
{
if (external_pid_file)
unlink(external_pid_file);
} | 0 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 52,068,584,086,570,090,000,000,000,000,000,000,000 | 5 | 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... |
flatpak_dir_create_system_child_oci_registry (FlatpakDir *self,
GLnxLockFile *file_lock,
const char *token,
GError **error)
{
g_autoptr(GFile) cache_dir = NULL;
g_autopt... | 0 | [
"CWE-74"
] | flatpak | fb473cad801c6b61706353256cab32330557374a | 148,797,999,348,537,050,000,000,000,000,000,000,000 | 41 | dir: Pass environment via bwrap --setenv when running apply_extra
This means we can systematically pass the environment variables
through bwrap(1), even if it is setuid and thus is filtering out
security-sensitive environment variables. bwrap ends up being
run with an empty environment instead.
As with the previous c... |
pg_tzenumerate_next(pg_tzenum *dir)
{
while (dir->depth >= 0)
{
struct dirent *direntry;
char fullname[MAXPGPATH];
struct stat statbuf;
direntry = ReadDir(dir->dirdesc[dir->depth], dir->dirname[dir->depth]);
if (!direntry)
{
/* End of this directory */
FreeDir(dir->dirdesc[dir->depth]);
pfree(... | 0 | [
"CWE-119"
] | postgres | 01824385aead50e557ca1af28640460fa9877d51 | 280,029,055,378,988,800,000,000,000,000,000,000,000 | 72 | 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... |
bool __fastcall TSCPFileSystem::LoadFilesProperties(TStrings * /*FileList*/ )
{
DebugFail();
return false;
}
| 0 | [
"CWE-20"
] | winscp | 49d876f2c5fc00bcedaa986a7cf6dedd6bf16f54 | 59,908,608,150,524,530,000,000,000,000,000,000,000 | 5 | Bug 1675: Prevent SCP server sending files that were not requested
https://winscp.net/tracker/1675
Source commit: 4aa587620973bf793fb6e783052277c0f7be4b55 |
SPL_METHOD(SplFileObject, fscanf)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if(!intern->u.file.stream) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
spl_filesystem_file_free_line(intern);
intern->u.file.current_line_num++;
FileFunctionCall(... | 0 | [
"CWE-74"
] | php-src | a5a15965da23c8e97657278fc8dfbf1dfb20c016 | 86,671,883,339,795,570,000,000,000,000,000,000,000 | 14 | Fix #78863: DirectoryIterator class silently truncates after a null byte
Since the constructor of DirectoryIterator and friends is supposed to
accepts paths (i.e. strings without NUL bytes), we must not accept
arbitrary strings. |
static void append_status_info(packet_info *pinfo,
guint32 writer_id,
guint32 status_info) {
/* Defines the extra information associated to the writer involved in
* this communication
*
* Format: [?Ptwrpm]\(u?d?\)
*
* First letter table:
*
* wri... | 0 | [
"CWE-401"
] | wireshark | 33e63d19e5496c151bad69f65cdbc7cba2b4c211 | 87,992,394,511,927,600,000,000,000,000,000,000,000 | 107 | RTPS: Fixup our coherent set map.
coherent_set_tracking.coherent_set_registry_map uses a struct as a key,
but the hash and comparison routines treat keys as a sequence of bytes.
Make sure every key byte is initialized. Fixes #16994.
Call wmem_strong_hash on our key in coherent_set_key_hash_by_key instead
of creating ... |
switch (yych) {
case 'a': goto yy34;
default: goto yy33;
} | 1 | [
"CWE-787"
] | re2c | 039c18949190c5de5397eba504d2c75dad2ea9ca | 72,101,987,428,801,270,000,000,000,000,000,000,000 | 4 | Emit an error when repetition lower bound exceeds upper bound.
Historically this was allowed and re2c swapped the bounds. However, it
most likely indicates an error in user code and there is only a single
occurrence in the tests (and the test in an artificial one), so although
the change is backwards incompatible ther... |
static inline void inc_rfc1001_len(void *pSMB, int count)
{
struct smb_hdr *hdr = (struct smb_hdr *)pSMB;
be32_add_cpu(&hdr->smb_buf_length, count);
} | 0 | [
"CWE-362",
"CWE-119",
"CWE-189"
] | linux | 9438fabb73eb48055b58b89fc51e0bc4db22fabd | 283,947,710,389,991,050,000,000,000,000,000,000,000 | 6 | cifs: fix possible memory corruption in CIFSFindNext
The name_len variable in CIFSFindNext is a signed int that gets set to
the resume_name_len in the cifs_search_info. The resume_name_len however
is unsigned and for some infolevels is populated directly from a 32 bit
value sent by the server.
If the server sends a v... |
bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node)
{
WARN_ON_ONCE(RB_EMPTY_NODE(&node->node));
/* update next pointer */
if (head->next == node) {
struct rb_node *rbn = rb_next(&node->node);
head->next = rb_entry_safe(rbn, struct timerqueue_node, node);
}
rb_erase(&node->node, &h... | 1 | [
"CWE-665"
] | tip | 511885d7061eda3eb1faf3f57dcc936ff75863f1 | 241,876,601,560,645,340,000,000,000,000,000,000,000 | 14 | lib/timerqueue: Rely on rbtree semantics for next timer
Simplify the timerqueue code by using cached rbtrees and rely on the tree
leftmost node semantics to get the timer with earliest expiration time.
This is a drop in conversion, and therefore semantics remain untouched.
The runtime overhead of cached rbtrees is be... |
u32toutf8 (wc, s)
u_bits32_t wc;
char *s;
{
int l;
if (wc < 0x0080)
{
s[0] = (char)wc;
l = 1;
}
else if (wc < 0x0800)
{
s[0] = (wc >> 6) | 0xc0;
s[1] = (wc & 0x3f) | 0x80;
l = 2;
}
else if (wc < 0x10000)
{
s[0] = (wc >> 12) | 0xe0;
s[1] = ... | 1 | [] | bash | 863d31ae775d56b785dc5b0105b6d251515d81d5 | 171,973,259,555,339,600,000,000,000,000,000,000,000 | 56 | commit bash-20120224 snapshot |
static int hostmatch(char *hostname, char *pattern)
{
const char *pattern_label_end, *pattern_wildcard, *hostname_label_end;
int wildcard_enabled;
size_t prefixlen, suffixlen;
struct in_addr ignored;
#ifdef ENABLE_IPV6
struct sockaddr_in6 si6;
#endif
/* normalize pattern and hostname by stripping off trail... | 0 | [
"CWE-310"
] | lftp | 6357bed2583171b7515af6bb6585cf56d2117e3f | 96,372,055,018,432,840,000,000,000,000,000,000,000 | 62 | use hostmatch function from latest curl (addresses CVE-2014-0139) |
auto testOflow(F f, A a, B b) {
return runTest<T>(true, f, a, b);
}; | 0 | [
"CWE-190"
] | mongo | 21d8699ed6c517b45e1613e20231cd8eba894985 | 253,044,231,172,168,580,000,000,000,000,000,000,000 | 3 | SERVER-43699 $mod should not overflow for large negative values |
std::string color_profile_raw::dump(Indent& indent) const
{
std::ostringstream sstr;
sstr << indent << "profile size: " << m_data.size() << "\n";
return sstr.str();
} | 0 | [
"CWE-703"
] | libheif | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | 88,653,535,477,077,980,000,000,000,000,000,000,000 | 6 | force fraction to a limited resolution to finally solve those pesky numerical edge cases |
static gif_result gif_error_from_lzw(lzw_result l_res)
{
static const gif_result g_res[] = {
[LZW_OK] = GIF_OK,
[LZW_OK_EOD] = GIF_END_OF_FRAME,
[LZW_NO_MEM] = GIF_INSUFFICIENT_MEMORY,
[LZW_NO_DATA] = GIF_INSUFFICIENT_FRAME_DATA,
... | 0 | [
"CWE-476"
] | chafa | e4b777c7b7c144cd16a0ea96108267b1004fe6c9 | 47,099,465,574,457,110,000,000,000,000,000,000,000 | 13 | libnsgif: Fix null pointer deref on frameless GIF input
A crafted GIF file with no frame data could cause a null pointer
dereference leading to denial of service (crash). Reported by
@JieyongMa via huntr.dev. |
int SSL_get_verify_depth(const SSL *s)
{
return X509_VERIFY_PARAM_get_depth(s->param);
} | 0 | [] | openssl | ee2ffc279417f15fef3b1073c7dc81a908991516 | 188,808,090,581,900,130,000,000,000,000,000,000,000 | 4 | Add Next Protocol Negotiation. |
read_filename (void)
{
char fname[_POSIX_PATH_MAX];
int r;
fd_printf(STO, "\r\n*** file: ");
r = fd_readline(STI, STO, fname, sizeof(fname));
fd_printf(STO, "\r\n");
if ( r < 0 )
return NULL;
else
return strdup(fname);
} | 0 | [
"CWE-77",
"CWE-125"
] | picocom | 1ebc60b20fbe9a02436d5cbbf8951714e749ddb1 | 321,241,209,053,341,800,000,000,000,000,000,000,000 | 13 | 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... |
proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
gint start, gint length,
const guint8* value_ptr,
const char *format, ...)
{
proto_item *pi;
va_list ap;
pi = proto_tree_add_oid(tree, hfindex, tvb, start, length, value_ptr);
if (pi != tree) {
va_start(ap, format);
... | 0 | [
"CWE-401"
] | wireshark | a9fc769d7bb4b491efb61c699d57c9f35269d871 | 226,058,673,683,973,940,000,000,000,000,000,000,000 | 17 | epan: Fix a memory leak.
Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032. |
struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
enum nl80211_commands cmd,
enum nl80211_attrs attr,
int approxlen)
{
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
if (WARN_ON(!rdev->cur_cmd_info))
return NULL;
return __cfg80211_alloc_vendor_skb(rdev, NULL... | 0 | [
"CWE-120"
] | linux | f88eb7c0d002a67ef31aeb7850b42ff69abc46dc | 144,611,306,986,191,650,000,000,000,000,000,000,000 | 15 | nl80211: validate beacon head
We currently don't validate the beacon head, i.e. the header,
fixed part and elements that are to go in front of the TIM
element. This means that the variable elements there can be
malformed, e.g. have a length exceeding the buffer size, but
most downstream code from this assumes that thi... |
longlong Item_func_udf_decimal::val_int()
{
my_bool tmp_null_value;
longlong result;
my_decimal dec_buf, *dec= udf.val_decimal(&tmp_null_value, &dec_buf);
null_value= tmp_null_value;
if (null_value)
return 0;
my_decimal2int(E_DEC_FATAL_ERROR, dec, unsigned_flag, &result);
return result;
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 87,176,741,853,289,570,000,000,000,000,000,000,000 | 11 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
static bool recalc_sigpending_tsk(struct task_struct *t)
{
if ((t->jobctl & (JOBCTL_PENDING_MASK | JOBCTL_TRAP_FREEZE)) ||
PENDING(&t->pending, &t->blocked) ||
PENDING(&t->signal->shared_pending, &t->blocked) ||
cgroup_task_frozen(t)) {
set_tsk_thread_flag(t, TIF_SIGPENDING);
return true;
}
/*
... | 0 | [
"CWE-190"
] | linux | d1e7fd6462ca9fc76650fbe6ca800e35b24267da | 203,805,944,639,940,660,000,000,000,000,000,000,000 | 17 | signal: Extend exec_id to 64bits
Replace the 32bit exec_id with a 64bit exec_id to make it impossible
to wrap the exec_id counter. With care an attacker can cause exec_id
wrap and send arbitrary signals to a newly exec'd parent. This
bypasses the signal sending checks if the parent changes their
credentials during e... |
static int io_epoll_ctl(struct io_kiocb *req, struct io_kiocb **nxt,
bool force_nonblock)
{
#if defined(CONFIG_EPOLL)
struct io_epoll *ie = &req->epoll;
int ret;
ret = do_epoll_ctl(ie->epfd, ie->op, ie->fd, &ie->event, force_nonblock);
if (force_nonblock && ret == -EAGAIN)
return -EAGAIN;
if (ret < 0)
req... | 0 | [] | linux | ff002b30181d30cdfbca316dadd099c3ca0d739c | 174,753,303,943,843,020,000,000,000,000,000,000,000 | 20 | io_uring: grab ->fs as part of async preparation
This passes it in to io-wq, so it assumes the right fs_struct when
executing async work that may need to do lookups.
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
inline void AddScalarBroadcast(int size, const ArithmeticParams& params,
uint8 input1_data, const uint8* input2_data,
uint8* output_data) {
using gemmlowp::RoundingDivideByPOT;
ruy::profiler::ScopeLabel label("AddScalarBroadcast/8bit");
TFLITE_DCHECK_... | 0 | [
"CWE-476",
"CWE-369"
] | tensorflow | 15691e456c7dc9bd6be203b09765b063bf4a380c | 192,085,393,288,469,470,000,000,000,000,000,000,000 | 99 | Prevent dereferencing of null pointers in TFLite's `add.cc`.
PiperOrigin-RevId: 387244946
Change-Id: I56094233327fbd8439b92e1dbb1262176e00eeb9 |
static void intr_callback(struct urb *urb)
{
struct hso_shared_int *shared_int = urb->context;
struct hso_serial *serial;
unsigned char *port_req;
int status = urb->status;
unsigned long flags;
int i;
usb_mark_last_busy(urb->dev);
/* sanity check */
if (!shared_int)
return;
/* status check */
if (status... | 0 | [
"CWE-125"
] | linux | 5146f95df782b0ac61abde36567e718692725c89 | 129,436,929,637,981,900,000,000,000,000,000,000,000 | 56 | USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data
The function hso_probe reads if_num from the USB device (as an u8) and uses
it without a length check to index an array, resulting in an OOB memory read
in hso_probe or hso_get_config_data.
Add a length check for both locations and updated hso_probe to ... |
i915_gem_execbuffer_move_to_active(struct list_head *objects,
struct intel_ring_buffer *ring,
u32 seqno)
{
struct drm_i915_gem_object *obj;
list_for_each_entry(obj, objects, exec_list) {
u32 old_read = obj->base.read_domains;
u32 old_write = obj->base.write_domain;
obj->base.read_domains = ... | 0 | [
"CWE-189"
] | linux-2.6 | ed8cd3b2cd61004cab85380c52b1817aca1ca49b | 112,661,471,827,089,700,000,000,000,000,000,000,000 | 27 | drm/i915: fix integer overflow in i915_gem_execbuffer2()
On 32-bit systems, a large args->buffer_count from userspace via ioctl
may overflow the allocation size, leading to out-of-bounds access.
This vulnerability was introduced in commit 8408c282 ("drm/i915:
First try a normal large kmalloc for the temporary exec bu... |
invoke_listeners(buf_T *buf)
{
listener_T *lnr;
typval_T rettv;
typval_T argv[6];
listitem_T *li;
linenr_T start = MAXLNUM;
linenr_T end = 0;
linenr_T added = 0;
int save_updating_screen = updating_screen;
static int recursive = FALSE;
listener_T *next;
if (buf->b_recorded_... | 0 | [
"CWE-120"
] | vim | 7ce5b2b590256ce53d6af28c1d203fb3bc1d2d97 | 19,486,358,530,186,540,000,000,000,000,000,000,000 | 77 | patch 8.2.4969: changing text in Visual mode may cause invalid memory access
Problem: Changing text in Visual mode may cause invalid memory access.
Solution: Check the Visual position after making a change. |
GF_Err gen_sample_entry_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_SampleEntryBox *ptr = (GF_SampleEntryBox *)s;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_data(bs, ptr->reserved, 6);
gf_bs_write_u16(bs, ptr->dataReferenceIndex);
return gf_isom_box_array_write(s, ptr->protections, ... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 151,892,419,455,222,550,000,000,000,000,000,000,000 | 11 | prevent dref memleak on invalid input (#1183) |
void cql_server::response::write_byte(uint8_t b)
{
auto s = reinterpret_cast<const int8_t*>(&b);
_body.write(bytes_view(s, sizeof(b)));
} | 0 | [] | scylladb | 1c2eef384da439b0457b6d71c7e37d7268e471cb | 296,358,732,263,407,250,000,000,000,000,000,000,000 | 5 | transport/server.cc: Return correct size of decompressed lz4 buffer
An incorrect size is returned from the function, which could lead to
crashes or undefined behavior. Fix by erroring out in these cases.
Fixes #11476 |
int length() {
return 3;
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 14,078,195,437,989,660,000,000,000,000,000,000,000 | 3 | SERVER-38070 fix infinite loop in agg expression |
static void free_vfsmnt(struct mount *mnt)
{
struct user_namespace *mnt_userns;
mnt_userns = mnt_user_ns(&mnt->mnt);
if (mnt_userns != &init_user_ns)
put_user_ns(mnt_userns);
kfree_const(mnt->mnt_devname);
#ifdef CONFIG_SMP
free_percpu(mnt->mnt_pcp);
#endif
kmem_cache_free(mnt_cache, mnt);
} | 0 | [
"CWE-200"
] | linux | 427215d85e8d1476da1a86b8d67aceb485eb3631 | 143,675,873,998,025,850,000,000,000,000,000,000,000 | 13 | ovl: prevent private clone if bind mount is not allowed
Add the following checks from __do_loopback() to clone_private_mount() as
well:
- verify that the mount is in the current namespace
- verify that there are no locked children
Reported-by: Alois Wohlschlager <alois1@gmx-topmail.de>
Fixes: c771d683a62e ("vfs: ... |
static int get_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
{
u64 data;
u64 mcg_cap = vcpu->arch.mcg_cap;
unsigned bank_num = mcg_cap & 0xff;
switch (msr) {
case MSR_IA32_P5_MC_ADDR:
case MSR_IA32_P5_MC_TYPE:
data = 0;
break;
case MSR_IA32_MCG_CAP:
data = vcpu->arch.mcg_cap;
break;
case MSR_IA32... | 0 | [
"CWE-200"
] | kvm | 831d9d02f9522e739825a51a11e3bc5aa531a905 | 246,349,488,399,129,970,000,000,000,000,000,000,000 | 34 | KVM: x86: fix information leak to userland
Structures kvm_vcpu_events, kvm_debugregs, kvm_pit_state2 and
kvm_clock_data are copied to userland with some padding and reserved
fields unitialized. It leads to leaking of contents of kernel stack
memory. We have to initialize them to zero.
In patch v1 Jan Kiszka suggest... |
void dictVanillaFree(void *privdata, void *val)
{
DICT_NOTUSED(privdata);
zfree(val);
} | 0 | [
"CWE-20"
] | redis | 697af434fbeb2e3ba2ba9687cd283ed1a2734fa5 | 305,755,151,064,599,170,000,000,000,000,000,000,000 | 5 | initial changes needed to turn the current VM code into a cache system. Tons of work to do still. |
static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq)
{
struct task_group *tg = cfs_rq->tg;
struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(tg);
u64 amount = 0, min_amount, expires;
int expires_seq;
/* note: this is a positive sum as runtime_remaining <= 0 */
min_amount = sched_cfs_bandwidth_slice() - cfs_rq->r... | 1 | [
"CWE-400",
"CWE-703"
] | linux | de53fd7aedb100f03e5d2231cfce0e4993282425 | 217,200,445,792,043,800,000,000,000,000,000,000,000 | 39 | sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices
It has been observed, that highly-threaded, non-cpu-bound applications
running under cpu.cfs_quota_us constraints can hit a high percentage of
periods throttled while simultaneously not consuming the allocated
amount of quota... |
OPJ_BOOL opj_j2k_write_tile(opj_j2k_t * p_j2k,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager)
{
... | 0 | [
"CWE-416",
"CWE-787"
] | openjpeg | 4241ae6fbbf1de9658764a80944dc8108f2b4154 | 33,424,509,099,542,460,000,000,000,000,000,000,000 | 38 | Fix assertion in debug mode / heap-based buffer overflow in opj_write_bytes_LE for Cinema profiles with numresolutions = 1 (#985) |
mlx5_tx_eseg_mdat(struct mlx5_txq_data *__rte_restrict txq,
struct mlx5_txq_local *__rte_restrict loc,
struct mlx5_wqe *__rte_restrict wqe,
unsigned int vlan,
unsigned int inlen,
unsigned int tso,
unsigned int olx)
{
struct mlx5_wqe_eseg *__rte_restrict es = &wqe->eseg;
uint32_t csum;
uint8_t... | 0 | [] | dpdk-stable | ef311075d21b4f68c8ccfc46a00cda7c2a0bf4cc | 193,632,208,589,235,100,000,000,000,000,000,000,000 | 86 | net/mlx5: fix Rx queue recovery mechanism
The local variables are getting inconsistent in data receiving routines
after queue error recovery.
Receive queue consumer index is getting wrong, need to reset one to the
size of the queue (as RQ was fully replenished in recovery procedure).
In MPRQ case, also the local cons... |
void tcp_set_state(struct sock *sk, int state)
{
int oldstate = sk->sk_state;
switch (state) {
case TCP_ESTABLISHED:
if (oldstate != TCP_ESTABLISHED)
TCP_INC_STATS(sock_net(sk), TCP_MIB_CURRESTAB);
break;
case TCP_CLOSE:
if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
TCP_INC_STATS(sock... | 0 | [
"CWE-399",
"CWE-835"
] | linux | ccf7abb93af09ad0868ae9033d1ca8108bdaec82 | 302,159,338,190,883,360,000,000,000,000,000,000,000 | 33 | tcp: avoid infinite loop in tcp_splice_read()
Splicing from TCP socket is vulnerable when a packet with URG flag is
received and stored into receive queue.
__tcp_splice_read() returns 0, and sk_wait_data() immediately
returns since there is the problematic skb in queue.
This is a nice way to burn cpu (aka infinite l... |
static unsigned long mb2_cache_scan(struct shrinker *shrink,
struct shrink_control *sc)
{
int nr_to_scan = sc->nr_to_scan;
struct mb2_cache *cache = container_of(shrink, struct mb2_cache,
c_shrink);
struct mb2_cache_entry *entry;
struct hlist_bl_head *head;
unsigned int shrunk = 0;
spin_lock(&... | 0 | [
"CWE-241",
"CWE-19"
] | linux | f9a61eb4e2471c56a63cd804c7474128138c38ac | 172,355,791,675,153,120,000,000,000,000,000,000,000 | 37 | mbcache2: reimplement mbcache
Original mbcache was designed to have more features than what ext?
filesystems ended up using. It supported entry being in more hashes, it
had a home-grown rwlocking of each entry, and one cache could cache
entries from multiple filesystems. This genericity also resulted in more
complex l... |
static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
{
struct vcpu_svm *svm = to_svm(vcpu);
switch (ecx) {
case MSR_IA32_TSC: {
*data = svm->vmcb->control.tsc_offset +
svm_scale_tsc(vcpu, native_read_tsc());
break;
}
case MSR_STAR:
*data = svm->vmcb->save.star;
break;
#ifdef CONFIG_X... | 0 | [] | kvm | 854e8bb1aa06c578c2c9145fa6bfe3680ef63b23 | 190,540,740,939,711,160,000,000,000,000,000,000,000 | 71 | KVM: x86: Check non-canonical addresses upon WRMSR
Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is
written to certain MSRs. The behavior is "almost" identical for AMD and Intel
(ignoring MSRs that are not implemented in either architecture since they would
anyhow #GP). However, IA32_SYSENTE... |
static int __init xfrm6_tunnel_init(void)
{
int rv;
xfrm6_tunnel_spi_kmem = kmem_cache_create("xfrm6_tunnel_spi",
sizeof(struct xfrm6_tunnel_spi),
0, SLAB_HWCACHE_ALIGN,
NULL);
if (!xfrm6_tunnel_spi_kmem)
return -ENOMEM;
rv = register_pernet_subsys(&xfrm6_tunnel_net_ops);
if (rv < 0)
g... | 0 | [] | linux-2.6 | d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978 | 256,004,193,150,242,180,000,000,000,000,000,000,000 | 34 | tunnels: fix netns vs proto registration ordering
Same stuff as in ip_gre patch: receive hook can be called before netns
setup is done, oopsing in net_generic().
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
validate_transit_path(krb5_context context,
krb5_const_principal client,
krb5_db_entry *server,
krb5_db_entry *header_srv)
{
/* Incoming */
if (isflagset(server->attributes, KRB5_KDB_XREALM_NON_TRANSITIVE)) {
return KRB5KDC_ERR_PATH_NOT_A... | 0 | [
"CWE-476"
] | krb5 | 93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7 | 13,769,705,077,381,897,000,000,000,000,000,000,000 | 19 | Fix S4U2Self KDC crash when anon is restricted
In validate_as_request(), when enforcing restrict_anonymous_to_tgt,
use client.princ instead of request->client; the latter is NULL when
validating S4U2Self requests.
CVE-2016-3120:
In MIT krb5 1.9 and later, an authenticated attacker can cause krb5kdc
to dereference a ... |
ldns_rr_rdf(const ldns_rr *rr, size_t nr)
{
if (rr && nr < ldns_rr_rd_count(rr)) {
return rr->_rdata_fields[nr];
} else {
return NULL;
}
} | 0 | [
"CWE-415"
] | ldns | 070b4595981f48a21cc6b4f5047fdc2d09d3da91 | 4,801,121,350,088,880,600,000,000,000,000,000,000 | 8 | CAA and URI |
bool parse(const char *s, any &dt, T &val,
const char * /*path*/ = nullptr) const {
auto n = strlen(s);
return parse_n(s, n, dt, val);
} | 0 | [
"CWE-125"
] | cpp-peglib | b3b29ce8f3acf3a32733d930105a17d7b0ba347e | 247,474,553,769,931,770,000,000,000,000,000,000,000 | 5 | Fix #122 |
TEST(InMatchExpression, InMatchExpressionsWithDifferentNumbersOfElementsAreUnequal) {
BSONObj obj = BSON(""
<< "string");
InMatchExpression eq1("");
InMatchExpression eq2("");
std::vector<BSONElement> equalities{obj.firstElement()};
ASSERT_OK(eq1.setEqualities(std::move(equali... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 186,301,129,723,779,700,000,000,000,000,000,000,000 | 9 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
static int brotli_compress(struct transaction_t *txn,
unsigned flags, const char *buf, unsigned len)
{
/* Only flush for static content or on last (zero-length) chunk */
unsigned op = (flags & COMPRESS_END) ?
BROTLI_OPERATION_FINISH : BROTLI_OPERATION_FLUSH;
BrotliEncoderS... | 0 | [] | cyrus-imapd | 602f12ed2af0a49ac4a58affbfea57d0fc23dea5 | 323,627,357,665,221,150,000,000,000,000,000,000,000 | 34 | httpd.c: only allow reuse of auth creds on a persistent connection against a backend server in a Murder |
static UChar32 setMetaRoutine(UChar32 c) {
thisKeyMetaCtrl = META;
if (c == 0x1B) { // another ESC, stay in ESC processing mode
c = readUnicodeCharacter();
if (c == 0)
return 0;
return doDispatch(c, escDispatch);
}
return doDispatch(c, initialDispatch);
} | 0 | [
"CWE-200"
] | mongo | 035cf2afc04988b22cb67f4ebfd77e9b344cb6e0 | 97,728,421,638,047,240,000,000,000,000,000,000,000 | 10 | SERVER-25335 avoid group and other permissions when creating .dbshell history file |
fileblobGetFilename(const fileblob *fb)
{
return blobGetFilename(&(fb->b));
} | 0 | [
"CWE-476"
] | clamav-devel | 8bb3716be9c7ab7c6a3a1889267b1072f48af87b | 224,542,196,721,145,330,000,000,000,000,000,000,000 | 4 | fuzz-22348 null deref in egg utf8 conversion
Corrected memory leaks and a null dereference in the egg utf8 conversion. |
static void kvm_make_vcpu_request(struct kvm_vcpu *vcpu, unsigned int req,
struct cpumask *tmp, int current_cpu)
{
int cpu;
if (likely(!(req & KVM_REQUEST_NO_ACTION)))
__kvm_make_request(req, vcpu);
if (!(req & KVM_REQUEST_NO_WAKEUP) && kvm_vcpu_wake_up(vcpu))
return;
/*
* Note, the vCPU could get mi... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 221,775,144,640,453,520,000,000,000,000,000,000,000 | 27 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
static int namecmp(const char *name1, int len1, const char *name2, int len2)
{
int minlen;
int cmp;
minlen = len1;
if (minlen > len2)
minlen = len2;
cmp = memcmp(name1, name2, minlen);
if (cmp == 0)
cmp = len1 - len2;
return cmp;
} | 0 | [
"CWE-20",
"CWE-399"
] | linux | 93362fa47fe98b62e4a34ab408c4a418432e7939 | 22,172,487,436,542,820,000,000,000,000,000,000,000 | 14 | sysctl: Drop reference added by grab_header in proc_sys_readdir
Fixes CVE-2016-9191, proc_sys_readdir doesn't drop reference
added by grab_header when return from !dir_emit_dots path.
It can cause any path called unregister_sysctl_table will
wait forever.
The calltrace of CVE-2016-9191:
[ 5535.960522] Call Trace:
[ ... |
print_line_middle (const char *beg, const char *lim,
const char *line_color, const char *match_color)
{
size_t match_size;
size_t match_offset;
const char *cur = beg;
const char *mid = NULL;
while (cur < lim
&& ((match_offset = execute (beg, lim - beg, &match_size,
... | 0 | [
"CWE-189"
] | grep | 8fcf61523644df42e1905c81bed26838e0b04f91 | 117,140,549,401,607,910,000,000,000,000,000,000,000 | 61 | grep: fix integer-overflow issues in main program
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax.
Remove xstrtoumax.
* src/main.c: Include <inttypes.h>, for INTMAX_MAX, PRIdMAX.
(context_length_arg, prtext, grepbuf, grep, grepfile)
(get_nondigit_option, main):
Use intmax_t, not int,... |
static int mem_control_numa_stat_show(struct seq_file *m, void *arg)
{
int nid;
unsigned long total_nr, file_nr, anon_nr, unevictable_nr;
unsigned long node_nr;
struct cgroup *cont = m->private;
struct mem_cgroup *mem_cont = mem_cgroup_from_cont(cont);
total_nr = mem_cgroup_nr_lru_pages(mem_cont, LRU_ALL);
seq_... | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 136,866,445,791,744,480,000,000,000,000,000,000,000 | 44 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
find_first_finfo(proto_node *node, gpointer data)
{
field_info *fi = PNODE_FINFO(node);
if (fi && fi->hfinfo) {
if (fi->hfinfo->id == ((ffdata_t*)data)->id) {
g_ptr_array_add(((ffdata_t*)data)->array, fi);
/* Stop traversing. */
return TRUE;
}
}
/* Continue traversing. */
return FALSE;
} | 0 | [
"CWE-401"
] | wireshark | a9fc769d7bb4b491efb61c699d57c9f35269d871 | 57,782,219,335,688,420,000,000,000,000,000,000,000 | 15 | epan: Fix a memory leak.
Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032. |
void FreeElem(_cmsDICelem* e)
{
if (e ->Offsets != NULL) _cmsFree(e -> ContextID, e -> Offsets);
if (e ->Sizes != NULL) _cmsFree(e -> ContextID, e -> Sizes);
e->Offsets = e ->Sizes = NULL;
} | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 331,342,945,434,611,020,000,000,000,000,000,000,000 | 6 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
MagickPrivate void XCheckRefreshWindows(Display *display,XWindows *windows)
{
Window
id;
XEvent
event;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(display != (Display *) NULL);
assert(windows != (XWindows *) NULL);
XDelay(display,SuspendTime);
id=windows->command.id;
whil... | 0 | [] | ImageMagick | f391a5f4554fe47eb56d6277ac32d1f698572f0e | 240,974,811,116,511,050,000,000,000,000,000,000,000 | 26 | https://github.com/ImageMagick/ImageMagick/issues/1531 |
static void vnc_zrle_stop(VncState *vs)
{
/* switch back to normal output/zlib buffers */
vs->zrle.zrle = vs->output;
vs->output = vs->zrle.tmp;
} | 1 | [
"CWE-401"
] | qemu | 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 | 204,503,965,545,848,560,000,000,000,000,000,000,000 | 6 | vnc: fix memory leak when vnc disconnect
Currently when qemu receives a vnc connect, it creates a 'VncState' to
represent this connection. In 'vnc_worker_thread_loop' it creates a
local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
... |
static gboolean npidentifier_cache_find_info(gpointer key, gpointer value, gpointer user_data)
{
NPIdentifier *ident = (NPIdentifier)key;
NPIdentifierInfo *npi = (NPIdentifierInfo *)value;
NPIdentifierFindArgs *args = (NPIdentifierFindArgs *)user_data;
#if !defined(HAVE_G_HASH_TABLE_FIND) || defined(BUILD_GENERIC... | 0 | [
"CWE-264"
] | nspluginwrapper | 7e4ab8e1189846041f955e6c83f72bc1624e7a98 | 209,411,135,060,444,500,000,000,000,000,000,000,000 | 25 | Support all the new variables added |
struct mszip_stream *mszip_init(int fd,
int ofd,
int input_buffer_size,
int repair_mode,
struct cab_file *file,
int (*read_cb)(struct cab_file *, unsigned char *, int))
{
struct mszip_stream *zip;
input_buffer_size = (input_buffer_size + 1) & -2;
if (!input_buffer_size) retur... | 0 | [] | clamav-devel | 158c35e81a25ea5fda55a2a7f62ea9fec2e883d9 | 115,801,004,791,855,760,000,000,000,000,000,000,000 | 43 | libclamav/mspack.c: improve unpacking of malformed cabinets (bb#1826) |
void SplashOutputDev::setSoftMaskFromImageMask(GfxState *state,
Object *ref, Stream *str,
int width, int height,
bool invert,
bool inlineImg, double *baseMatrix) {
const double *ctm;
SplashCoord mat[6];
SplashOutImageMaskData imgMaskData;
Splash *maskSplash;
Spl... | 0 | [
"CWE-369"
] | poppler | b224e2f5739fe61de9fa69955d016725b2a4b78d | 148,313,393,164,305,760,000,000,000,000,000,000,000 | 50 | SplashOutputDev::tilingPatternFill: Fix crash on broken file
Issue #802 |
dissect_usb_video_streaming_interface_descriptor(proto_tree *parent_tree, tvbuff_t *tvb,
guint8 descriptor_len)
{
proto_tree *tree;
int offset = 0;
const gchar *subtype_str;
guint8 subtype;
subtype = tvb_get_guint8(tvb, offset+2);
... | 0 | [
"CWE-476"
] | wireshark | 2cb5985bf47bdc8bea78d28483ed224abdd33dc6 | 55,325,982,056,506,650,000,000,000,000,000,000,000 | 54 | Make class "type" for USB conversations.
USB dissectors can't assume that only their class type has been passed around in the conversation. Make explicit check that class type expected matches the dissector and stop/prevent dissection if there isn't a match.
Bug: 12356
Change-Id: Ib23973a4ebd0fbb51952ffc118daf95e338... |
static inline int als_weighting(GetBitContext *gb, int k, int off)
{
int idx = av_clip(decode_rice(gb, k) + off,
0, FF_ARRAY_ELEMS(mcc_weightings) - 1);
return mcc_weightings[idx];
} | 0 | [
"CWE-787"
] | FFmpeg | 18f94df8af04f2c02a25a7dec512289feff6517f | 9,088,134,385,328,268,000,000,000,000,000,000,000 | 6 | avcodec/alsdec: check predictor order against block length
Fixes out of array access
Fixes: abd3c041acbcb816be113455d138166b-asan_heap-oob_b11634_3707_cov_1707137151_als_05_2ch48k16b.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
regset_search_body_position_lead(OnigRegSet* set,
const UChar* str, const UChar* end,
const UChar* start, const UChar* range, /* match start range */
const UChar* orig_range, /* data range */
OnigOptionType option, MatchArg* msas, int* rmatch_pos)
{
int r, n, i;
UChar *s,... | 1 | [
"CWE-125"
] | oniguruma | 0463e21432515631a9bc925ce5eb95b097c73719 | 259,296,365,263,102,500,000,000,000,000,000,000,000 | 160 | fix #164: Integer overflow related to reg->dmax in search_in_range() |
static int udf_parse_options(char *options, struct udf_options *uopt,
bool remount)
{
char *p;
int option;
uopt->novrs = 0;
uopt->partition = 0xFFFF;
uopt->session = 0xFFFFFFFF;
uopt->lastblock = 0;
uopt->anchor = 0;
uopt->volume = 0xFFFFFFFF;
uopt->rootdir = 0xFFFFFFFF;
uopt->fileset = 0xFFFFFFFF;
... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 1df2ae31c724e57be9d7ac00d78db8a5dabdd050 | 167,775,118,517,561,340,000,000,000,000,000,000,000 | 151 | udf: Fortify loading of sparing table
Add sanity checks when loading sparing table from disk to avoid accessing
unallocated memory or writing to it.
Signed-off-by: Jan Kara <jack@suse.cz> |
static void do_pcd_read_drq(void)
{
unsigned long saved_flags;
if (pcd_completion(pcd_current, pcd_buffer, "read block")) {
if (pcd_retries < PCD_RETRIES) {
mdelay(1);
pcd_retries++;
pi_do_claimed(pcd_current->pi, pcd_start);
return;
}
pcd_bufblk = -1;
next_request(BLK_STS_IOERR);
return;
}
... | 0 | [
"CWE-476"
] | linux | f0d1762554014ce0ae347b9f0d088f2c157c8c72 | 29,979,975,894,198,660,000,000,000,000,000,000,000 | 21 | paride/pcd: Fix potential NULL pointer dereference and mem leak
Syzkaller report this:
pcd: pcd version 1.07, major 46, nice 0
pcd0: Autoprobe failed
pcd: No CD-ROM drive found
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP... |
static void bump_cpu_timer(struct k_itimer *timer, u64 now)
{
int i;
u64 delta, incr;
if (timer->it.cpu.incr == 0)
return;
if (now < timer->it.cpu.expires)
return;
incr = timer->it.cpu.incr;
delta = now + incr - timer->it.cpu.expires;
/* Don't use (incr*2 < delta), incr*2 might overflow. */
for (i = 0; ... | 1 | [
"CWE-190"
] | linux | 78c9c4dfbf8c04883941445a195276bb4bb92c76 | 65,936,965,707,919,500,000,000,000,000,000,000,000 | 27 | posix-timers: Sanitize overrun handling
The posix timer overrun handling is broken because the forwarding functions
can return a huge number of overruns which does not fit in an int. As a
consequence timer_getoverrun(2) and siginfo::si_overrun can turn into
random number generators.
The k_clock::timer_forward() callb... |
static int Adapter_process_file_wrapper(AdapterObject *self)
{
int done = 0;
#ifndef WIN32
#if AP_SERVER_MAJORVERSION_NUMBER >= 2
PyObject *filelike = NULL;
PyObject *method = NULL;
PyObject *object = NULL;
apr_status_t rv = 0;
apr_os_file_t fd = -1;
apr_file_t *tmpfile = NULL;
apr_f... | 0 | [
"CWE-264"
] | mod_wsgi | d9d5fea585b23991f76532a9b07de7fcd3b649f4 | 241,071,486,161,204,100,000,000,000,000,000,000,000 | 205 | Local privilege escalation when using daemon mode. (CVE-2014-0240) |
int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
{
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
int err= 0;
char buff[STRING_BUFFER_USUAL_SIZE];
String tmpstr(buff,sizeof(buff), &my_charset_bin);
/* Convert character set if necessary */
if (String::needs_conversion_on_storage(length, cs,... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 180,917,812,564,496,900,000,000,000,000,000,000,000 | 40 | 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... |
float caca_get_dither_brightness(caca_dither_t const *d)
{
return d->brightness;
} | 0 | [
"CWE-369"
] | libcaca | 84bd155087b93ab2d8d7cb5b1ac94ecd4cf4f93c | 300,183,057,534,044,960,000,000,000,000,000,000,000 | 4 | dither: fix integer overflows that were causing a division by zero.
Fixes: #36 (CVE-2018-20544) |
static void init_vmcs_shadow_fields(void)
{
int i, j;
/* No checks for read only fields yet */
for (i = j = 0; i < max_shadow_read_write_fields; i++) {
switch (shadow_read_write_fields[i]) {
case GUEST_BNDCFGS:
if (!kvm_mpx_supported())
continue;
break;
default:
break;
}
if (j < i)
shado... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 3ce424e45411cf5a13105e0386b6ecf6eeb4f66f | 233,028,565,614,560,770,000,000,000,000,000,000,000 | 34 | kvm:vmx: more complete state update on APICv on/off
The function to update APICv on/off state (in particular, to deactivate
it when enabling Hyper-V SynIC) is incomplete: it doesn't adjust
APICv-related fields among secondary processor-based VM-execution
controls. As a result, Windows 2012 guests get stuck when SynIC... |
static void virtio_device_realize(DeviceState *dev, Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(dev);
Error *err = NULL;
if (vdc->realize != NULL) {
vdc->realize(dev, &err);
if (err != NULL) {
error_propagate(errp... | 0 | [
"CWE-94"
] | qemu | cc45995294b92d95319b4782750a3580cabdbc0c | 200,045,493,435,154,920,000,000,000,000,000,000,000 | 15 | virtio: out-of-bounds buffer write on invalid state load
CVE-2013-4151 QEMU 1.0 out-of-bounds buffer write in
virtio_load@hw/virtio/virtio.c
So we have this code since way back when:
num = qemu_get_be32(f);
for (i = 0; i < num; i++) {
vdev->vq[i].vring.num = qemu_get_be32(f);
array of vqs has size ... |
static int io_sq_offload_start(struct io_ring_ctx *ctx,
struct io_uring_params *p)
{
int ret;
mmgrab(current->mm);
ctx->sqo_mm = current->mm;
if (ctx->flags & IORING_SETUP_SQPOLL) {
ret = -EPERM;
if (!capable(CAP_SYS_ADMIN))
goto err;
ctx->sq_thread_idle = msecs_to_jiffies(p->sq_thread_idle);
... | 0 | [
"CWE-416"
] | linux | 6d816e088c359866f9867057e04f244c608c42fe | 129,012,252,525,103,380,000,000,000,000,000,000,000 | 58 | io_uring: hold 'ctx' reference around task_work queue + execute
We're holding the request reference, but we need to go one higher
to ensure that the ctx remains valid after the request has finished.
If the ring is closed with pending task_work inflight, and the
given io_kiocb finishes sync during issue, then we need a... |
inline T at(int offset) const { return buffer_[offset]; } | 0 | [] | envoy | 3b5acb2f43548862dadb243de7cf3994986a8e04 | 98,891,891,458,237,540,000,000,000,000,000,000,000 | 1 | http, url: Bring back chromium_url and http_parser_parse_url (#198)
* Revert GURL as HTTP URL parser utility
This reverts:
1. commit c9c4709c844b90b9bb2935d784a428d667c9df7d
2. commit d828958b591a6d79f4b5fa608ece9962b7afbe32
3. commit 2d69e30c51f2418faf267aaa6c1126fce9948c62
Signed-off-by: Dhi Aurrahman <dio@tetrat... |
int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
{
struct fib6_node *fn, *pn = NULL;
int err = -ENOMEM;
int allow_create = 1;
int replace_required = 0;
if (info->nlh) {
if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
allow_create = 0;
if (info->nlh->nlmsg_flags & NLM_F_REPLACE)... | 0 | [
"CWE-399"
] | linux | 307f2fb95e9b96b3577916e73d92e104f8f26494 | 113,119,013,797,964,500,000,000,000,000,000,000,000 | 138 | ipv6: only static routes qualify for equal cost multipathing
Static routes in this case are non-expiring routes which did not get
configured by autoconf or by icmpv6 redirects.
To make sure we actually get an ecmp route while searching for the first
one in this fib6_node's leafs, also make sure it matches the ecmp ro... |
static void create_worker_cb(struct callback_head *cb)
{
struct io_worker *worker;
struct io_wq *wq;
struct io_wqe *wqe;
struct io_wqe_acct *acct;
bool do_create = false;
worker = container_of(cb, struct io_worker, create_work);
wqe = worker->wqe;
wq = wqe->wq;
acct = &wqe->acct[worker->create_index];
raw_sp... | 0 | [
"CWE-200"
] | linux | 713b9825a4c47897f66ad69409581e7734a8728e | 306,281,319,926,674,930,000,000,000,000,000,000,000 | 27 | io-wq: fix cancellation on create-worker failure
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1151 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151 req_ref_put_and_test
fs/io_uring.c:1146 [inline]
WARNING: CPU: 0 PID: 10392 at fs/io_uring.c:1151
io_req_complete_post+0xf5... |
try_mount_one (const char *spec0, const char *node0, const char *types0,
const char *opts0, int freq, int pass, int ro) {
int res = 0, status = 0, special = 0;
int mnt5_res = 0; /* only for gcc */
int mnt_err;
int flags;
char *extra_opts; /* written in mtab */
char *mount_opts; /* actually used o... | 0 | [
"CWE-399"
] | util-linux | 4b39b6aefd5dd8ac68a92adc650dc13d5d54d704 | 338,900,779,467,073,770,000,000,000,000,000,000,000 | 412 | mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)
http://thread.gmane.org/gmane.comp.security.oss.general/4374
Changes:
- force mount(8) to use /etc/mtab.tmp file every time. The original
code used the tmp file for remount/move operations only.
- call and check fflush() return code for... |
static int cap_shm_associate(struct shmid_kernel *shp, int shmflg)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 326,482,513,800,549,000,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static inline short key_read_state(const struct key *key)
{
/* Barrier versus mark_key_instantiated(). */
return smp_load_acquire(&key->state);
} | 0 | [
"CWE-20"
] | linux | 363b02dab09b3226f3bd1420dad9c72b79a42a76 | 15,345,252,909,973,216,000,000,000,000,000,000,000 | 5 | KEYS: Fix race between updating and finding a negative key
Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the rejection
error into one field such that:
(1) The instantiation state can be modified/read atomically.
(2) The error can be accessed atomically with the state.
(3) The error isn't stored unione... |
int vhost_log_access_ok(struct vhost_dev *dev)
{
return memory_access_ok(dev, dev->memory, 1);
} | 0 | [
"CWE-399"
] | linux | 7932c0bd7740f4cd2aa168d3ce0199e7af7d72d5 | 72,947,760,794,834,550,000,000,000,000,000,000,000 | 4 | vhost: actually track log eventfd file
While reviewing vhost log code, I found out that log_file is never
set. Note: I haven't tested the change (QEMU doesn't use LOG_FD yet).
Cc: stable@vger.kernel.org
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> |
struct tty_struct *alloc_tty_struct(void)
{
return kzalloc(sizeof(struct tty_struct), GFP_KERNEL);
} | 0 | [
"CWE-703"
] | linux | c290f8358acaeffd8e0c551ddcc24d1206143376 | 40,825,620,438,612,180,000,000,000,000,000,000,000 | 4 | TTY: drop driver reference in tty_open fail path
When tty_driver_lookup_tty fails in tty_open, we forget to drop a
reference to the tty driver. This was added by commit 4a2b5fddd5 (Move
tty lookup/reopen to caller).
Fix that by adding tty_driver_kref_put to the fail path.
I will refactor the code later. This is for ... |
static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
{
__u32 data;
int ret;
data = item_udata(item);
switch (item->tag) {
case HID_MAIN_ITEM_TAG_BEGIN_COLLECTION:
ret = open_collection(parser, data & 0xff);
break;
case HID_MAIN_ITEM_TAG_END_COLLECTION:
ret = close_collection(parser... | 0 | [
"CWE-125"
] | linux | 50220dead1650609206efe91f0cc116132d59b3f | 276,376,248,306,955,460,000,000,000,000,000,000,000 | 32 | HID: core: prevent out-of-bound readings
Plugging a Logitech DJ receiver with KASAN activated raises a bunch of
out-of-bound readings.
The fields are allocated up to MAX_USAGE, meaning that potentially, we do
not have enough fields to fit the incoming values.
Add checks and silence KASAN.
Signed-off-by: Benjamin Tis... |
static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){
int nLoop = 0;
assert( pTerm!=0 );
while( (pTerm->wtFlags & TERM_CODED)==0
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin))
&& (pLevel->notReady & pTerm->prereqAll)==0
){
if( nLoop && (pTerm->wtFlags & TERM_LIK... | 0 | [
"CWE-476"
] | sqlite | 57f7ece78410a8aae86aa4625fb7556897db384c | 51,146,975,675,151,540,000,000,000,000,000,000,000 | 20 | Fix a problem that comes up when using generated columns that evaluate to a
constant in an index and then making use of that index in a join.
FossilOrigin-Name: 8b12e95fec7ce6e0de82a04ca3dfcf1a8e62e233b7382aa28a8a9be6e862b1af |
int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
BIGNUM *b, BN_CTX *ctx)
{
if (group->meth->group_get_curve == 0) {
ECerr(EC_F_EC_GROUP_GET_CURVE_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
return group->meth->group_get_curve(group, ... | 0 | [] | openssl | 21c856b75d81eff61aa63b4f036bb64a85bf6d46 | 285,566,757,717,996,640,000,000,000,000,000,000,000 | 9 | [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it
The cofactor argument to EC_GROUP_set_generator is optional, and SCA
mitigations for ECC currently use it. So the library currently falls
back to very old SCA-vulnerable code if the cofactor is not present.
This PR allows EC_GROUP_set_generator to ... |
static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
{
#ifdef CONFIG_X86_64
unsigned long a;
#endif
int i;
/* I/O */
vmcs_write64(IO_BITMAP_A, __pa(vmx_io_bitmap_a));
vmcs_write64(IO_BITMAP_B, __pa(vmx_io_bitmap_b));
if (enable_shadow_vmcs) {
vmcs_write64(VMREAD_BITMAP, __pa(vmx_vmread_bitmap));
vmcs_write64(VMW... | 0 | [
"CWE-20",
"CWE-617"
] | linux | 3a8b0677fc6180a467e26cc32ce6b0c09a32f9bb | 266,846,356,305,461,730,000,000,000,000,000,000,000 | 116 | KVM: VMX: Do not BUG() on out-of-bounds guest IRQ
The value of the guest_irq argument to vmx_update_pi_irte() is
ultimately coming from a KVM_IRQFD API call. Do not BUG() in
vmx_update_pi_irte() if the value is out-of bounds. (Especially,
since KVM as a whole seems to hang after that.)
Instead, print a message only o... |
Header::view()
{
return typedAttribute <StringAttribute> ("view").value();
} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 259,707,508,548,261,240,000,000,000,000,000,000,000 | 4 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
PHPAPI int php_swoole_unserialize(void *buffer, size_t len, zval *return_value, zval *object_args, long flag)
{
SBucketType type = *(SBucketType*) (buffer);
zend_uchar real_type = type.data_type;
buffer += sizeof (SBucketType);
switch (real_type)
{
case IS_NULL:
case IS_TRUE:
... | 1 | [
"CWE-200",
"CWE-502"
] | swoole-src | 4cdbce5d9bf2fe596bb6acd7d6611f9e8c253a76 | 302,526,459,005,259,270,000,000,000,000,000,000,000 | 60 | add buffer end check |
snmp_clone_pdu(netsnmp_pdu *pdu)
{
return _clone_pdu(pdu, 0); /* copies all variables */
} | 0 | [
"CWE-415"
] | net-snmp | 5f881d3bf24599b90d67a45cae7a3eb099cd71c9 | 290,884,447,518,749,770,000,000,000,000,000,000,000 | 4 | libsnmp, USM: Introduce a reference count in struct usmStateReference
This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/. |
string_slice(register PyStringObject *a, register Py_ssize_t i,
register Py_ssize_t j)
/* j -- may be negative! */
{
if (i < 0)
i = 0;
if (j < 0)
j = 0; /* Avoid signed/unsigned bug in next line */
if (j > Py_SIZE(a))
j = Py_SIZE(a);
if (i == 0 && j == Py_SIZE(a... | 0 | [
"CWE-190"
] | cpython | c3c9db89273fabc62ea1b48389d9a3000c1c03ae | 227,711,353,912,843,530,000,000,000,000,000,000,000 | 19 | [2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174) |
static RzList *parse_format(RzCore *core, char *fmt) {
if (!fmt || !*fmt) {
return NULL;
}
RzList *ret = rz_list_new();
if (!ret) {
return NULL;
}
Sdb *s = core->analysis->sdb_fmts;
const char *spec = rz_config_get(core->config, "analysis.types.spec");
char arr[10] = { 0 };
char *ptr = strchr(fmt, '%');
f... | 0 | [
"CWE-703"
] | rizin | 6ce71d8aa3dafe3cdb52d5d72ae8f4b95916f939 | 309,358,098,595,317,950,000,000,000,000,000,000,000 | 34 | 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... |
static OPJ_BOOL opj_j2k_write_sot(opj_j2k_t *p_j2k,
OPJ_BYTE * p_data,
OPJ_UINT32 p_total_data_size,
OPJ_UINT32 * p_data_written,
const opj_stream_private_t *p_stream,
... | 1 | [
"CWE-416",
"CWE-787"
] | openjpeg | c535531f03369623b9b833ef41952c62257b507e | 17,851,794,071,531,851,000,000,000,000,000,000,000 | 60 | opj_t2_encode_packet(): fix potential write heap buffer overflow (#992) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.