func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
if (err != 0) {
FREE_CURVE_SPECS();
return err;
} | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 72,481,349,882,439,440,000,000,000,000,000,000,000 | 4 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
gdm_manager_set_show_local_greeter (GdmManager *manager,
gboolean show_local_greeter)
{
g_return_if_fail (GDM_IS_MANAGER (manager));
manager->priv->show_local_greeter = show_local_greeter;
} | 0 | [] | gdm | ff98b2817014684ae1acec78ff06f0f461a56a9f | 303,977,867,982,678,720,000,000,000,000,000,000,000 | 7 | manager: if falling back to X11 retry autologin
Right now, we get one shot to autologin. If it fails, we fall back to
the greeter. We should give it another go if the reason for the failure
was wayland fallback to X.
https://bugzilla.gnome.org/show_bug.cgi?id=780520 |
cdf_unpack_dir(cdf_directory_t *d, char *buf)
{
size_t len = 0;
CDF_UNPACKA(d->d_name);
CDF_UNPACK(d->d_namelen);
CDF_UNPACK(d->d_type);
CDF_UNPACK(d->d_color);
CDF_UNPACK(d->d_left_child);
CDF_UNPACK(d->d_right_child);
CDF_UNPACK(d->d_storage);
CDF_UNPACKA(d->d_storage_uuid);
CDF_UNPACK(d->d_flags);
CDF_UN... | 0 | [
"CWE-119"
] | file | 1859fdb4e67c49c463c4e0078054335cd46ba295 | 293,120,821,207,979,670,000,000,000,000,000,000,000 | 19 | add more check found by cert's fuzzer. |
cib_remote_register_notification(cib_t * cib, const char *callback, int enabled)
{
xmlNode *notify_msg = create_xml_node(NULL, "cib_command");
cib_remote_opaque_t *private = cib->variant_opaque;
crm_xml_add(notify_msg, F_CIB_OPERATION, T_CIB_NOTIFY);
crm_xml_add(notify_msg, F_CIB_NOTIFY_TYPE, callback)... | 0 | [
"CWE-399"
] | pacemaker | 564f7cc2a51dcd2f28ab12a13394f31be5aa3c93 | 192,675,892,216,975,240,000,000,000,000,000,000,000 | 12 | High: core: Internal tls api improvements for reuse with future LRMD tls backend. |
destructAllActions(void)
{
ruleset.DestructAllActions();
bHaveMainQueue = 0; // flag that internal messages need to be temporarily stored
} | 0 | [
"CWE-119"
] | rsyslog | 1ca6cc236d1dabf1633238b873fb1c057e52f95e | 152,810,122,740,948,540,000,000,000,000,000,000,000 | 5 | bugfix: off-by-one(two) bug in legacy syslog parser |
GF_Err traf_Read(GF_Box *s, GF_BitStream *bs)
{
GF_TrackFragmentBox *ptr = (GF_TrackFragmentBox *)s;
GF_Err e = gf_isom_box_array_read(s, bs, traf_AddBox);
if (e) return e;
if (!ptr->tfhd) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Missing TrackFragmentHeaderBox \n"));
return GF_ISOM_INVALID_FILE;
... | 0 | [
"CWE-400",
"CWE-401"
] | gpac | d2371b4b204f0a3c0af51ad4e9b491144dd1225c | 191,986,467,942,695,400,000,000,000,000,000,000,000 | 12 | prevent dref memleak on invalid input (#1183) |
mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...)
{
va_list ap;
va_start(ap, arg);
switch(option) {
case MYSQL_OPT_CONNECT_TIMEOUT:
*((uint *)arg)= mysql->options.connect_timeout;
break;
case MYSQL_OPT_COMPRESS:
*((my_bool *)arg)= mysql->options.compress;
break;
cas... | 0 | [
"CWE-20"
] | mariadb-connector-c | 2759b87d72926b7c9b5426437a7c8dd15ff57945 | 194,710,675,967,656,600,000,000,000,000,000,000,000 | 213 | sanity checks for client-supplied OK packet content
reported by Matthias Kaiser, Apple Information Security |
static bool vxlan_group_used(struct vxlan_net *vn, struct vxlan_dev *dev)
{
struct vxlan_dev *vxlan;
struct vxlan_sock *sock4;
#if IS_ENABLED(CONFIG_IPV6)
struct vxlan_sock *sock6;
#endif
unsigned short family = dev->default_dst.remote_ip.sa.sa_family;
sock4 = rtnl_dereference(dev->vn4_sock);
/* The vxlan_sock ... | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 52,277,939,616,884,525,000,000,000,000,000,000,000 | 48 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
static FILE *inc_fopen(const char *file,
StrList **dhead,
const char **found_path,
enum incopen_mode omode,
enum file_flags fmode)
{
StrList *sl;
struct hash_insert hi;
void **hp;
char *path;
FILE *fp = NULL;... | 0 | [
"CWE-125"
] | nasm | 3144e84add8b152cc7a71e44617ce6f21daa4ba3 | 313,337,769,059,595,140,000,000,000,000,000,000,000 | 67 | preproc: Don't access offsting byte on unterminated strings
https://bugzilla.nasm.us/show_bug.cgi?id=3392446
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> |
bool Cluster::AddFrameWithAdditional(const uint8_t* data, uint64_t length,
const uint8_t* additional,
uint64_t additional_length,
uint64_t add_id, uint64_t track_number,
ui... | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 128,622,472,138,481,800,000,000,000,000,000,000,000 | 18 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
static int pnm_getint16(jas_stream_t *in, int *val)
{
int v;
int c;
if ((c = jas_stream_getc(in)) == EOF) {
return -1;
}
v = c & 0xff;
if ((c = jas_stream_getc(in)) == EOF) {
return -1;
}
v = (v << 8) | (c & 0xff);
*val = v;
return 0;
} | 0 | [
"CWE-20",
"CWE-190"
] | jasper | d42b2388f7f8e0332c846675133acea151fc557a | 113,354,905,897,868,970,000,000,000,000,000,000,000 | 17 | The generation of the configuration file jas_config.h has been completely
reworked in order to avoid pollution of the global namespace.
Some problematic types like uchar, ulong, and friends have been replaced
with names with a jas_ prefix.
An option max_samples has been added to the BMP and JPEG decoders to
restrict ... |
gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
{
struct dev_data *dev = get_gadget_data (gadget);
struct usb_request *req = dev->req;
int value = -EOPNOTSUPP;
struct usb_gadgetfs_event *event;
u16 w_value = le16_to_cpu(ctrl->wValue);
u16 w_length = le16_to_cpu(ctrl->wLe... | 0 | [
"CWE-763"
] | linux | 501e38a5531efbd77d5c73c0ba838a889bfc1d74 | 250,545,527,870,408,940,000,000,000,000,000,000,000 | 211 | usb: gadget: clear related members when goto fail
dev->config and dev->hs_config and dev->dev need to be cleaned if
dev_config fails to avoid UAF.
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20211231172138.7993-3-hbh25y@gmail.com
Signed... |
glob_helper(
int fd,
const char *path,
size_t baselen,
size_t namelen,
int dirsep, /* '/' should be placed before appending child entry's name to 'path'. */
rb_pathtype_t pathtype, /* type of 'path' */
struct glob_pattern **beg,
struct glob_pattern **end,
int flags,
const ruby_gl... | 0 | [
"CWE-22"
] | ruby | bd5661a3cbb38a8c3a3ea10cd76c88bbef7871b8 | 35,918,161,368,644,430,000,000,000,000,000,000,000 | 296 | dir.c: check NUL bytes
* dir.c (GlobPathValue): should be used in rb_push_glob only.
other methods should use FilePathValue.
https://hackerone.com/reports/302338
* dir.c (rb_push_glob): expand GlobPathValue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
void LatencyWindow::filterServers(std::vector<ServerDescriptionPtr>* servers) {
servers->erase(std::remove_if(servers->begin(),
servers->end(),
[&](const ServerDescriptionPtr& s) {
// Servers that have made it ... | 0 | [
"CWE-755"
] | mongo | 75f7184eafa78006a698cda4c4adfb57f1290047 | 27,413,533,032,711,210,000,000,000,000,000,000,000 | 12 | SERVER-50170 fix max staleness read preference parameter for server selection |
FilterEncodingNode *FLTParseFilterEncoding(const char *szXMLString)
{
CPLXMLNode *psRoot = NULL, *psChild=NULL, *psFilter=NULL;
FilterEncodingNode *psFilterNode = NULL;
if (szXMLString == NULL || strlen(szXMLString) <= 0 ||
(strstr(szXMLString, "Filter") == NULL))
return NULL;
psRoot = CPLParseXMLSt... | 0 | [
"CWE-200",
"CWE-119"
] | mapserver | e52a436c0e1c5e9f7ef13428dba83194a800f4df | 201,870,521,222,928,230,000,000,000,000,000,000,000 | 50 | security fix (patch by EvenR) |
int cdk_pk_get_nenc(int algo)
{
if (is_RSA(algo))
return 1;
else if (is_ELG(algo))
return 2;
else
return 0;
} | 0 | [
"CWE-119"
] | gnutls | 5140422e0d7319a8e2fe07f02cbcafc4d6538732 | 40,211,399,466,878,243,000,000,000,000,000,000,000 | 9 | opencdk: cdk_pk_get_keyid: fix stack overflow
Issue found using oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=340
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> |
static const char *user_agent(void)
{
const char *custom = git_libgit2__user_agent();
if (custom)
return custom;
return "libgit2 " LIBGIT2_VERSION;
} | 0 | [
"CWE-284"
] | libgit2 | b5c6a1b407b7f8b952bded2789593b68b1876211 | 197,713,875,780,617,160,000,000,000,000,000,000,000 | 9 | http: check certificate validity before clobbering the error variable |
get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
{
MonoMethod **dest = data;
/* skip unmanaged frames */
if (!managed)
return FALSE;
if (m == *dest) {
*dest = NULL;
return FALSE;
}
if (!(*dest)) {
*dest = m;
return TRUE;
}
return FALSE;
} | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 147,212,325,228,164,300,000,000,000,000,000,000,000 | 18 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
f_screenattr(typval_T *argvars, typval_T *rettv)
{
int row;
int col;
int c;
row = (int)tv_get_number_chk(&argvars[0], NULL) - 1;
col = (int)tv_get_number_chk(&argvars[1], NULL) - 1;
if (row < 0 || row >= screen_Rows
|| col < 0 || col >= screen_Columns)
c = -1;
else
c = ScreenAttrs... | 0 | [
"CWE-78"
] | vim | 8c62a08faf89663e5633dc5036cd8695c80f1075 | 196,318,185,498,236,770,000,000,000,000,000,000,000 | 15 | patch 8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others. |
*/
int dev_get_phys_port_id(struct net_device *dev,
struct netdev_phys_item_id *ppid)
{
const struct net_device_ops *ops = dev->netdev_ops;
if (!ops->ndo_get_phys_port_id)
return -EOPNOTSUPP;
return ops->ndo_get_phys_port_id(dev, ppid); | 0 | [
"CWE-400",
"CWE-703"
] | linux | fac8e0f579695a3ecbc4d3cac369139d7f819971 | 337,274,780,859,429,900,000,000,000,000,000,000,000 | 9 | tunnels: Don't apply GRO to multiple layers of encapsulation.
When drivers express support for TSO of encapsulated packets, they
only mean that they can do it for one layer of encapsulation.
Supporting additional levels would mean updating, at a minimum,
more IP length fields and they are unaware of this.
No encapsul... |
static void vrend_init_pstipple_texture(struct vrend_context *ctx)
{
glGenTextures(1, &ctx->pstipple_tex_id);
glBindTexture(GL_TEXTURE_2D, ctx->pstipple_tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, 32, 32, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 163,422,057,461,436,360,000,000,000,000,000,000,000 | 12 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
ar6000_set_multicast_list(struct net_device *dev)
{
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000: Multicast filter not supported\n"));
} | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 156,858,812,329,139,420,000,000,000,000,000,000,000 | 4 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
gboolean btd_adapter_check_oob_handler(struct btd_adapter *adapter)
{
return adapter->oob_handler != NULL;
} | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 182,434,188,970,506,960,000,000,000,000,000,000,000 | 4 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
{
diff_T *dnew;
dnew = ALLOC_ONE(diff_T);
if (dnew != NULL)
{
dnew->df_next = dp;
if (dprev == NULL)
tp->tp_first_diff = dnew;
else
dprev->df_next = dnew;
}
return dnew;
} | 0 | [
"CWE-787"
] | vim | c101abff4c6756db4f5e740fde289decb9452efa | 296,092,754,325,498,140,000,000,000,000,000,000,000 | 15 | patch 8.2.5164: invalid memory access after diff buffer manipulations
Problem: Invalid memory access after diff buffer manipulations.
Solution: Use zero offset when change removes all lines in a diff block. |
int tls1_process_ticket(SSL *s, unsigned char *session_id, int len,
const unsigned char *limit, SSL_SESSION **ret)
{
/* Point after session ID in client hello */
const unsigned char *p = session_id + len;
unsigned short i;
*ret = NULL;
s->tlsext_ticket_expected = 0;
/* If tickets disabled behave as if no ti... | 0 | [
"CWE-19"
] | openssl | 45473632c54947859a731dfe2db087c002ef7aa7 | 49,219,346,951,153,950,000,000,000,000,000,000,000 | 86 | Prevent use of RSA+MD5 in TLS 1.2 by default.
Removing RSA+MD5 from the default signature algorithm list
prevents its use by default.
If a broken implementation attempts to use RSA+MD5 anyway the sanity
checking of signature algorithms will cause a fatal alert. |
static void gic_drop_prio(GICState *s, int cpu, int group)
{
/* Drop the priority of the currently active interrupt in the
* specified group.
*
* Note that we can guarantee (because of the requirement to nest
* GICC_IAR reads [which activate an interrupt and raise priority]
* with GICC_EOIR... | 0 | [
"CWE-787"
] | qemu | edfe2eb4360cde4ed5d95bda7777edcb3510f76a | 185,768,603,381,850,450,000,000,000,000,000,000,000 | 41 | hw/intc/arm_gic: Fix interrupt ID in GICD_SGIR register
Per the ARM Generic Interrupt Controller Architecture specification
(document "ARM IHI 0048B.b (ID072613)"), the SGIINTID field is 4 bit,
not 10:
- 4.3 Distributor register descriptions
- 4.3.15 Software Generated Interrupt Register, GICD_SG
- Table 4-2... |
void Field_time_with_dec::make_field(Send_field *field)
{
Field::make_field(field);
field->decimals= dec;
} | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 130,599,389,553,911,600,000,000,000,000,000,000,000 | 5 | 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... |
std::vector<uint8_t> Binary::raw() {
std::vector<uint8_t> buffer;
Builder::write(*this, buffer);
return buffer;
} | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 129,742,878,816,910,650,000,000,000,000,000,000,000 | 5 | Resolve #764 |
int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr,
struct usb_interface *intf,
u8 *buffer,
int buflen)
{
/* duplicates are ignored */
struct usb_cdc_union_desc *union_header = NULL;
/* duplicates are not tolerated */
struct usb_cdc_header_desc *header = NULL;
struct usb_cdc_ether_desc *ether ... | 0 | [
"CWE-416"
] | linux | 056ad39ee9253873522f6469c3364964a322912b | 297,780,057,904,822,420,000,000,000,000,000,000,000 | 138 | USB: core: Fix free-while-in-use bug in the USB S-Glibrary
FuzzUSB (a variant of syzkaller) found a free-while-still-in-use bug
in the USB scatter-gather library:
BUG: KASAN: use-after-free in atomic_read
include/asm-generic/atomic-instrumented.h:26 [inline]
BUG: KASAN: use-after-free in usb_hcd_unlink_urb+0x5f/0x170... |
static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
{
struct sockaddr_rc *sa = (struct sockaddr_rc *) addr;
struct sock *sk = sock->sk;
BT_DBG("sock %p, sk %p", sock, sk);
if (peer && sk->sk_state != BT_CONNECTED &&
sk->sk_state != BT_CONNECT && sk->sk_state != BT_C... | 0 | [
"CWE-476"
] | linux | 951b6a0717db97ce420547222647bcc40bf1eacd | 29,237,287,055,850,200,000,000,000,000,000,000,000 | 22 | Bluetooth: Fix potential NULL dereference in RFCOMM bind callback
addr can be NULL and it should not be dereferenced before NULL checking.
Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
void __exit btrfs_cleanup_fs_uuids(void)
{
struct btrfs_fs_devices *fs_devices;
while (!list_empty(&fs_uuids)) {
fs_devices = list_entry(fs_uuids.next,
struct btrfs_fs_devices, fs_list);
list_del(&fs_devices->fs_list);
free_fs_devices(fs_devices);
}
} | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 249,843,576,654,077,170,000,000,000,000,000,000,000 | 11 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) {
if (!writer)
return false;
// Subtract one for the void ID and the coded size.
uint64 void_entry_size = size - 1 - GetCodedUIntSize(size - 1);
uint64 void_size = EbmlMasterElementSize(libwebm::kMkvVoid, void_entry_size) +
void_... | 0 | [
"CWE-20"
] | libvpx | 34d54b04e98dd0bac32e9aab0fbda0bf501bc742 | 325,135,286,636,604,320,000,000,000,000,000,000,000 | 35 | update libwebm to libwebm-1.0.0.27-358-gdbf1d10
changelog:
https://chromium.googlesource.com/webm/libwebm/+log/libwebm-1.0.0.27-351-g9f23fbc..libwebm-1.0.0.27-358-gdbf1d10
Change-Id: I28a6b3ae02a53fb1f2029eee11e9449afb94c8e3 |
static PixelList *DestroyPixelList(PixelList *pixel_list)
{
if (pixel_list == (PixelList *) NULL)
return((PixelList *) NULL);
if (pixel_list->skip_list.nodes != (SkipNode *) NULL)
pixel_list->skip_list.nodes=(SkipNode *) RelinquishAlignedMemory(
pixel_list->skip_list.nodes);
pixel_list=(PixelList *)... | 0 | [
"CWE-119",
"CWE-787"
] | ImageMagick | 025e77fcb2f45b21689931ba3bf74eac153afa48 | 271,050,879,420,542,650,000,000,000,000,000,000,000 | 10 | https://github.com/ImageMagick/ImageMagick/issues/1615 |
NTSTATUS UnmountAllDevices (UNMOUNT_STRUCT *unmountRequest, BOOL ignoreOpenFiles)
{
NTSTATUS status = 0;
PDEVICE_OBJECT ListDevice;
int maxUniqueId = LastUniqueVolumeId;
Dump ("Unmounting all volumes\n");
if (unmountRequest)
unmountRequest->HiddenVolumeProtectionTriggered = FALSE;
// Dismount volumes in the ... | 0 | [
"CWE-119",
"CWE-787"
] | VeraCrypt | f30f9339c9a0b9bbcc6f5ad38804af39db1f479e | 112,973,624,502,276,090,000,000,000,000,000,000,000 | 34 | Windows: fix low severity vulnerability in driver that allowed reading 3 bytes of kernel stack memory (with a rare possibility of 25 additional bytes). Reported by Tim Harrison. |
SWFInput_rewind(SWFInput input)
{
SWFInput_seek(input, 0, SEEK_SET);
} | 0 | [
"CWE-190",
"CWE-703"
] | libming | a009a38dce1d9316cad1ab522b813b1d5ba4c62a | 315,252,354,459,291,800,000,000,000,000,000,000,000 | 4 | Fix left shift of a negative value in SWFInput_readSBits. Check for number before before left-shifting by (number-1). |
void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_str,
const NDPI_PROTOCOL_BITMASK *dbm) {
NDPI_PROTOCOL_BITMASK detection_bitmask_local;
NDPI_PROTOCOL_BITMASK *detection_bitmask = &detection_bitmask_local;
u_int32_t a = 0;
NDPI_BITMAS... | 0 | [
"CWE-125"
] | nDPI | 61066fb106efa6d3d95b67e47b662de208b2b622 | 136,425,124,291,585,000,000,000,000,000,000,000,000 | 568 | Added check for heap buffer overflow read |
Block::~Block() { delete[] m_frames; } | 0 | [
"CWE-20"
] | libvpx | 34d54b04e98dd0bac32e9aab0fbda0bf501bc742 | 83,590,953,585,589,865,000,000,000,000,000,000,000 | 1 | update libwebm to libwebm-1.0.0.27-358-gdbf1d10
changelog:
https://chromium.googlesource.com/webm/libwebm/+log/libwebm-1.0.0.27-351-g9f23fbc..libwebm-1.0.0.27-358-gdbf1d10
Change-Id: I28a6b3ae02a53fb1f2029eee11e9449afb94c8e3 |
_gnutls_set_adv_version (gnutls_session_t session, gnutls_protocol_t ver)
{
set_adv_version (session, _gnutls_version_get_major (ver),
_gnutls_version_get_minor (ver));
} | 0 | [
"CWE-189"
] | gnutls | bc8102405fda11ea00ca3b42acc4f4bce9d6e97b | 263,933,733,120,717,900,000,000,000,000,000,000,000 | 5 | Fix GNUTLS-SA-2008-1 security vulnerabilities.
See http://www.gnu.org/software/gnutls/security.html for updates. |
dp_packet_batch_init_packet(struct dp_packet_batch *batch, struct dp_packet *p)
{
dp_packet_batch_init(batch);
batch->count = 1;
batch->packets[0] = p;
} | 0 | [
"CWE-400"
] | ovs | 79349cbab0b2a755140eedb91833ad2760520a83 | 297,057,642,138,962,900,000,000,000,000,000,000,000 | 6 | flow: Support extra padding length.
Although not required, padding can be optionally added until
the packet length is MTU bytes. A packet with extra padding
currently fails sanity checks.
Vulnerability: CVE-2020-35498
Fixes: fa8d9001a624 ("miniflow_extract: Properly handle small IP packets.")
Reported-by: Joakim Hind... |
Supports_Condition_Obj Parser::parse_supports_negation()
{
if (!lex < kwd_not >()) return {};
Supports_Condition_Obj cond = parse_supports_condition_in_parens(/*parens_required=*/true);
return SASS_MEMORY_NEW(Supports_Negation, pstate, cond);
} | 0 | [
"CWE-674"
] | libsass | f2db04883e5fff4e03777dcc1eb60d4373c45be1 | 262,610,715,350,787,600,000,000,000,000,000,000,000 | 6 | Make `parse_css_variable_value` non-recursive
Fixes #2658 stack overflow |
static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
{
hwaddr phys = cpu_get_phys_page_debug(cpu, pc);
if (phys != -1) {
tb_invalidate_phys_addr(cpu->as,
phys | (pc & ~TARGET_PAGE_MASK));
}
} | 0 | [] | qemu | c3c1bb99d1c11978d9ce94d1bdcf0705378c1459 | 223,249,429,362,090,660,000,000,000,000,000,000,000 | 8 | exec: Respect as_tranlsate_internal length clamp
address_space_translate_internal will clamp the *plen length argument
based on the size of the memory region being queried. The iommu walker
logic in addresss_space_translate was ignoring this by discarding the
post fn call value of *plen. Fix by just always using *plen... |
juniper_es_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
struct juniper_ipsec_header {
uint8_t sa_index[2];
uint8_t ttl;
uint8_t type;
uint8_t spi[4];
ui... | 0 | [
"CWE-125"
] | tcpdump | 42073d54c53a496be40ae84152bbfe2c923ac7bc | 172,373,028,326,334,640,000,000,000,000,000,000,000 | 73 | CVE-2017-13004/Juniper: Add a bounds check.
This fixes a buffer over-read discovered by Forcepoint's security
researchers Otto Airamo & Antti Levomäki.
Add tests using the capture files supplied by the reporter(s). |
generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt)
{
MYSQL_RES *result;
MYSQL_ROW row;
unsigned long long counter;
DBUG_ENTER("generate_primary_key_list");
/*
Blackhole is a special case, this allows us to test the upper end
of the server during load runs.
*/
if (opt_only_print... | 0 | [
"CWE-295"
] | mysql-server | b3e9211e48a3fb586e88b0270a175d2348935424 | 46,258,069,554,509,860,000,000,000,000,000,000,000 | 58 | WL#9072: Backport WL#8785 to 5.5 |
static int cit_set_hue(struct gspca_dev *gspca_dev, s32 val)
{
struct sd *sd = (struct sd *) gspca_dev;
switch (sd->model) {
case CIT_MODEL0:
case CIT_MODEL1:
case CIT_IBM_NETCAM_PRO:
/* No hue control for these models */
break;
case CIT_MODEL2:
cit_model2_Packet1(gspca_dev, 0x0024, val);
/* cit_model2_P... | 0 | [
"CWE-476"
] | linux | a246b4d547708f33ff4d4b9a7a5dbac741dc89d8 | 227,329,233,929,467,600,000,000,000,000,000,000,000 | 51 | media: xirlink_cit: add missing descriptor sanity checks
Make sure to check that we have two alternate settings and at least one
endpoint before accessing the second altsetting structure and
dereferencing the endpoint arrays.
This specifically avoids dereferencing NULL-pointers or corrupting
memory when a device does... |
sense_reason_t target_do_xcopy(struct se_cmd *se_cmd)
{
struct se_device *dev = se_cmd->se_dev;
struct xcopy_op *xop;
unsigned int sa;
if (!dev->dev_attrib.emulate_3pc) {
pr_err("EXTENDED_COPY operation explicitly disabled\n");
return TCM_UNSUPPORTED_SCSI_OPCODE;
}
sa = se_cmd->t_task_cdb[1] & 0x1f;
if (sa... | 0 | [
"CWE-22"
] | linux | 2896c93811e39d63a4d9b63ccf12a8fbc226e5e4 | 294,491,176,642,836,900,000,000,000,000,000,000,000 | 42 | scsi: target: Fix XCOPY NAA identifier lookup
When attempting to match EXTENDED COPY CSCD descriptors with corresponding
se_devices, target_xcopy_locate_se_dev_e4() currently iterates over LIO's
global devices list which includes all configured backstores.
This change ensures that only initiator-accessible backstores... |
ves_icall_MonoType_GetElementType (MonoReflectionType *type)
{
MonoClass *class;
MONO_ARCH_SAVE_REGS;
if (!type->type->byref && type->type->type == MONO_TYPE_SZARRAY)
return mono_type_get_object (mono_object_domain (type), &type->type->data.klass->byval_arg);
class = mono_class_from_mono_type (type->type);
/... | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 168,277,730,383,463,520,000,000,000,000,000,000,000 | 22 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
createnode(const char *key, const char *value)
{
struct envnode *node;
node = malloc(sizeof(*node));
if (!node)
err(1, NULL);
node->key = strdup(key);
node->value = strdup(value);
if (!node->key || !node->value)
err(1, NULL);
return node;
} | 0 | [
"CWE-200",
"CWE-909"
] | OpenDoas | 01c658f8c45cb92a343be5f32aa6da70b2032168 | 303,215,787,250,601,640,000,000,000,000,000,000,000 | 13 | redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases. |
restore_visual_mode(void)
{
if (VIsual_mode_orig != NUL)
{
curbuf->b_visual.vi_mode = VIsual_mode_orig;
VIsual_mode_orig = NUL;
}
} | 0 | [
"CWE-416"
] | vim | 35a9a00afcb20897d462a766793ff45534810dc3 | 107,599,206,159,431,450,000,000,000,000,000,000,000 | 8 | 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(). |
TEST_P(Http2MetadataIntegrationTest, TestAddEncodedMetadata) {
config_helper_.addFilter(R"EOF(
name: encode-headers-return-stop-all-filter
)EOF");
initialize();
codec_client_ = makeHttpConnection(lookupPort("http"));
// Upstream responds with headers, data and trailers.
auto response = codec_client_->makeRe... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 303,311,802,198,052,630,000,000,000,000,000,000,000 | 37 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
{
int mm_users = 0;
struct mm_struct *mm = p->mm;
if (mm) {
mm_users = atomic_read(&mm->mm_users);
if (mm_users == 1) {
mm->numa_next_scan = jiffies + msecs_to_jiffies(sysctl_numa_balancing_scan_delay);
mm->numa_scan_seq = 0;
}
... | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 265,610,189,942,662,160,000,000,000,000,000,000,000 | 40 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
uint64_t get_cas_id(void) {
static uint64_t cas_id = 0;
pthread_mutex_lock(&cas_id_lock);
uint64_t next_id = ++cas_id;
pthread_mutex_unlock(&cas_id_lock);
return next_id;
} | 0 | [
"CWE-190"
] | memcached | bd578fc34b96abe0f8d99c1409814a09f51ee71c | 235,001,685,486,293,430,000,000,000,000,000,000,000 | 7 | CVE reported by cisco talos |
inline void init (hb_face_t *face)
{
hb_blob_t *head_blob = OT::Sanitizer<OT::head>::sanitize (face->reference_table (HB_OT_TAG_head));
const OT::head *head = OT::Sanitizer<OT::head>::lock_instance (head_blob);
if ((unsigned int) head->indexToLocFormat > 1 || head->glyphDataFormat != 0)
{
/* U... | 0 | [
"CWE-703"
] | harfbuzz | 63ef0b41dc48d6112d1918c1b1de9de8ea90adb5 | 107,514,828,267,914,480,000,000,000,000,000,000,000 | 21 | [ot-font] Fix hmtx wrong table length check
Discovered by libFuzzer. Ouch!
https://github.com/behdad/harfbuzz/issues/139#issuecomment-148289957 |
static ram_addr_t get_fb_addr(SM501State *s, int crt)
{
return (crt ? s->dc_crt_fb_addr : s->dc_panel_fb_addr) & 0x3FFFFF0;
} | 0 | [
"CWE-190"
] | qemu | b15a22bbcbe6a78dc3d88fe3134985e4cdd87de4 | 65,919,623,857,096,050,000,000,000,000,000,000,000 | 4 | sm501: Replace hand written implementation with pixman where possible
Besides being faster this should also prevent malicious guests to
abuse 2D engine to overwrite data or cause a crash.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-id: 58666389b6cae256e4e972a32c05cf8aa51bffc0.1590089984.git.balaton@eik... |
static int cgw_put_job(struct sk_buff *skb, struct cgw_job *gwj, int type,
u32 pid, u32 seq, int flags)
{
struct cgw_frame_mod mb;
struct rtcanmsg *rtcan;
struct nlmsghdr *nlh;
nlh = nlmsg_put(skb, pid, seq, type, sizeof(*rtcan), flags);
if (!nlh)
return -EMSGSIZE;
rtcan = nlmsg_data(nlh);
rtcan->ca... | 0 | [
"CWE-787"
] | linux | 0aaa81377c5a01f686bcdb8c7a6929a7bf330c68 | 210,671,559,074,796,920,000,000,000,000,000,000,000 | 107 | can: gw: ensure DLC boundaries after CAN frame modification
Muyu Yu provided a POC where user root with CAP_NET_ADMIN can create a CAN
frame modification rule that makes the data length code a higher value than
the available CAN frame data size. In combination with a configured checksum
calculation where the result is... |
inline void BroadcastPow4DSlow(const RuntimeShape& unextended_input1_shape,
const T* input1_data,
const RuntimeShape& unextended_input2_shape,
const T* input2_data,
const RuntimeShape& unextended_... | 0 | [
"CWE-125"
] | tensorflow | 595a65a3e224a0362d7e68c2213acfc2b499a196 | 264,826,384,740,834,370,000,000,000,000,000,000,000 | 32 | Return a TFLite error if gather_nd will result in reading invalid memory
PiperOrigin-RevId: 463054033 |
onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2)
{
syntax->op2 = op2;
} | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 161,158,148,281,441,320,000,000,000,000,000,000,000 | 4 | onig-5.9.2 |
static void io_worker_exit(struct io_worker *worker)
{
struct io_wqe *wqe = worker->wqe;
struct io_wqe_acct *acct = io_wqe_get_acct(wqe, worker);
unsigned nr_workers;
/*
* If we're not at zero, someone else is holding a brief reference
* to the worker. Wait for that to go away.
*/
set_current_state(TASK_INT... | 0 | [] | linux | 181e448d8709e517c9c7b523fcd209f24eb38ca7 | 53,269,034,451,312,280,000,000,000,000,000,000,000 | 42 | io_uring: async workers should inherit the user creds
If we don't inherit the original task creds, then we can confuse users
like fuse that pass creds in the request header. See link below on
identical aio issue.
Link: https://lore.kernel.org/linux-fsdevel/26f0d78e-99ca-2f1b-78b9-433088053a61@scylladb.com/T/#u
Signed... |
u_find_first_changed(void)
{
u_header_T *uhp = curbuf->b_u_newhead;
u_entry_T *uep;
linenr_T lnum;
if (curbuf->b_u_curhead != NULL || uhp == NULL)
return; /* undid something in an autocmd? */
/* Check that the last undo block was for the whole file. */
uep = uhp->uh_entry;
if (uep->ue_... | 0 | [
"CWE-190"
] | vim | 3eb1637b1bba19519885dd6d377bd5596e91d22c | 289,582,915,679,415,360,000,000,000,000,000,000,000 | 30 | patch 8.0.0377: possible overflow when reading corrupted undo file
Problem: Possible overflow when reading corrupted undo file.
Solution: Check if allocated size is not too big. (King) |
void nfs4_schedule_state_manager(struct nfs_client *clp)
{
struct task_struct *task;
if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0)
return;
__module_get(THIS_MODULE);
atomic_inc(&clp->cl_count);
task = kthread_run(nfs4_run_state_manager, clp, "%s-manager",
rpc_peeraddr2str(clp->cl_rpcc... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 305,536,590,457,986,980,000,000,000,000,000,000,000 | 17 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static void i8042_unregister_ports(void)
{
int i;
for (i = 0; i < I8042_NUM_PORTS; i++) {
if (i8042_ports[i].serio) {
serio_unregister_port(i8042_ports[i].serio);
i8042_ports[i].serio = NULL;
}
}
} | 0 | [
"CWE-476"
] | linux | 340d394a789518018f834ff70f7534fc463d3226 | 304,900,190,507,915,800,000,000,000,000,000,000,000 | 11 | Input: i8042 - fix crash at boot time
The driver checks port->exists twice in i8042_interrupt(), first when
trying to assign temporary "serio" variable, and second time when deciding
whether it should call serio_interrupt(). The value of port->exists may
change between the 2 checks, and we may end up calling serio_int... |
static NTSTATUS pdb_samba_dsdb_set_trusted_domain(struct pdb_methods *methods,
const char* domain,
const struct pdb_trusted_domain *td)
{
struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
methods->private_data, struct pdb_samba_dsdb_state);
TALLOC_CTX *tmp_ctx = talloc_stackframe();
bool ... | 0 | [
"CWE-200"
] | samba | 0a3aa5f908e351201dc9c4d4807b09ed9eedff77 | 269,305,439,524,716,460,000,000,000,000,000,000,000 | 253 | CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message
This aims to minimise usage of the error-prone pattern of searching for
a just-added message element in order to make modifications to it (and
potentially finding the wrong element).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009
Signed... |
static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op2;
sub_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC);
if (free_op2.var) {zval... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 135,520,235,508,390,640,000,000,000,000,000,000,000 | 12 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
ofpacts_parse_actions(const char *s, const struct ofpact_parse_params *pp)
{
return ofpacts_parse_copy(s, pp, false, 0);
} | 0 | [
"CWE-416"
] | ovs | 77cccc74deede443e8b9102299efc869a52b65b2 | 189,706,810,760,277,250,000,000,000,000,000,000,000 | 4 | ofp-actions: Fix use-after-free while decoding RAW_ENCAP.
While decoding RAW_ENCAP action, decode_ed_prop() might re-allocate
ofpbuf if there is no enough space left. However, function
'decode_NXAST_RAW_ENCAP' continues to use old pointer to 'encap'
structure leading to write-after-free and incorrect decoding.
==3... |
int sldns_fp2wire_rr_buf(FILE* in, uint8_t* rr, size_t* len, size_t* dname_len,
struct sldns_file_parse_state* parse_state)
{
char line[LDNS_RR_BUF_SIZE+1];
ssize_t size;
/* read an entire line in from the file */
if((size = sldns_fget_token_l(in, line, LDNS_PARSE_SKIP_SPACE,
LDNS_RR_BUF_SIZE, parse_state?&pars... | 0 | [] | unbound | 3f3cadd416d6efa92ff2d548ac090f42cd79fee9 | 321,504,967,289,187,800,000,000,000,000,000,000,000 | 75 | - Fix Out of Bounds Write in sldns_str2wire_str_buf(),
reported by X41 D-Sec. |
static int kssl_test_confound(unsigned char *p)
{
int len = 2;
int xx = 0, yy = 0;
if (*p++ != 0x62) return 0;
if (*p > 0x82) return 0;
switch(*p) {
case 0x82: p++; xx = (*p++ << 8); xx += *p++; break;
case 0x81: p++; xx = *p++; break;
case 0x80: return 0;
default: xx = ... | 0 | [
"CWE-20"
] | openssl | cca1cd9a3447dd067503e4a85ebd1679ee78a48e | 109,916,507,171,177,340,000,000,000,000,000,000,000 | 24 | Submitted by: Tomas Hoger <thoger@redhat.com>
Fix for CVE-2010-0433 where some kerberos enabled versions of OpenSSL
could be crashed if the relevant tables were not present (e.g. chrooted). |
static ThreadId Current() { return ThreadId(GetCurrentThreadId()); } | 0 | [
"CWE-20",
"CWE-119"
] | node | 530af9cb8e700e7596b3ec812bad123c9fa06356 | 28,437,193,348,938,290,000,000,000,000,000,000,000 | 1 | v8: Interrupts must not mask stack overflow.
Backport of https://codereview.chromium.org/339883002 |
job_run(const char *cmd, struct session *s, const char *cwd,
job_update_cb updatecb, job_complete_cb completecb, job_free_cb freecb,
void *data, int flags)
{
struct job *job;
struct environ *env;
pid_t pid;
int nullfd, out[2];
const char *home;
sigset_t set, oldset;
if (socketpair(AF_UNIX, SOCK_STR... | 1 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 319,123,636,416,083,260,000,000,000,000,000,000,000 | 93 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
void blk_account_io_completion(struct request *req, unsigned int bytes)
{
if (blk_do_io_stat(req)) {
const int sgrp = op_stat_group(req_op(req));
struct hd_struct *part;
int cpu;
cpu = part_stat_lock();
part = req->part;
part_stat_add(cpu, part, sectors[sgrp], bytes >> 9);
part_stat_unlock();
}
} | 0 | [
"CWE-416",
"CWE-703"
] | linux | 54648cf1ec2d7f4b6a71767799c45676a138ca24 | 57,184,752,369,100,730,000,000,000,000,000,000,000 | 13 | block: blk_init_allocated_queue() set q->fq as NULL in the fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function... |
icmp6_print(netdissect_options *ndo,
const u_char *bp, u_int length, const u_char *bp2, int fragmented)
{
const struct icmp6_hdr *dp;
const struct ip6_hdr *ip;
const struct ip6_hdr *oip;
const struct udphdr *ouh;
int dport;
const u_char *ep;
u_int prot;
dp = (const struct icmp6_hdr *)bp;
ip = (con... | 0 | [
"CWE-125",
"CWE-787"
] | tcpdump | 67c7126062d59729cd421bb38f9594015c9907ba | 250,164,088,129,964,260,000,000,000,000,000,000,000 | 292 | CVE-2017-13021/ICMP6: Add a missing bounds check.
This fixes a buffer over-read discovered by Bhargava Shastry,
SecT/TU Berlin.
Add a test using the capture file supplied by the reporter(s), modified
so the capture file won't be rejected as an invalid capture. |
int smb_vfs_call_removexattr(struct vfs_handle_struct *handle,
const char *path, const char *name)
{
VFS_FIND(removexattr);
return handle->fns->removexattr(handle, path, name);
} | 0 | [
"CWE-22"
] | samba | bd269443e311d96ef495a9db47d1b95eb83bb8f4 | 71,237,466,588,903,160,000,000,000,000,000,000,000 | 6 | Fix bug 7104 - "wide links" and "unix extensions" are incompatible.
Change parameter "wide links" to default to "no".
Ensure "wide links = no" if "unix extensions = yes" on a share.
Fix man pages to refect this.
Remove "within share" checks for a UNIX symlink set - even if
widelinks = no. The server will not follow t... |
FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, uint32_t value)
{
FLAC__ASSERT(0 != encoder);
FLAC__ASSERT(0 != encoder->private_);
FLAC__ASSERT(0 != encoder->protected_);
if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED)
return false;
encoder->protected_... | 0 | [
"CWE-787"
] | flac | e1575e4a7c5157cbf4e4a16dbd39b74f7174c7be | 137,586,863,387,925,460,000,000,000,000,000,000,000 | 10 | libFlac: Exit at EOS in verify mode
When verify mode is enabled, once decoder flags end of stream,
encode processing is considered complete.
CVE-2021-0561
Signed-off-by: Ralph Giles <giles@thaumas.net> |
find_action_for_path (PolkitAuthority *authority,
const gchar *path,
const gchar *argv1,
gboolean *allow_gui)
{
GList *l;
GList *actions;
gchar *action_id;
GError *error;
actions = NULL;
action_id = NULL;
error = NULL;
*al... | 0 | [
"CWE-787"
] | polkit | a2bf5c9c83b6ae46cbd5c779d3055bff81ded683 | 33,025,562,892,523,320,000,000,000,000,000,000,000 | 69 | pkexec: local privilege escalation (CVE-2021-4034) |
static ssize_t wCountryCodes_show
(struct device *dev, struct device_attribute *attr, char *buf)
{
struct usb_interface *intf = to_usb_interface(dev);
struct acm *acm = usb_get_intfdata(intf);
memcpy(buf, acm->country_codes, acm->country_code_size);
return acm->country_code_size;
} | 0 | [
"CWE-416"
] | linux | c52873e5a1ef72f845526d9f6a50704433f9c625 | 42,475,623,816,352,030,000,000,000,000,000,000,000 | 9 | usb: cdc-acm: make sure a refcount is taken early enough
destroy() will decrement the refcount on the interface, so that
it needs to be taken so early that it never undercounts.
Fixes: 7fb57a019f94e ("USB: cdc-acm: Fix potential deadlock (lockdep warning)")
Cc: stable <stable@vger.kernel.org>
Reported-and-tested-by: ... |
static void renameColumnFunc(
sqlite3_context *context,
int NotUsed,
sqlite3_value **argv
){
sqlite3 *db = sqlite3_context_db_handle(context);
RenameCtx sCtx;
const char *zSql = (const char*)sqlite3_value_text(argv[0]);
const char *zDb = (const char*)sqlite3_value_text(argv[3]);
const char *zTable = (co... | 0 | [
"CWE-674",
"CWE-787"
] | sqlite | 38096961c7cd109110ac21d3ed7dad7e0cb0ae06 | 239,637,400,524,105,980,000,000,000,000,000,000,000 | 157 | Avoid infinite recursion in the ALTER TABLE code when a view contains an unused CTE that references, directly or indirectly, the view itself.
FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5 |
const Network::Connection* ConnectionManagerImpl::ActiveStreamFilterBase::connection() {
return parent_.connection();
} | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 230,367,929,320,331,060,000,000,000,000,000,000,000 | 3 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
char *ciEnv::name_buffer(int req_len) {
if (_name_buffer_len < req_len) {
if (_name_buffer == NULL) {
_name_buffer = (char*)arena()->Amalloc(sizeof(char)*req_len);
_name_buffer_len = req_len;
} else {
_name_buffer =
(char*)arena()->Arealloc(_name_buffer, _name_buffer_len, req_len);
... | 0 | [] | jdk17u | 8be0fc09f0ba2dd1dbfd6627456fa929d5574b04 | 283,881,544,122,744,300,000,000,000,000,000,000,000 | 13 | 8281859: Improve class compilation
Reviewed-by: mbaesken
Backport-of: 3ac62a66efd05d0842076dd4cfbea0e53b12630f |
static bool parse_reconnect(struct pool *pool, json_t *val)
{
char *sockaddr_url, *stratum_port, *tmp;
char *url, *port, address[256];
if (opt_disable_client_reconnect) {
applog(LOG_WARNING, "Stratum client.reconnect forbidden, aborting.");
return false;
}
memset(address, 0, 255);
url = (char *)json_string_... | 1 | [
"CWE-119",
"CWE-787"
] | sgminer | 78cc408369bdbbd440196c93574098d1482efbce | 262,538,429,400,222,800,000,000,000,000,000,000,000 | 46 | stratum: parse_reconnect(): treat pool-sent URL as untrusted.
Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for reminding
that this existed and highlighting the offender.
Also to Luke-jr for actually fixing this in bfgminer. :D |
static void css_clear_dir(struct cgroup_subsys_state *css)
{
struct cgroup *cgrp = css->cgroup;
struct cftype *cfts;
if (!(css->flags & CSS_VISIBLE))
return;
css->flags &= ~CSS_VISIBLE;
if (!css->ss) {
if (cgroup_on_dfl(cgrp))
cfts = cgroup_base_files;
else
cfts = cgroup1_base_files;
cgroup_addrm... | 0 | [
"CWE-416"
] | linux | a06247c6804f1a7c86a2e5398a4c1f1db1471848 | 272,330,328,149,229,500,000,000,000,000,000,000,000 | 22 | psi: Fix uaf issue when psi trigger is destroyed while being polled
With write operation on psi files replacing old trigger with a new one,
the lifetime of its waitqueue is totally arbitrary. Overwriting an
existing trigger causes its waitqueue to be freed and pending poll()
will stumble on trigger->event_wait which w... |
lexer_convert_ident_to_cesu8 (uint8_t *destination_p, /**< destination string */
const uint8_t *source_p, /**< source string */
prop_length_t length) /**< length of destination string */
{
const uint8_t *destination_end_p = destination_p + length;
JERRY_A... | 0 | [
"CWE-288"
] | jerryscript | f3a420b672927037beb4508d7bdd68fb25d2caf6 | 258,979,661,364,513,970,000,000,000,000,000,000,000 | 31 | Fix class static block opening brace parsing (#4942)
The next character should not be consumed after finding the static block opening brace.
This patch fixes #4916.
JerryScript-DCO-1.0-Signed-off-by: Martin Negyokru negyokru@inf.u-szeged.hu |
struct block_device *bdget_disk(struct gendisk *disk, int partno)
{
struct hd_struct *part;
struct block_device *bdev = NULL;
part = disk_get_part(disk, partno);
if (part)
bdev = bdget(part_devt(part));
disk_put_part(part);
return bdev;
} | 0 | [
"CWE-416"
] | linux-stable | 77da160530dd1dc94f6ae15a981f24e5f0021e84 | 244,811,143,114,266,980,000,000,000,000,000,000,000 | 12 | block: fix use-after-free in seq file
I got a KASAN report of use-after-free:
==================================================================
BUG: KASAN: use-after-free in klist_iter_exit+0x61/0x70 at addr ffff8800b6581508
Read of size 8 by task trinity-c1/315
======================================... |
static int selinux_task_kill(struct task_struct *p, struct kernel_siginfo *info,
int sig, const struct cred *cred)
{
u32 secid;
u32 perm;
if (!sig)
perm = PROCESS__SIGNULL; /* null signal; existence test */
else
perm = signal_to_av(sig);
if (!cred)
secid = current_sid();
else
secid = cred_sid(cred);
... | 0 | [
"CWE-349"
] | linux | fb73974172ffaaf57a7c42f35424d9aece1a5af6 | 147,582,066,659,422,190,000,000,000,000,000,000,000 | 17 | selinux: properly handle multiple messages in selinux_netlink_send()
Fix the SELinux netlink_send hook to properly handle multiple netlink
messages in a single sk_buff; each message is parsed and subject to
SELinux access control. Prior to this patch, SELinux only inspected
the first message in the sk_buff.
Cc: stab... |
static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
struct fuse_copy_state *cs)
{
struct fuse_notify_poll_wakeup_out outarg;
int err = -EINVAL;
if (size != sizeof(outarg))
goto err;
err = fuse_copy_one(cs, &outarg, sizeof(outarg));
if (err)
goto err;
fuse_copy_finish(cs);
return fu... | 0 | [
"CWE-120",
"CWE-119",
"CWE-787"
] | linux | c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae | 181,266,382,257,340,660,000,000,000,000,000,000,000 | 20 | fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message
FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the
message processing could overrun and result in a "kernel BUG at
fs/fuse/dev.c:629!"
Reported-by: Han-Wen Nienhuys <hanwenn@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@kern... |
static int ctnetlink_parse_filter(const struct nlattr *attr,
struct ctnetlink_filter *filter)
{
struct nlattr *tb[CTA_FILTER_MAX + 1];
int ret = 0;
ret = nla_parse_nested(tb, CTA_FILTER_MAX, attr, cta_filter_nla_policy,
NULL);
if (ret)
return ret;
if (tb[CTA_FILTER_ORIG_FLAGS]) {
filter->orig... | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 286,822,039,855,744,130,000,000,000,000,000,000,000 | 25 | netfilter: ctnetlink: add a range check for l3/l4 protonum
The indexes to the nf_nat_l[34]protos arrays come from userspace. So
check the tuple's family, e.g. l3num, when creating the conntrack in
order to prevent an OOB memory access during setup. Here is an example
kernel panic on 4.14.180 when userspace passes in ... |
void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Char **attributes)
{
xml_parser *parser = (xml_parser *)userData;
const char **attrs = (const char **) attributes;
char *tag_name;
char *att, *val;
int val_len;
zval *retval, *args[3];
if (parser) {
parser->level++;
tag_name = _x... | 1 | [
"CWE-787"
] | php-src | 7d163e8a0880ae8af2dd869071393e5dc07ef271 | 90,619,281,133,462,650,000,000,000,000,000,000,000 | 81 | truncate results at depth of 255 to prevent corruption |
clientProcessRequest(ConnStateData *conn, const Http1::RequestParserPointer &hp, Http::Stream *context)
{
ClientHttpRequest *http = context->http;
bool mustReplyToOptions = false;
bool expectBody = false;
// We already have the request parsed and checked, so we
// only need to go through the final ... | 0 | [
"CWE-116"
] | squid | 7024fb734a59409889e53df2257b3fc817809fb4 | 1,058,570,020,118,703,000,000,000,000,000,000,000 | 150 | Handle more Range requests (#790)
Also removed some effectively unused code. |
node_new_keep(Node** node, ScanEnv* env)
{
int r;
r = node_new_save_gimmick(node, SAVE_KEEP, env);
if (r != 0) return r;
env->keep_num++;
return ONIG_NORMAL;
} | 0 | [
"CWE-400",
"CWE-399",
"CWE-674"
] | oniguruma | 4097828d7cc87589864fecf452f2cd46c5f37180 | 184,244,115,432,426,200,000,000,000,000,000,000,000 | 10 | fix #147: Stack Exhaustion Problem caused by some parsing functions in regcomp.c making recursive calls to themselves. |
uint decimals() const { return is_created_from_null_item ? 0 : NOT_FIXED_DEC; } | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 249,592,931,773,597,180,000,000,000,000,000,000,000 | 1 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
static int cpu_rt_runtime_write(struct cgroup *cgrp, struct cftype *cft,
s64 val)
{
return sched_group_set_rt_runtime(cgroup_tg(cgrp), val);
} | 0 | [
"CWE-703",
"CWE-835"
] | linux | f26f9aff6aaf67e9a430d16c266f91b13a5bff64 | 47,709,684,255,132,490,000,000,000,000,000,000,000 | 5 | Sched: fix skip_clock_update optimization
idle_balance() drops/retakes rq->lock, leaving the previous task
vulnerable to set_tsk_need_resched(). Clear it after we return
from balancing instead, and in setup_thread_stack() as well, so
no successfully descheduled or never scheduled task has it set.
Need resched confus... |
static void flush_rx_queue(struct tty_struct *tty)
{
struct n_hdlc *n_hdlc = tty2n_hdlc(tty);
struct n_hdlc_buf *buf;
while ((buf = n_hdlc_buf_get(&n_hdlc->rx_buf_list)))
n_hdlc_buf_put(&n_hdlc->rx_free_buf_list, buf);
} | 0 | [
"CWE-362"
] | tty | 82f2341c94d270421f383641b7cd670e474db56b | 302,935,974,501,430,700,000,000,000,000,000,000,000 | 8 | tty: n_hdlc: get rid of racy n_hdlc.tbuf
Currently N_HDLC line discipline uses a self-made singly linked list for
data buffers and has n_hdlc.tbuf pointer for buffer retransmitting after
an error.
The commit be10eb7589337e5defbe214dae038a53dd21add8
("tty: n_hdlc add buffer flushing") introduced racy access to n_hdlc.... |
first_frame,last_frame,step_frame,yuv2rgb);
}
//! Load a list from an image sequence YUV file \newinstance.
static CImgList<T> get_load_yuv(std::FILE *const file,
const unsigned int size_x, const unsigned int size_y=1,
... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 282,675,556,382,409,850,000,000,000,000,000,000,000 | 8 | Fix other issues in 'CImg<T>::load_bmp()'. |
bool DL_Dxf::readDxfGroups(std::istream& stream,
DL_CreationInterface* creationInterface) {
static int line = 1;
// Read one group of the DXF file and chop the lines:
if (DL_Dxf::getStrippedLine(groupCodeTmp, DL_DXF_MAXLINE, stream) &&
DL_Dxf::getStrippedLine(groupVa... | 0 | [
"CWE-191"
] | qcad | 1eeffc5daf5a06cf6213ffc19e95923cdebb2eb8 | 23,503,543,670,760,123,000,000,000,000,000,000,000 | 16 | check vertexIndex which might be -1 for broken DXF |
cr_tknzr_parse_comment (CRTknzr * a_this,
CRString ** a_comment)
{
enum CRStatus status = CR_OK;
CRInputPos init_pos;
guint32 cur_char = 0, next_char= 0;
CRString *comment = NULL;
CRParsingLocation loc = {0} ;
g_return_val_if_fail (a_this && PRIV... | 0 | [
"CWE-119"
] | libcroco | 9ad72875e9f08e4c519ef63d44cdbd94aa9504f7 | 250,279,436,545,821,600,000,000,000,000,000,000,000 | 82 | tknzr: support only max long rgb values
This fixes a possible out of bound when reading rgbs which
are longer than the support MAXLONG |
dissect_kafka_describe_log_dirs_request_partition(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
int offset, kafka_api_version_t api_version _U_)
{
proto_tree_add_item(tree, hf_kafka_partition_id, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
... | 0 | [
"CWE-401"
] | wireshark | f4374967bbf9c12746b8ec3cd54dddada9dd353e | 152,277,977,670,337,840,000,000,000,000,000,000,000 | 8 | Kafka: Limit our decompression size.
Don't assume that the Internet has our best interests at heart when it
gives us the size of our decompression buffer. Assign an arbitrary limit
of 50 MB.
This fixes #16739 in that it takes care of
** (process:17681): WARNING **: 20:03:07.440: Dissector bug, protocol Kafka, in pac... |
int compat_dccp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
if (level != SOL_DCCP)
return inet_csk_compat_getsockopt(sk, level, optname,
optval, optlen);
return do_dccp_getsockopt(sk, level, optname, optval, optlen);
} | 0 | [] | linux-2.6 | 39ebc0276bada8bb70e067cb6d0eb71839c0fb08 | 88,404,922,539,140,070,000,000,000,000,000,000,000 | 8 | [DCCP] getsockopt: Fix DCCP_SOCKOPT_[SEND,RECV]_CSCOV
We were only checking if there was enough space to put the int, but
left len as specified by the (malicious) user, sigh, fix it by setting
len to sizeof(val) and transfering just one int worth of data, the one
asked for.
Also check for negative len values.
Signed... |
void* Init(TfLiteContext* context, const char* buffer, size_t length) {
auto* data = new OpData;
return data;
} | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 291,617,640,139,604,340,000,000,000,000,000,000,000 | 4 | [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... |
_outWindowAgg(StringInfo str, const WindowAgg *node)
{
int i;
WRITE_NODE_TYPE("WINDOWAGG");
_outPlanInfo(str, (const Plan *) node);
WRITE_UINT_FIELD(winref);
WRITE_INT_FIELD(partNumCols);
appendStringInfoString(str, " :partColIdx");
for (i = 0; i < node->partNumCols; i++)
appendStringInfo(str, " %d", nod... | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 99,342,948,924,064,060,000,000,000,000,000,000,000 | 33 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
Field *create_tmp_field_from_field(THD *thd, Field *org_field,
LEX_CSTRING *name, TABLE *table,
Item_field *item)
{
Field *new_field;
new_field= org_field->make_new_field(thd->mem_root, table,
table == org_... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 256,177,715,275,297,100,000,000,000,000,000,000,000 | 32 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
uint64_t ram_bytes_transferred(void)
{
return bytes_transferred;
} | 0 | [
"CWE-20"
] | qemu | 0be839a2701369f669532ea5884c15bead1c6e08 | 158,132,491,429,317,970,000,000,000,000,000,000,000 | 4 | migration: fix parameter validation on ram load
During migration, the values read from migration stream during ram load
are not validated. Especially offset in host_from_stream_offset() and
also the length of the writes in the callers of said function.
To fix this, we need to make sure that the [offset, offset + leng... |
skip_zero(char *s)
{
if (s[0] == '0') {
if (s[1] == ';')
s += 2;
else if (isalpha(UChar(s[1])))
s += 1;
}
return s;
} | 0 | [] | ncurses | 790a85dbd4a81d5f5d8dd02a44d84f01512ef443 | 269,422,395,089,487,560,000,000,000,000,000,000,000 | 10 | ncurses 6.2 - patch 20200531
+ correct configure version-check/warnng for g++ to allow for 10.x
+ re-enable "bel" in konsole-base (report by Nia Huang)
+ add linux-s entry (patch by Alexandre Montaron).
+ drop long-obsolete convert_configure.pl
+ add test/test_parm.c, for checking tparm changes.
+ improve parameter-ch... |
static inline void textdomain_init(void)
{
if (!initialized) {
bindtextdomain(MODULE_NAME, LOCALEDIR);
initialized = 1;
}
return;
} | 0 | [
"CWE-20"
] | samba | f62683956a3b182f6a61cc7a2b4ada2e74cde243 | 133,584,200,064,873,750,000,000,000,000,000,000,000 | 8 | fail authentication for single group name which cannot be converted to sid
furthermore if more than one name is supplied and no sid is converted
then also fail.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=8598
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.