func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static int ia5ncasecmp(const char *s1, const char *s2, size_t n)
{
for (; n > 0; n--, s1++, s2++) {
if (*s1 != *s2) {
unsigned char c1 = (unsigned char)*s1, c2 = (unsigned char)*s2;
/* Convert to lower case */
if (c1 >= 0x41 /* A */ && c1 <= 0x5A /* Z */)
... | 0 | [
"CWE-125"
] | openssl | 8393de42498f8be75cf0353f5c9f906a43a748d2 | 143,308,106,874,266,500,000,000,000,000,000,000,000 | 25 | Fix the name constraints code to not assume NUL terminated strings
ASN.1 strings may not be NUL terminated. Don't assume they are.
CVE-2021-3712
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org> |
vhost_user_set_vring_call(struct virtio_net **pdev, struct VhostUserMsg *msg,
int main_fd __rte_unused)
{
struct virtio_net *dev = *pdev;
struct vhost_vring_file file;
struct vhost_virtqueue *vq;
int expected_fds;
expected_fds = (msg->payload.u64 & VHOST_USER_VRING_NOFD_MASK) ? 0 : 1;
if (validate_msg_fds(msg... | 0 | [
"CWE-190"
] | dpdk | 3ae4beb079ce242240c34376a066bbccd0c0b23e | 77,891,184,574,963,250,000,000,000,000,000,000,000 | 28 | vhost: check log mmap offset and size overflow
vhost_user_set_log_base() is a message handler that is
called to handle the VHOST_USER_SET_LOG_BASE message.
Its payload contains a 64 bit size and offset. Both are
added up and used as a size when calling mmap().
There is no integer overflow check. If an integer overflo... |
checkDataDir(void)
{
char path[MAXPGPATH];
FILE *fp;
struct stat stat_buf;
Assert(DataDir);
if (stat(DataDir, &stat_buf) != 0)
{
if (errno == ENOENT)
ereport(FATAL,
(errcode_for_file_access(),
errmsg("data directory \"%s\" does not exist",
DataDir)));
else
ereport(FATAL,
(er... | 0 | [
"CWE-89"
] | postgres | 2b3a8b20c2da9f39ffecae25ab7c66974fbc0d3b | 238,318,448,793,202,560,000,000,000,000,000,000,000 | 85 | 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... |
LineBufferTask::execute ()
{
try
{
//
// Uncompress the data, if necessary
//
if (_lineBuffer->uncompressedData == 0)
{
Int64 uncompressedSize = 0;
int maxY = min (_lineBuffer->maxY, _ifd->maxY);
for (int i = _lineBuffer->minY - _ifd-... | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 137,941,518,710,641,000,000,000,000,000,000,000,000 | 168 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
void ElectronBrowserClient::
RegisterAssociatedInterfaceBindersForRenderFrameHost(
content::RenderFrameHost&
render_frame_host, // NOLINT(runtime/references)
blink::AssociatedInterfaceRegistry&
associated_registry) { // NOLINT(runtime/references)
associated_registry.AddIn... | 1 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 214,246,264,989,477,720,000,000,000,000,000,000,000 | 52 | 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
... |
static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
{
/*
we don't want to hold the LOCK_plugin mutex as it may cause
deinitialization to deadlock if plugins have worker threads
with plugin locks
*/
mysql_mutex_assert_not_owner(&LOCK_plugin);
if (plugin->plugin->status_vars... | 0 | [
"CWE-416"
] | server | c05fd700970ad45735caed3a6f9930d4ce19a3bd | 323,336,674,800,041,130,000,000,000,000,000,000,000 | 52 | MDEV-26323 use-after-poison issue of MariaDB server |
static void rbd_obj_copyup_object_maps(struct rbd_obj_request *obj_req)
{
struct rbd_device *rbd_dev = obj_req->img_request->rbd_dev;
struct ceph_snap_context *snapc = obj_req->img_request->snapc;
u8 new_state;
u32 i;
int ret;
rbd_assert(!obj_req->pending.result && !obj_req->pending.num_pending);
if (!(rbd_dev... | 0 | [
"CWE-863"
] | linux | f44d04e696feaf13d192d942c4f14ad2e117065a | 207,748,680,626,897,140,000,000,000,000,000,000,000 | 34 | rbd: require global CAP_SYS_ADMIN for mapping and unmapping
It turns out that currently we rely only on sysfs attribute
permissions:
$ ll /sys/bus/rbd/{add*,remove*}
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add_single_major
--w------- 1 ro... |
GArray* reds_get_renderers(RedsState *reds)
{
return reds->config->renderers;
} | 0 | [] | spice | ca5bbc5692e052159bce1a75f55dc60b36078749 | 223,798,110,496,954,430,000,000,000,000,000,000,000 | 4 | With OpenSSL 1.1: Disable client-initiated renegotiation.
Fixes issue #49
Fixes BZ#1904459
Signed-off-by: Julien Ropé <jrope@redhat.com>
Reported-by: BlackKD
Acked-by: Frediano Ziglio <fziglio@redhat.com> |
grub_ext2_mount (grub_disk_t disk)
{
struct grub_ext2_data *data;
data = grub_malloc (sizeof (struct grub_ext2_data));
if (!data)
return 0;
/* Read the superblock. */
grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_ext2_sblock),
&data->sblock);
if (grub_errno)
goto fail;
... | 0 | [
"CWE-703",
"CWE-787"
] | radare2 | 796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191 | 207,788,827,447,923,520,000,000,000,000,000,000,000 | 51 | Fix ext2 buffer overflow in r2_sbu_grub_memmove |
static int f2fs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
struct inode *inode = mapping->host;
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
struct page *page = NULL;
pgoff_t index = ((unsigned long long) pos) >> ... | 0 | [
"CWE-476"
] | linux | 4969c06a0d83c9c3dc50b8efcdc8eeedfce896f6 | 273,238,968,170,150,800,000,000,000,000,000,000,000 | 109 | f2fs: support swap file w/ DIO
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
TfLiteStatus EvalImpl(TfLiteContext* context, bool requires_broadcast,
const TfLiteTensor* input1, const TfLiteTensor* input2,
TfLiteTensor* output) {
const T* denominator_data = GetTensorData<T>(input2);
if (input2->type == kTfLiteInt32 || input2->type == kTfLiteInt64) ... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 132,835,550,005,973,800,000,000,000,000,000,000,000 | 30 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
static int fit_image_check_hash(const void *fit, int noffset, const void *data,
size_t size, char **err_msgp)
{
uint8_t value[FIT_MAX_HASH_LEN];
int value_len;
char *algo;
uint8_t *fit_value;
int fit_value_len;
int ignore;
*err_msgp = NULL;
if (fit_image_hash_get_algo(fit, noffset, &algo)) {
*err_msgp =... | 0 | [] | u-boot | 6f3c2d8aa5e6cbd80b5e869bbbddecb66c329d01 | 19,715,089,120,160,432,000,000,000,000,000,000,000 | 47 | image: Add an option to do a full check of the FIT
Some strange modifications of the FIT can introduce security risks. Add an
option to check it thoroughly, using libfdt's fdt_check_full() function.
Enable this by default if signature verification is enabled.
CVE-2021-27097
Signed-off-by: Simon Glass <sjg@chromium.... |
void Item_func_not::print(String *str, enum_query_type query_type)
{
str->append('!');
args[0]->print_parenthesised(str, query_type, precedence());
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 267,372,494,028,113,950,000,000,000,000,000,000,000 | 5 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
DEFUN (neighbor_advertise_interval,
neighbor_advertise_interval_cmd,
NEIGHBOR_CMD "advertisement-interval <0-600>",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR
"Minimum interval between sending BGP routing updates\n"
"time in seconds\n")
{
return peer_advertise_interval_vty (vty, argv[0],... | 0 | [
"CWE-125"
] | frr | 6d58272b4cf96f0daa846210dd2104877900f921 | 223,779,812,216,304,860,000,000,000,000,000,000,000 | 10 | [bgpd] cleanup, compact and consolidate capability parsing code
2007-07-26 Paul Jakma <paul.jakma@sun.com>
* (general) Clean up and compact capability parsing slightly.
Consolidate validation of length and logging of generic TLV, and
memcpy of capability data, thus removing such from cap specifc
code (not a... |
nv_lineop(cmdarg_T *cap)
{
cap->oap->motion_type = MLINE;
if (cursor_down(cap->count1 - 1L, cap->oap->op_type == OP_NOP) == FAIL)
clearopbeep(cap->oap);
else if ( (cap->oap->op_type == OP_DELETE // only with linewise motions
&& cap->oap->motion_force != 'v'
&& cap->oap->motion_force != Ctrl_V)
||... | 0 | [
"CWE-416"
] | vim | 35a9a00afcb20897d462a766793ff45534810dc3 | 114,606,976,821,897,190,000,000,000,000,000,000,000 | 14 | patch 8.2.3428: using freed memory when replacing
Problem: Using freed memory when replacing. (Dhiraj Mishra)
Solution: Get the line pointer after calling ins_copychar(). |
static inline struct mount *first_slave(struct mount *p)
{
return list_entry(p->mnt_slave_list.next, struct mount, mnt_slave);
} | 0 | [
"CWE-703"
] | linux | 5ec0811d30378ae104f250bfc9b3640242d81e3f | 116,404,560,331,542,300,000,000,000,000,000,000,000 | 4 | propogate_mnt: Handle the first propogated copy being a slave
When the first propgated copy was a slave the following oops would result:
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
> IP: [<ffffffff811fba4e>] propagate_one+0xbe/0x1c0
> PGD bacd4067 PUD bac66067 PMD 0
> Oops: 0000 [#1] SM... |
static int prefix_slot(int prefix)
{
switch (prefix) {
case P_WAIT:
return PPS_WAIT;
case R_CS:
case R_DS:
case R_SS:
case R_ES:
case R_FS:
case R_GS:
return PPS_SEG;
case P_LOCK:
return PPS_LOCK;
case P_REP:
case P_REPE:
case P_REPZ:
case P_RE... | 0 | [
"CWE-416"
] | nasm | 6ac6ac57e3d01ea8ed4ea47706eb724b59176461 | 303,960,128,410,157,840,000,000,000,000,000,000,000 | 43 | parser: when flattening an eop, must preserve any data buffer
An eop may have a data buffer associated with it as part of the same
memory allocation. Therefore, we need to move "subexpr" up instead of
merging it into "eop".
This *partially* resolves BR 3392707, but that test case still
triggers a violation when using... |
wkbTypeMap(wkbObj *w, int type)
{
if ( type < WKB_TYPE_COUNT )
return w->typemap[type];
else
return 0;
} | 0 | [
"CWE-89"
] | mapserver | 3a10f6b829297dae63492a8c63385044bc6953ed | 280,971,354,525,262,340,000,000,000,000,000,000,000 | 7 | Fix potential SQL Injection with postgis TIME filters (#4834) |
QUtil::int_to_string_base(long long num, int base, int length)
{
return int_to_string_base_internal(num, base, length);
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 250,625,586,084,225,950,000,000,000,000,000,000,000 | 4 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closeargs *args)
{
struct xdr_stream xdr;
struct compound_hdr hdr = {
.nops = 3,
};
int status;
xdr_init_encode(&xdr, &req->rq_snd_buf, p);
encode_compound_hdr(&xdr, &hdr);
... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 20,456,473,354,470,840,000,000,000,000,000,000,000 | 20 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
psutil_proc_open_files(PyObject *self, PyObject *args) {
long pid;
HANDLE processHandle;
DWORD access = PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION;
PyObject *py_retlist;
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
processHandle = psutil_handle_from_pid(pid... | 0 | [
"CWE-415"
] | psutil | 7d512c8e4442a896d56505be3e78f1156f443465 | 282,355,051,374,878,650,000,000,000,000,000,000,000 | 23 | Use Py_CLEAR instead of Py_DECREF to also set the variable to NULL (#1616)
These files contain loops that convert system data into python objects
and during the process they create objects and dereference their
refcounts after they have been added to the resulting list.
However, in case of errors during the creat... |
static struct sock *sco_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio, int kern)
{
struct sock *sk;
sk = sk_alloc(net, PF_BLUETOOTH, prio, &sco_proto, kern);
if (!sk)
return NULL;
sock_init_data(sock, sk);
INIT_LIST_HEAD(&bt_sk(sk)->accept_q);
sk->sk_destruct = sco_sock_destru... | 0 | [
"CWE-416"
] | linux | 0771cbb3b97d3c1d68eecd7f00055f599954c34e | 332,900,737,070,920,250,000,000,000,000,000,000,000 | 29 | Bluetooth: SCO: Replace use of memcpy_from_msg with bt_skb_sendmsg
This makes use of bt_skb_sendmsg instead of allocating a different
buffer to be used with memcpy_from_msg which cause one extra copy.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
int crypt_volume_key_keyring(struct crypt_device *cd __attribute__((unused)), int enable)
{
_vk_via_keyring = enable ? 1 : 0;
return 0;
} | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 261,041,674,395,904,460,000,000,000,000,000,000,000 | 5 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
static void DestroyCubeInfo(CubeInfo *cube_info)
{
register Nodes
*nodes;
/*
Release color cube tree storage.
*/
do
{
nodes=cube_info->node_queue->next;
cube_info->node_queue->nodes=(NodeInfo *) RelinquishMagickMemory(
cube_info->node_queue->nodes);
cube_info->node_queue=(Nodes *) R... | 0 | [
"CWE-125"
] | ImageMagick | 5294966898532a6bd54699fbf04edf18902513ac | 111,550,536,902,947,200,000,000,000,000,000,000,000 | 22 | https://github.com/ImageMagick/ImageMagick/issues/1156 |
static inline PixelTrait GetPixelCrTraits(const Image *magick_restrict image)
{
return(image->channel_map[CrPixelChannel].traits);
} | 0 | [
"CWE-20",
"CWE-125"
] | ImageMagick | 8187d2d8fd010d2d6b1a3a8edd935beec404dddc | 188,533,525,419,484,230,000,000,000,000,000,000,000 | 4 | https://github.com/ImageMagick/ImageMagick/issues/1610 |
static int tcp_ack_update_window(struct sock *sk, const struct sk_buff *skb, u32 ack,
u32 ack_seq)
{
struct tcp_sock *tp = tcp_sk(sk);
int flag = 0;
u32 nwin = ntohs(tcp_hdr(skb)->window);
if (likely(!tcp_hdr(skb)->syn))
nwin <<= tp->rx_opt.snd_wscale;
if (tcp_may_update_window(tp, ack, ack_seq, nwin)) {
... | 0 | [
"CWE-190"
] | net | 3b4929f65b0d8249f19a50245cd88ed1a2f78cff | 242,817,374,534,743,870,000,000,000,000,000,000,000 | 37 | tcp: limit payload size of sacked skbs
Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :
BUG_ON(tcp_skb_pcount(skb) < pcount);
This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48
An skb can hold 17 fragments, and each fragment can ho... |
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define ThrowDCMException(exception,message) \
{ \
RelinquishDCMMemory(&info,&map,stream_info,stack,data); \
if (info_copy != (DCMInfo *) NULL) \
info_copy=(DCMInfo *) RelinquishDCMInfo(info_copy); \
ThrowReaderException((excep... | 1 | [
"CWE-416"
] | ImageMagick | 8043433ba9ce0c550e09f2b3b6a3f5f62d802e6d | 48,091,781,169,139,670,000,000,000,000,000,000,000 | 1,309 | Coders: https://github.com/ImageMagick/ImageMagick/issues/4947 |
static int do_subdinfo_ioctl(struct comedi_device *dev,
struct comedi_subdinfo __user *arg, void *file)
{
int ret, i;
struct comedi_subdinfo *tmp, *us;
struct comedi_subdevice *s;
tmp =
kcalloc(dev->n_subdevices, sizeof(struct comedi_subdinfo),
GFP_KERNEL);
if (!tmp)
return -ENOMEM;
/* fill... | 0 | [
"CWE-200"
] | linux | 819cbb120eaec7e014e5abd029260db1ca8c5735 | 98,181,196,793,491,460,000,000,000,000,000,000,000 | 67 | staging: comedi: fix infoleak to userspace
driver_name and board_name are pointers to strings, not buffers of size
COMEDI_NAMELEN. Copying COMEDI_NAMELEN bytes of a string containing
less than COMEDI_NAMELEN-1 bytes would leak some unrelated bytes.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Cc: stable <sta... |
static CURLcode ossl_connect_step1(struct Curl_easy *data,
struct connectdata *conn, int sockindex)
{
CURLcode result = CURLE_OK;
char *ciphers;
SSL_METHOD_QUAL SSL_METHOD *req_method = NULL;
X509_LOOKUP *lookup = NULL;
curl_socket_t sockfd = conn->sock[sockindex];
struct ... | 0 | [
"CWE-290"
] | curl | b09c8ee15771c614c4bf3ddac893cdb12187c844 | 29,188,775,180,639,390,000,000,000,000,000,000,000 | 775 | vtls: add 'isproxy' argument to Curl_ssl_get/addsessionid()
To make sure we set and extract the correct session.
Reported-by: Mingtao Yang
Bug: https://curl.se/docs/CVE-2021-22890.html
CVE-2021-22890 |
static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,
u16 flags)
{
struct tcamsg *t;
struct nlmsghdr *nlh;
struct sk_buff *skb;
struct rtattr *x;
unsigned char *b;
int err = 0;
skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
if (!skb)
return -ENOBUFS;
b = (unsig... | 1 | [
"CWE-200"
] | linux-2.6 | 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 | 256,634,281,223,385,440,000,000,000,000,000,000,000 | 41 | [NETLINK]: Missing initializations in dumped data
Mostly missing initialization of padding fields of 1 or 2 bytes length,
two instances of uninitialized nlmsgerr->msg of 16 bytes length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
struct netlink_callback *cb,
int *q_idx_p, int s_q_idx)
{
int ret = 0, q_idx = *q_idx_p;
struct Qdisc *q;
if (!root)
return 0;
q = root;
if (q_idx < s_q_idx) {
q_idx++;
} else {
if (!tc_qdisc_dump_ignore(q) &&
t... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 141,982,879,773,294,800,000,000,000,000,000,000,000 | 39 | net: Use netlink_ns_capable to verify the permisions of netlink messages
It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.
... |
router_parse_list_from_string(const char **s, const char *eos,
smartlist_t *dest,
saved_location_t saved_location,
int want_extrainfo,
int allow_annotations,
const char *... | 0 | [
"CWE-399"
] | tor | 57e35ad3d91724882c345ac709666a551a977f0f | 215,238,593,975,449,370,000,000,000,000,000,000,000 | 75 | Avoid possible segfault when handling networkstatus vote with bad flavor
Fix for 6530; fix on 0.2.2.6-alpha. |
server_mpvio_update_thd(THD *thd, MPVIO_EXT *mpvio)
{
thd->client_capabilities= mpvio->client_capabilities;
thd->max_client_packet_length= mpvio->max_client_packet_length;
if (mpvio->client_capabilities & CLIENT_INTERACTIVE)
thd->variables.net_wait_timeout= thd->variables.net_interactive_timeout;
thd->secur... | 0 | [] | mysql-server | 25d1b7e03b9b375a243fabdf0556c063c7282361 | 6,816,478,834,090,870,000,000,000,000,000,000,000 | 10 | Bug #22722946: integer overflow may lead to wrong results in get_56_lenc_string |
jp2_box_t *jp2_box_get(jas_stream_t *in)
{
jp2_box_t *box;
jp2_boxinfo_t *boxinfo;
jas_stream_t *tmpstream;
uint_fast32_t len;
uint_fast64_t extlen;
bool dataflag;
box = 0;
tmpstream = 0;
if (!(box = jp2_box_create0())) {
goto error;
}
if (jp2_getuint32(in, &len) || jp2_getuint32(in, &box->type)) {
got... | 0 | [
"CWE-476"
] | jasper | e96fc4fdd525fa0ede28074a7e2b1caf94b58b0d | 238,478,943,537,592,300,000,000,000,000,000,000,000 | 84 | Fixed bugs due to uninitialized data in the JP2 decoder.
Also, added some comments marking I/O stream interfaces that probably
need to be changed (in the long term) to fix integer overflow problems. |
static int ohci_port_set_if_connected(OHCIState *ohci, int i, uint32_t val)
{
int ret = 1;
/* writing a 0 has no effect */
if (val == 0)
return 0;
/* If CurrentConnectStatus is cleared we set
* ConnectStatusChange
*/
if (!(ohci->rhport[i].ctrl & OHCI_PORT_CCS)) {
ohci->rh... | 0 | [
"CWE-835"
] | qemu | 95ed56939eb2eaa4e2f349fe6dcd13ca4edfd8fb | 60,915,841,312,296,590,000,000,000,000,000,000,000 | 27 | usb: ohci: limit the number of link eds
The guest may builds an infinite loop with link eds. This patch
limit the number of linked ed to avoid this.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Message-id: 5899a02e.45ca240a.6c373.93c1@mx.google.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
ar_type_find (GstTypeFind * tf, gpointer unused)
{
const guint8 *data = gst_type_find_peek (tf, 0, 24);
if (data && memcmp (data, "!<arch>", 7) == 0) {
gint i;
for (i = 7; i < 24; ++i) {
if (!g_ascii_isprint (data[i]) && data[i] != '\n') {
gst_type_find_suggest (tf, GST_TYPE_FIND_POSSIBLE, A... | 0 | [
"CWE-125"
] | gst-plugins-base | 2fdccfd64fc609e44e9c4b8eed5bfdc0ab9c9095 | 211,568,198,001,738,930,000,000,000,000,000,000,000 | 16 | typefind: bounds check windows ico detection
Fixes out of bounds read
https://bugzilla.gnome.org/show_bug.cgi?id=774902 |
ves_icall_System_Reflection_Module_ResolveMethodToken (MonoImage *image, guint32 token, MonoArray *type_args, MonoArray *method_args, MonoResolveTokenError *error)
{
int table = mono_metadata_token_table (token);
int index = mono_metadata_token_index (token);
MonoGenericContext context;
MonoMethod *method;
*error... | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 72,685,781,965,654,980,000,000,000,000,000,000,000 | 40 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
void HeaderTable::addSkippedReference(uint32_t index) {
skippedRefs_.insert(toInternal(index));
} | 0 | [
"CWE-416"
] | proxygen | f43b134cc5c19d8532e7fb670a1c02e85f7a8d4f | 89,349,095,990,782,350,000,000,000,000,000,000,000 | 3 | Fixing HPACK header table resize issue
Summary: On resizing the header table down and then up again, a resize can be called against the underlying vector that actually sizes it down. This causes a lot of things to break as the code that does the resizing assumes the underlying vector is only ever resized up.
Reviewe... |
forbidden_name(struct compiling *c, identifier name, const node *n,
int full_checks)
{
assert(PyUnicode_Check(name));
const char * const *p = FORBIDDEN;
if (!full_checks) {
/* In most cases, the parser will protect True, False, and None
from being assign to. */
p +=... | 0 | [
"CWE-125"
] | cpython | a4d78362397fc3bced6ea80fbc7b5f4827aec55e | 234,781,295,756,761,100,000,000,000,000,000,000,000 | 18 | bpo-36495: Fix two out-of-bounds array reads (GH-12641)
Research and fix by @bradlarsen. |
free_PackInfo(struct _7z_pack_info *pi)
{
free(pi->sizes);
free(pi->positions);
free_Digest(&(pi->digest));
} | 0 | [
"CWE-190",
"CWE-125"
] | libarchive | e79ef306afe332faf22e9b442a2c6b59cb175573 | 85,922,470,797,345,720,000,000,000,000,000,000,000 | 6 | Issue #718: Fix TALOS-CAN-152
If a 7-Zip archive declares a rediculously large number of substreams,
it can overflow an internal counter, leading a subsequent memory
allocation to be too small for the substream data.
Thanks to the Open Source and Threat Intelligence project at Cisco
for reporting this issue. |
int bnx2x_release_leader_lock(struct bnx2x *bp)
{
return bnx2x_release_hw_lock(bp, bnx2x_get_leader_lock_resource(bp));
} | 0 | [
"CWE-20"
] | linux | 8914a595110a6eca69a5e275b323f5d09e18f4f9 | 35,073,177,849,710,810,000,000,000,000,000,000,000 | 4 | bnx2x: disable GSO where gso_size is too big for hardware
If a bnx2x card is passed a GSO packet with a gso_size larger than
~9700 bytes, it will cause a firmware error that will bring the card
down:
bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert!
bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT... |
xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
int hasNullEntries)
{
if ((set1 == NULL) && (hasNullEntries == 0)) {
/*
* Note that doing a memcpy of the list, namespace nodes are
* just assigned to set1, since set2 is cleared anyway.
*/
set1 = xmlXPathNodeSetCreateSize(set2->nodeN... | 1 | [
"CWE-189"
] | libxml2 | d7958b21e7f8c447a26bb2436f08402b2c308be4 | 60,627,734,854,488,480,000,000,000,000,000,000,000 | 95 | Fix some potential problems on reallocation failures
The count was incremented before the allocation
and not fixed in case of failure
* xpath.c: corrects a few instances where the available count of some
structure is updated before we know the allocation actually
succeeds |
int tls1_check_curve(SSL *s, const unsigned char *p, size_t len)
{
const unsigned char *curves;
size_t num_curves, i;
unsigned int suiteb_flags = tls1_suiteb(s);
if (len != 3 || p[0] != NAMED_CURVE_TYPE)
return 0;
/* Check curve matches Suite B preferences */
if (suiteb_flags) {
... | 0 | [
"CWE-20"
] | openssl | 4ad93618d26a3ea23d36ad5498ff4f59eff3a4d2 | 141,329,256,962,670,930,000,000,000,000,000,000,000 | 29 | Don't change the state of the ETM flags until CCS processing
Changing the ciphersuite during a renegotiation can result in a crash
leading to a DoS attack. ETM has not been implemented in 1.1.0 for DTLS
so this is TLS only.
The problem is caused by changing the flag indicating whether to use ETM
or not immediately on... |
static bool reg_may_point_to_spin_lock(const struct bpf_reg_state *reg)
{
return reg->type == PTR_TO_MAP_VALUE &&
map_value_has_spin_lock(reg->map_ptr);
} | 0 | [
"CWE-119",
"CWE-681",
"CWE-787"
] | linux | 5b9fbeb75b6a98955f628e205ac26689bcb1383e | 274,852,682,100,048,200,000,000,000,000,000,000,000 | 5 | bpf: Fix scalar32_min_max_or bounds tracking
Simon reported an issue with the current scalar32_min_max_or() implementation.
That is, compared to the other 32 bit subreg tracking functions, the code in
scalar32_min_max_or() stands out that it's using the 64 bit registers instead
of 32 bit ones. This leads to bounds tra... |
void WebContents::SetHtmlApiFullscreen(bool enter_fullscreen) {
// Window is already in fullscreen mode, save the state.
if (enter_fullscreen && owner_window_->IsFullscreen()) {
native_fullscreen_ = true;
html_fullscreen_ = true;
return;
}
// Exit html fullscreen state but not window's fullscreen m... | 0 | [
"CWE-200",
"CWE-668"
] | electron | 07a1c2a3e5845901f7e2eda9506695be58edc73c | 252,570,402,650,029,960,000,000,000,000,000,000,000 | 28 | fix: restrict sendToFrame to same-process frames by default (#26875) |
static int shmem_writepage(struct page *page, struct writeback_control *wbc)
{
struct shmem_inode_info *info;
struct address_space *mapping;
struct inode *inode;
swp_entry_t swap;
pgoff_t index;
BUG_ON(!PageLocked(page));
mapping = page->mapping;
index = page->index;
inode = mapping->host;
info = SHMEM_I(ino... | 0 | [
"CWE-399"
] | linux | 5f00110f7273f9ff04ac69a5f85bb535a4fd0987 | 224,372,689,346,332,100,000,000,000,000,000,000,000 | 101 | tmpfs: fix use-after-free of mempolicy object
The tmpfs remount logic preserves filesystem mempolicy if the mpol=M
option is not specified in the remount request. A new policy can be
specified if mpol=M is given.
Before this patch remounting an mpol bound tmpfs without specifying
mpol= mount option in the remount re... |
void sqlite3VdbeCountChanges(Vdbe *v){
v->changeCntOn = 1;
} | 0 | [
"CWE-755"
] | sqlite | 8654186b0236d556aa85528c2573ee0b6ab71be3 | 217,268,579,065,241,600,000,000,000,000,000,000,000 | 3 | When an error occurs while rewriting the parser tree for window functions
in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set,
and make sure that this shuts down any subsequent code generation that might
depend on the transformations that were implemented. This fixes a problem
discovered by the Y... |
SafeTapeSet()
: SafeSetCopy<tensorflow::gtl::CompactPointerSet<TFE_Py_Tape*>>(
*GetTapeSet()) {} | 0 | [
"CWE-476",
"CWE-908"
] | tensorflow | 237822b59fc504dda2c564787f5d3ad9c4aa62d9 | 120,501,915,103,368,280,000,000,000,000,000,000,000 | 3 | Fix tf.compat.v1.placeholder_with_default vulnerability with quantized types.
When iterating through the tensor to extract shape values, an underlying missing kernel
(`StridedSlice` for quantized types) causes an error, which then results in a `nullptr`
being passed to `ParseDimensionValue()`, causing a segfault.
The... |
EXPORTED int mboxlist_usersubs(const char *userid, mboxlist_cb *proc,
void *rock, int flags)
{
struct db *subs = NULL;
struct submb_rock mbrock = { NULL, userid, flags, proc, rock };
int r = 0;
/* open subs DB */
r = mboxlist_opensubs(userid, &subs);
if (r) return... | 0 | [
"CWE-20"
] | cyrus-imapd | 6bd33275368edfa71ae117de895488584678ac79 | 273,737,046,185,281,250,000,000,000,000,000,000,000 | 20 | mboxlist: fix uninitialised memory use where pattern is "Other Users" |
void serve_err(SERVER* serve, const char* msg) {
g_message("Export of %s on port %d failed:", serve->exportname,
serve->port);
err(msg);
} | 0 | [
"CWE-119",
"CWE-787"
] | nbd | 3ef52043861ab16352d49af89e048ba6339d6df8 | 285,685,918,162,762,740,000,000,000,000,000,000,000 | 5 | Fix buffer size checking
Yes, this means we've re-introduced CVE-2005-3534. Sigh. |
static int fbo_emulate_mechanism_status(struct tcmu_device *dev, uint8_t *cdb,
struct iovec *iovec, size_t iov_cnt,
uint8_t *sense)
{
struct fbo_state *state = tcmu_get_dev_private(dev);
uint8_t buf[8];
memset(buf, 0, sizeof(buf));
if (state->flags & FBO_DEV_IO) {
buf[1] = 0x20; // mechanism state=1 (... | 0 | [
"CWE-200"
] | tcmu-runner | 8cf8208775022301adaa59c240bb7f93742d1329 | 186,479,876,651,456,360,000,000,000,000,000,000,000 | 19 | removed all check_config callback implementations to avoid security issues
see github issue #194
qcow.c contained an information leak, could test for existance of any
file in the system
file_example.c and file_optical.c allow also to test for existance of
any file, plus to temporarily create empty new files anywhere... |
void PDFDoc::init()
{
ok = false;
errCode = errNone;
fileName = nullptr;
file = nullptr;
str = nullptr;
xref = nullptr;
linearization = nullptr;
catalog = nullptr;
hints = nullptr;
outline = nullptr;
startXRefPos = -1;
secHdlr = nullptr;
pageCache = nullptr;
} | 0 | [
"CWE-20"
] | poppler | 9fd5ec0e6e5f763b190f2a55ceb5427cfe851d5f | 174,675,553,427,279,600,000,000,000,000,000,000,000 | 16 | PDFDoc::setup: Fix return value
At that point xref can have gone wrong since extractPDFSubtype() can
have caused a reconstruct that broke stuff so instead of unconditionally
returning true, return xref->isOk()
Fixes #706 |
TF_LITE_MICRO_TEST(GatherNd_DuplicateIndexingIntoMatrix) {
// For input_dims[], index_dims[], or output_dims[], element 0 is the
// number of dimensions in that array, not the actual dimension data.
int input_dims[] = {2, 2, 2};
int index_dims[] = {2, 2, 2};
const int32_t index_data[] = {0, 0, 0, 0};
const ... | 0 | [
"CWE-703"
] | tflite-micro | 4142e47e9e31db481781b955ed3ff807a781b494 | 273,173,591,639,595,700,000,000,000,000,000,000,000 | 14 | GatherNd verifies that an index is valid before reading. (#1286) |
archive_write_disk_uid(struct archive *_a, const char *name, la_int64_t id)
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_ANY, "archive_write_disk_uid");
if (a->lookup_uid)
return (a->lookup_uid)(a->lookup_uid_data, n... | 0 | [
"CWE-59",
"CWE-269"
] | libarchive | b41daecb5ccb4c8e3b2c53fd6147109fc12c3043 | 69,831,602,267,027,680,000,000,000,000,000,000,000 | 9 | Do not follow symlinks when processing the fixup list
Use lchmod() instead of chmod() and tell the remaining functions that the
real file to be modified is a symbolic link.
Fixes #1566 |
static ssize_t show_snapshot_button_status(struct class_device *class_dev, char *buf)
{
struct pwc_device *pdev = cd_to_pwc(class_dev);
int status = pdev->snapshot_button_status;
pdev->snapshot_button_status = 0;
return sprintf(buf, "%d\n", status);
} | 0 | [
"CWE-399"
] | linux-2.6 | 85237f202d46d55c1bffe0c5b1aa3ddc0f1dce4d | 24,778,352,953,371,086,000,000,000,000,000,000,000 | 7 | USB: fix DoS in pwc USB video driver
the pwc driver has a disconnect method that waits for user space to
close the device. This opens up an opportunity for a DoS attack,
blocking the USB subsystem and making khubd's task busy wait in
kernel space. This patch shifts freeing resources to close if an opened
device is dis... |
static MagickBooleanType CorrectPSDAlphaBlend(const ImageInfo *image_info,
Image *image, ExceptionInfo* exception)
{
const char
*option;
MagickBooleanType
status;
ssize_t
y;
if (image->matte == MagickFalse || image->colorspace != sRGBColorspace)
return(MagickTrue);
option=GetImageOption(i... | 0 | [
"CWE-125"
] | ImageMagick6 | 4745eb1047617330141e9abfd5ae01236a71ae12 | 211,377,713,226,874,850,000,000,000,000,000,000,000 | 58 | https://github.com/ImageMagick/ImageMagick/issues/1249 |
STATIC ptr_t GC_alloc_large_and_clear(size_t lb, int k, unsigned flags)
{
ptr_t result = GC_alloc_large(lb, k, flags);
word n_blocks = OBJ_SZ_TO_BLOCKS(lb);
if (0 == result) return 0;
if (GC_debugging_started || GC_obj_kinds[k].ok_init) {
/* Clear the whole block, in case of GC_realloc call. */... | 0 | [
"CWE-189"
] | bdwgc | be9df82919960214ee4b9d3313523bff44fd99e1 | 63,028,562,386,652,220,000,000,000,000,000,000,000 | 12 | Fix allocation size overflows due to rounding.
* malloc.c (GC_generic_malloc): Check if the allocation size is
rounded to a smaller value.
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise. |
errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
{
dgrp_t i;
errcode_t retval;
unsigned long fs_state;
__u32 feature_incompat;
struct ext2_super_block *super_shadow = 0;
struct ext2_group_desc *group_shadow = 0;
#ifdef WORDS_BIGENDIAN
struct ext2_group_desc *gdp;
dgrp_t j;
#endif
char *group_ptr;
int old... | 1 | [] | e2fsprogs | f66e6ce4446738c2c7f43d41988a3eb73347e2f5 | 183,144,319,257,615,300,000,000,000,000,000,000,000 | 162 | libext2fs: avoid buffer overflow if s_first_meta_bg is too big
If s_first_meta_bg is greater than the of number block group
descriptor blocks, then reading or writing the block group descriptors
will end up overruning the memory buffer allocated for the
descriptors. Fix this by limiting first_meta_bg to no more than
... |
static int md_alloc(dev_t dev, char *name)
{
static DEFINE_MUTEX(disks_mutex);
struct mddev *mddev = mddev_find(dev);
struct gendisk *disk;
int partitioned;
int shift;
int unit;
int error;
if (!mddev)
return -ENODEV;
partitioned = (MAJOR(mddev->unit) != MD_MAJOR);
shift = partitioned ? MdpMinorShift : 0;
... | 0 | [
"CWE-200"
] | linux | b6878d9e03043695dbf3fa1caa6dfc09db225b16 | 208,936,549,652,645,520,000,000,000,000,000,000,000 | 104 | 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... |
static int parse_VariantCol(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, guint64 base_address, guint32 length _U_, gboolean is_64bit, struct CRowVariant *variant, const char *fmt, ...)
{
proto_tree *tree;
proto_item *item, *ti_type;
va_list ap;
struct vtype_data *vt_type;
const char *mo... | 0 | [
"CWE-770"
] | wireshark | b7a0650e061b5418ab4a8f72c6e4b00317aff623 | 254,641,381,033,901,720,000,000,000,000,000,000,000 | 93 | MS-WSP: Don't allocate huge amounts of memory.
Add a couple of memory allocation sanity checks, one of which
fixes #17331. |
static pj_status_t file_on_destroy(pjmedia_port *this_port)
{
struct file_reader_port *fport = (struct file_reader_port*) this_port;
pj_assert(this_port->info.signature == SIGNATURE);
pj_file_close(fport->fd);
if (fport->subscribed) {
pjmedia_event_unsubscribe(NULL, &file_on_event, fport, fport)... | 0 | [
"CWE-703",
"CWE-835"
] | pjproject | 947bc1ee6d05be10204b918df75a503415fd3213 | 189,770,860,825,755,300,000,000,000,000,000,000,000 | 15 | Merge pull request from GHSA-rwgw-vwxg-q799
* Prevent potential infinite loop when parsing WAV format file
* Check if subchunk is negative.
* Fix and add checks
* Change data type from pj_ssize_t to long.
* Modify check
* Fix leak file descriptor and modify check on wav_playlist
* Move overflow/underflow check t... |
resolve_p2p_update_from_commit (FlatpakDirResolve *resolve,
GVariant *commit_data)
{
g_autoptr(GVariant) commit_metadata = NULL;
const char *xa_metadata = NULL;
guint64 download_size = 0;
guint64 installed_size = 0;
commit_metadata = g_variant_get_child_value (commit_data, 0);... | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 24,401,837,916,486,530,000,000,000,000,000,000,000 | 21 | 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 ... |
GF_Err odrb_box_size(GF_Box *s)
{
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox *)s;
s->size += ptr->oma_ro_size;
return GF_OK;
} | 0 | [
"CWE-703"
] | gpac | f19668964bf422cf5a63e4dbe1d3c6c75edadcbb | 132,356,576,782,804,230,000,000,000,000,000,000,000 | 6 | fixed #1879 |
BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s)
{
UINT16 channelId;
UINT16 pduType;
UINT16 pduLength;
UINT16 pduSource;
UINT16 length;
UINT16 numberCapabilities;
UINT16 lengthSourceDescriptor;
UINT16 lengthCombinedCapabilities;
if (!rdp_recv_get_active_header(rdp, s, &channelId, &length))
return FALSE;... | 0 | [
"CWE-119",
"CWE-125"
] | FreeRDP | 3627aaf7d289315b614a584afb388f04abfb5bbf | 44,339,431,169,826,730,000,000,000,000,000,000,000 | 73 | Fixed #6011: Bounds check in rdp_read_font_capability_set |
virtual void endStringOp(GfxState * /*state*/) {} | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 309,951,228,357,946,670,000,000,000,000,000,000,000 | 1 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
static inline int __skb_trim_rcsum(struct sk_buff *skb, unsigned int len)
{
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->ip_summed = CHECKSUM_NONE;
__skb_trim(skb, len);
return 0; | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 222,294,094,161,512,260,000,000,000,000,000,000,000 | 7 | net: create skb_gso_validate_mac_len()
If you take a GSO skb, and split it into packets, will the MAC
length (L2 + L3 + L4 headers + payload) of those packets be small
enough to fit within a given length?
Move skb_gso_mac_seglen() to skbuff.h with other related functions
like skb_gso_network_seglen() so we can use it... |
static Image *ReadFLIFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
FLIF_DECODER
*flifdec;
FLIF_IMAGE
*flifimage;
Image
*image;
MagickBooleanType
status;
register PixelPacket
*q;
register ssize_t
x;
register unsigned short
*p;
size_t
count,
i... | 0 | [
"CWE-401"
] | ImageMagick6 | 210474b2fac6a661bfa7ed563213920e93e76395 | 283,737,398,832,442,040,000,000,000,000,000,000,000 | 137 | Fix ultra rare but potential memory-leak |
stbi_inline static int stbi__at_eof(stbi__context *s)
{
if (s->io.read) {
if (!(s->io.eof)(s->io_user_data)) return 0;
// if feof() is true, check if buffer = end
// special case: we've only got the special 0 character at the end
if (s->read_from_callbacks == 0) return 1;
}
return s->i... | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 323,219,241,283,540,530,000,000,000,000,000,000,000 | 11 | stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.
Fixes issue #1178. |
__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid,
nodemask_t *nodemask)
{
struct page *page;
unsigned int alloc_flags = ALLOC_WMARK_LOW;
gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */
struct alloc_context ac = { };
gfp_mask &= gfp_allowed_mask;
alloc_ma... | 0 | [] | linux | 400e22499dd92613821374c8c6c88c7225359980 | 97,732,242,277,808,160,000,000,000,000,000,000,000 | 49 | mm: don't warn about allocations which stall for too long
Commit 63f53dea0c98 ("mm: warn about allocations which stall for too
long") was a great step for reducing possibility of silent hang up
problem caused by memory allocation stalls. But this commit reverts it,
for it is possible to trigger OOM lockup and/or soft... |
QStringList AbstractSqlStorage::setupQueries()
{
QStringList queries;
QDir dir = QDir(QString(":/SQL/%1/%2/").arg(displayName()).arg(schemaVersion()));
foreach(QFileInfo fileInfo, dir.entryInfoList(QStringList() << "setup*", QDir::NoFilter, QDir::Name)) {
queries << queryString(fileInfo.baseName());... | 0 | [
"CWE-89"
] | quassel | aa1008be162cb27da938cce93ba533f54d228869 | 194,456,303,737,236,550,000,000,000,000,000,000,000 | 9 | Fixing security vulnerability with Qt 4.8.5+ and PostgreSQL.
Properly detects whether Qt performs slash escaping in SQL queries or
not, and then configures PostgreSQL accordingly. This bug was a
introduced due to a bugfix in Qt 4.8.5 disables slash escaping when
binding queries: https://bugreports.qt-project.org/brows... |
static int hugetlb_acct_memory(struct hstate *h, long delta)
{
int ret = -ENOMEM;
if (!delta)
return 0;
spin_lock_irq(&hugetlb_lock);
/*
* When cpuset is configured, it breaks the strict hugetlb page
* reservation as the accounting is done on a global variable. Such
* reservation is completely rubbish in ... | 0 | [] | linux | a4a118f2eead1d6c49e00765de89878288d4b890 | 284,939,912,291,501,720,000,000,000,000,000,000,000 | 49 | hugetlbfs: flush TLBs correctly after huge_pmd_unshare
When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing. This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place... |
cmsFloat64Number CMSEXPORT cmsIT8GetPropertyDbl(cmsHANDLE hIT8, const char* cProp)
{
const char *v = cmsIT8GetProperty(hIT8, cProp);
return ParseFloatNumber(v);
} | 1 | [] | Little-CMS | 65e2f1df3495edc984f7e0d7b7b24e29d851e240 | 227,261,636,237,197,500,000,000,000,000,000,000,000 | 6 | Fix some warnings from static analysis |
gdk_pixbuf_new_from_inline (gint data_length,
const guint8 *data,
gboolean copy_pixels,
GError **error)
{
GdkPixdata pixdata;
if (data_length != -1)
g_return_val_if_fail (data_length > GDK_PIXDATA_HEADER_LENGTH, NULL);
g_return_val_if_fail (data != NULL, NULL);
if (... | 0 | [] | gdk-pixbuf | deb78d971c4bcb9e3ccbb71e7925bc6baa707188 | 289,829,978,524,670,930,000,000,000,000,000,000,000 | 16 | Use g_try_malloc_n where it makes sense
This lets us avoid some manual overflow checks. |
static inline void timer_base_lock_expiry(struct timer_base *base) { } | 0 | [
"CWE-200",
"CWE-330"
] | linux | f227e3ec3b5cad859ad15666874405e8c1bbc1d4 | 126,724,291,899,993,300,000,000,000,000,000,000,000 | 1 | random32: update the net random state on interrupt and activity
This modifies the first 32 bits out of the 128 bits of a random CPU's
net_rand_state on interrupt or CPU activity to complicate remote
observations that could lead to guessing the network RNG's internal
state.
Note that depending on some network devices'... |
lprn_put_params(gx_device * dev, gs_param_list * plist)
{
gx_device_lprn *const lprn = (gx_device_lprn *) dev;
int ecode = 0;
int code;
gs_param_name param_name;
bool ManualFeed = lprn->ManualFeed;
bool NegativePrint = lprn->NegativePrint;
bool Tumble = lprn->Tumble;
bool RITOff = lprn->... | 0 | [
"CWE-787"
] | ghostpdl | 450da26a76286a8342ec0864b3d113856709f8f6 | 132,801,875,093,927,540,000,000,000,000,000,000,000 | 106 | Bug 701785: fixed sanitizer heap-buffer-overflow in lprn_is_black().
In contrib/lips4/gdevlprn.c:lprn_is_black(), it seems that bpl is not
necessarily a multiple of lprn->nBw, so we need to explicitly avoid straying
into the next line's data.
This also avoids accessing beyond our buffer if we are already on the last
... |
NTSTATUS cli_ulogoff(struct cli_state *cli)
{
struct tevent_context *ev;
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
status = smb2cli_logoff(cli->conn,
cli->timeout,
cli->smb2.session);
if (!NT_STATUS_IS_OK(status)) {
r... | 0 | [
"CWE-94"
] | samba | 94295b7aa22d2544af5323bca70d3dcb97fd7c64 | 1,358,401,547,189,913,200,000,000,000,000,000,000 | 37 | CVE-2016-2019: s3:libsmb: add comment regarding smbXcli_session_is_guest() with mandatory signing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11860
Signed-off-by: Stefan Metzmacher <metze@samba.org> |
int main()
{
check_file("tiff_invalid_read_1.tiff");
check_file("tiff_invalid_read_2.tiff");
check_file("tiff_invalid_read_3.tiff");
return gdNumFailures();
} | 0 | [
"CWE-125"
] | libgd | 4859d69e07504d4b0a4bdf9bcb4d9e3769ca35ae | 299,557,839,557,352,780,000,000,000,000,000,000,000 | 8 | Fix invalid read in gdImageCreateFromTiffPtr()
tiff_invalid_read.tiff is corrupt, and causes an invalid read in
gdImageCreateFromTiffPtr(), but not in gdImageCreateFromTiff(). The culprit
is dynamicGetbuf(), which doesn't check for out-of-bound reads. In this case,
dynamicGetbuf() is called with a negative dp->pos, bu... |
static inline int pni_mutex_lock(pni_mutex_t *m) { return pthread_mutex_lock(m); } | 0 | [] | qpid-proton | 4aea0fd8502f5e9af7f22fd60645eeec07bce0b2 | 195,126,792,985,958,700,000,000,000,000,000,000,000 | 1 | PROTON-2014: [c] Ensure SSL mutual authentication
(cherry picked from commit 97c7733f07712665f3d08091c82c393e4c3adbf7) |
SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer,
unsigned long, nbytes, int __user *, start, void __user *, arg)
{
unsigned long w;
struct percpu_struct *cpu;
switch (op) {
case GSI_IEEE_FP_CONTROL:
/* Return current software fp control & status bits. */
/* Note that DU doesn't veri... | 1 | [
"CWE-703",
"CWE-264",
"CWE-189"
] | linux | 21c5977a836e399fc710ff2c5367845ed5c2527f | 114,875,887,794,589,880,000,000,000,000,000,000,000 | 56 | alpha: fix several security issues
Fix several security issues in Alpha-specific syscalls. Untested, but
mostly trivial.
1. Signedness issue in osf_getdomainname allows copying out-of-bounds
kernel memory to userland.
2. Signedness issue in osf_sysinfo allows copying large amounts of
kernel memory to userland.
3. ... |
*/
static int send_change_user_packet(MCPVIO_EXT *mpvio,
const uchar *data, int data_len)
{
MYSQL *mysql= mpvio->mysql;
char *buff, *end;
int res= 1;
buff= my_alloca(USERNAME_LENGTH + data_len + 1 + NAME_LEN + 2 + NAME_LEN);
end= strmake(buff, mysql->user, USERNAME_LENGTH)... | 0 | [
"CWE-254"
] | mysql-server | 13380bf81f6bc20d39549f531f9acebdfb5a8c37 | 187,666,770,450,962,760,000,000,000,000,000,000,000 | 51 | Bug #22295186: CERTIFICATE VALIDATION BUG IN MYSQL MAY ALLOW MITM |
CImg<T>& load_exr(const char *const filename) {
if (!filename)
throw CImgArgumentException(_cimg_instance
"load_exr(): Specified filename is (null).",
cimg_instance);
#if defined(cimg_use_openexr)
Imf::RgbaInputFile file(fil... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 216,044,118,111,543,000,000,000,000,000,000,000,000 | 39 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
gdk_pixbuf_icon_iface_init (GIconIface *iface)
{
iface->hash = (guint (*) (GIcon *)) g_direct_hash;
iface->equal = (gboolean (*) (GIcon *, GIcon *)) g_direct_equal;
iface->serialize = gdk_pixbuf_serialize;
} | 0 | [] | gdk-pixbuf | deb78d971c4bcb9e3ccbb71e7925bc6baa707188 | 177,696,442,199,149,700,000,000,000,000,000,000,000 | 6 | Use g_try_malloc_n where it makes sense
This lets us avoid some manual overflow checks. |
void __iomem *devm_platform_ioremap_resource_wc(struct platform_device *pdev,
unsigned int index)
{
struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, index);
return devm_ioremap_resource_wc(&pdev->dev, res);
} | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 216,730,029,033,572,400,000,000,000,000,000,000,000 | 8 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
int bind_ipi_to_irqhandler(enum ipi_vector ipi,
unsigned int cpu,
irq_handler_t handler,
unsigned long irqflags,
const char *devname,
void *dev_id)
{
int irq, retval;
irq = bind_ipi_to_irq(ipi, cpu);
if (irq < 0)
return irq;
irqflags |= IRQF_NO_SUSPEND | IRQF_FORCE_RESUME | IRQF_EA... | 0 | [
"CWE-400",
"CWE-703"
] | linux | e99502f76271d6bc4e374fe368c50c67a1fd3070 | 110,246,367,071,313,620,000,000,000,000,000,000,000 | 22 | xen/events: defer eoi in case of excessive number of events
In case rogue guests are sending events at high frequency it might
happen that xen_evtchn_do_upcall() won't stop processing events in
dom0. As this is done in irq handling a crash might be the result.
In order to avoid that, delay further inter-domain events... |
static int GetWebFrameId(v8::Local<v8::Object> content_window) {
// Get the WebLocalFrame before (possibly) executing any user-space JS while
// getting the |params|. We track the status of the RenderFrame via an
// observer in case it is deleted during user code execution.
content::RenderFrame* rende... | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 58,124,691,684,860,060,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
... |
GList *completion_get_channels(SERVER_REC *server, const char *word)
{
GList *list;
GSList *tmp;
int len;
g_return_val_if_fail(word != NULL, NULL);
len = strlen(word);
list = NULL;
/* first get the joined channels */
tmp = server == NULL ? NULL : server->channels;
for (; tmp != NULL; tmp = tmp->next) {
CH... | 0 | [
"CWE-416"
] | irssi | 36564717c9f701e3a339da362ab46d220d27e0c1 | 234,165,025,087,620,550,000,000,000,000,000,000,000 | 34 | Merge branch 'security' into 'master'
Security
See merge request irssi/irssi!34
(cherry picked from commit b0d9cb33cd9ef9da7c331409e8b7c57a6f3aef3f) |
table_service_name(enum table_service s)
{
switch (s) {
case K_NONE: return "NONE";
case K_ALIAS: return "ALIAS";
case K_DOMAIN: return "DOMAIN";
case K_CREDENTIALS: return "CREDENTIALS";
case K_NETADDR: return "NETADDR";
case K_USERINFO: return "USERINFO";
case K_SOURCE: return "SOURCE";
case K_MAILADDR:... | 0 | [
"CWE-772",
"CWE-401"
] | src | 79a034b4aed29e965f45a13409268290c9910043 | 332,905,979,210,102,930,000,000,000,000,000,000,000 | 19 | Use regfree after we're done with preg.
From gilles@ |
callbacks_reduce_object_area_clicked (GtkButton *button, gpointer user_data){
/* for testing, just hard code in some parameters */
gerbv_image_reduce_area_of_selected_objects (screen.selectionInfo.selectedNodeArray, 0.20, 3, 3, 0.01);
selection_clear (&screen.selectionInfo);
update_selected_object_message (FALSE);... | 0 | [
"CWE-200"
] | gerbv | 319a8af890e4d0a5c38e6d08f510da8eefc42537 | 2,428,127,297,912,837,000,000,000,000,000,000,000 | 7 | Remove local alias to parameter array
Normalizing access to `gerbv_simplified_amacro_t::parameter` as a step to fix CVE-2021-40402 |
PHP_METHOD(Phar, decompress)
{
char *ext = NULL;
int ext_len = 0;
zval *ret;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ext, &ext_len) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->arc.archive->is_data) {
zend_throw_exception_ex(spl_ce_UnexpectedValueExc... | 0 | [
"CWE-416"
] | php-src | b2cf3f064b8f5efef89bb084521b61318c71781b | 238,484,901,482,172,650,000,000,000,000,000,000,000 | 35 | Fixed bug #68901 (use after free) |
HTTPrequestMethod(HRequest *hr)
{
switch (hr->command) {
case HR_COMMAND_CONNECT:
return Strnew_charp("CONNECT");
case HR_COMMAND_POST:
return Strnew_charp("POST");
break;
case HR_COMMAND_HEAD:
return Strnew_charp("HEAD");
break;
case HR_COMMAND_GET:
default:
return Strnew_charp("GET");
... | 0 | [
"CWE-119"
] | w3m | ba9d78faeba9024c3e8840579c3b0e959ae2cb0f | 223,971,427,367,950,660,000,000,000,000,000,000,000 | 17 | Prevent global-buffer-overflow in parseURL()
Bug-Debian: https://github.com/tats/w3m/issues/41 |
static int reqs_unknown(uint32_t reqs)
{
return reqs & CRYPT_REQUIREMENT_UNKNOWN;
} | 0 | [
"CWE-787"
] | cryptsetup | 52f5cb8cedf22fb3e14c744814ec8af7614146c7 | 319,021,939,421,592,320,000,000,000,000,000,000,000 | 4 | Check segment gaps regardless of heap space.
Segments are validated in hdr_validate_segments. Gaps in segment keys
are detected when collecting offsets. But if an invalid segment is very
large, larger than count, it could happen that cryptsetup is unable to
allocate enough memory, not giving a clue about what actually... |
free_callback(callback_T *callback)
{
if (callback->cb_partial != NULL)
{
partial_unref(callback->cb_partial);
callback->cb_partial = NULL;
}
else if (callback->cb_name != NULL)
func_unref(callback->cb_name);
if (callback->cb_free_name)
{
vim_free(callback->cb_name);
callback->cb_free_name ... | 0 | [
"CWE-476"
] | vim | 0f6e28f686dbb59ab3b562408ab9b2234797b9b1 | 77,623,195,781,358,265,000,000,000,000,000,000,000 | 16 | patch 8.2.4428: crash when switching tabpage while in the cmdline window
Problem: Crash when switching tabpage while in the cmdline window.
Solution: Disallow switching tabpage when in the cmdline window. |
std::string DescribeStatsContents( const CMsgSteamSockets_UDP_Stats &msg )
{
std::string sWhat;
if ( msg.flags() & msg.ACK_REQUEST_E2E )
sWhat += " request_ack";
if ( msg.flags() & msg.ACK_REQUEST_IMMEDIATE )
sWhat += " request_ack_immediate";
if ( msg.flags() & msg.NOT_PRIMARY_TRANSPORT_E2E )
sWhat += " back... | 0 | [
"CWE-703"
] | GameNetworkingSockets | d944a10808891d202bb1d5e1998de6e0423af678 | 150,771,349,261,970,000,000,000,000,000,000,000,000 | 15 | Tweak pointer math to avoid possible integer overflow |
virDomainPinEmulator(virDomainPtr domain, unsigned char *cpumap,
int maplen, unsigned int flags)
{
virConnectPtr conn;
VIR_DOMAIN_DEBUG(domain, "cpumap=%p, maplen=%d, flags=%x",
cpumap, maplen, flags);
virResetLastError();
virCheckDomainReturn(domain, -1);
... | 0 | [
"CWE-254"
] | libvirt | 506e9d6c2d4baaf580d489fff0690c0ff2ff588f | 193,871,857,848,490,530,000,000,000,000,000,000,000 | 32 | virDomainGetTime: Deny on RO connections
We have a policy that if API may end up talking to a guest agent
it should require RW connection. We don't obey the rule in
virDomainGetTime().
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
{
unsigned char *buffer;
int pos;
int is_root;
rpl_dag_t *dag = instance->current_dag;
#if !RPL_LEAF_ONLY
uip_ipaddr_t addr;
#endif /* !RPL_LEAF_ONLY */
#if RPL_LEAF_ONLY
/* In leaf mode, we only send DIO messages as unicasts in response to
u... | 0 | [
"CWE-703"
] | contiki-ng | 587ae59956e00316fd44fd7072ac3a6a07b4b20f | 42,835,267,520,148,300,000,000,000,000,000,000,000 | 155 | Check RPL Target prefix length and buffer boundary. |
nf_queue_entry_dup(struct nf_queue_entry *e)
{
struct nf_queue_entry *entry = kmemdup(e, e->size, GFP_ATOMIC);
if (entry) {
if (nf_queue_entry_get_refs(entry))
return entry;
kfree(entry);
}
return NULL;
} | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 267,941,227,422,655,300,000,000,000,000,000,000,000 | 10 | core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the caller... |
static void *conn_timeout_thread(void *arg) {
int i;
conn *c;
char buf[TIMEOUT_MSG_SIZE];
rel_time_t oldest_last_cmd;
int sleep_time;
int sleep_slice = max_fds / CONNS_PER_SLICE;
if (sleep_slice == 0)
sleep_slice = CONNS_PER_SLICE;
useconds_t timeslice = 1000000 / sleep_slice;
... | 0 | [] | memcached | f249724cedcab6605ca8a0769ac4b356a8124f63 | 269,851,935,106,668,180,000,000,000,000,000,000,000 | 63 | crash fix: errstr wasn't initialized in metaget
if meta_flag_preparse bailed out early it would try to read
uninitialized memory. |
TEST_F(AccessControlTest, validate_topic_access_fail_wildcards)
{
topic_name = "HelloWorldTopic_*";
RTPSParticipantAttributes subscriber_participant_attr;
fill_subscriber_participant_security_attributes(subscriber_participant_attr);
check_local_datareader(subscriber_participant_attr, false);
check_... | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 293,968,386,788,059,670,000,000,000,000,000,000,000 | 14 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
format_true(const char *s)
{
if (s != NULL && *s != '\0' && (s[0] != '0' || s[1] != '\0'))
return (1);
return (0);
} | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 292,593,131,490,839,040,000,000,000,000,000,000,000 | 6 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
static void FVMenuSelectWorthOutputting(GWindow gw, struct gmenuitem *UNUSED(mi), GEvent *e) {
FontView *fv = (FontView *) GDrawGetUserData(gw);
int i, gid, doit;
EncMap *map = fv->b.map;
SplineFont *sf = fv->b.sf;
int merge = SelMergeType(e);
for ( i=0; i< map->enccount; ++i ) {
doit = ( (gid... | 0 | [
"CWE-119",
"CWE-787"
] | fontforge | 626f751752875a0ddd74b9e217b6f4828713573c | 172,129,694,829,586,800,000,000,000,000,000,000,000 | 14 | Warn users before discarding their unsaved scripts (#3852)
* Warn users before discarding their unsaved scripts
This closes #3846. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.