func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
TEST_P(JSITest, JSErrorTest) {
// JSError creation can lead to further errors. Make sure these
// cases are handled and don't cause weird crashes or other issues.
//
// Getting message property can throw
EXPECT_THROW(
eval("var GetMessageThrows = {get message() { throw Error('ex'); }};"
"th... | 0 | [
"CWE-843",
"CWE-125"
] | hermes | fe52854cdf6725c2eaa9e125995da76e6ceb27da | 133,832,568,390,160,470,000,000,000,000,000,000,000 | 63 | [CVE-2020-1911] Look up HostObject computed properties on the right object in the prototype chain.
Summary:
The change in the hermes repository fixes the security vulnerability
CVE-2020-1911. This vulnerability only affects applications which
allow evaluation of uncontrolled, untrusted JavaScript code not
shipped wit... |
static int usersubs_cb(void *rock, const char *key, size_t keylen,
const char *data __attribute__((unused)),
size_t datalen __attribute__((unused)))
{
struct submb_rock *mbrock = (struct submb_rock *) rock;
char mboxname[MAX_MAILBOX_NAME+1];
int r;
/* free pr... | 0 | [
"CWE-20"
] | cyrus-imapd | 6bd33275368edfa71ae117de895488584678ac79 | 315,536,754,619,410,480,000,000,000,000,000,000,000 | 25 | mboxlist: fix uninitialised memory use where pattern is "Other Users" |
int CConnectionTransportUDPBase::SendEncryptedDataChunk( const void *pChunk, int cbChunk, SendPacketContext_t &ctxBase )
{
UDPSendPacketContext_t &ctx = static_cast<UDPSendPacketContext_t &>( ctxBase );
uint8 pkt[ k_cbSteamNetworkingSocketsMaxUDPMsgLen ];
UDPDataMsgHdr *hdr = (UDPDataMsgHdr *)pkt;
hdr->m_unMsgFlag... | 0 | [
"CWE-703"
] | GameNetworkingSockets | d944a10808891d202bb1d5e1998de6e0423af678 | 287,452,089,823,884,100,000,000,000,000,000,000,000 | 54 | Tweak pointer math to avoid possible integer overflow |
bool mobi_is_guide_type(const char *type) {
size_t i = 0;
size_t type_length = strlen(type);
while (mobi_guide_types[i]) {
if (strncmp(mobi_guide_types[i++], type, type_length) == 0) {
return true;
}
}
/* check if "other" type */
if (strncmp(type, "other.", 6) == 0) {... | 0 | [
"CWE-476"
] | libmobi | c0699c8693c47f14a2e57dec7292e862ac7adf9c | 256,616,950,784,242,500,000,000,000,000,000,000,000 | 12 | Fix undefined behavior when passing null to strdup |
static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
MagickBooleanType
status;
MagickOffsetType
currentOffset,
offset,
scene;
MagickSizeType
cc;
PixelInfo
transpix;
QuantizeInfo
*quantize_info;
register ssize_t
x... | 0 | [
"CWE-190"
] | ImageMagick | db5e12e24f1378ce8c93a5c35991dcdd23a67bb0 | 329,505,406,277,318,900,000,000,000,000,000,000,000 | 349 | https://github.com/ImageMagick/ImageMagick/issues/1726 |
TLSContent PlaintextWriteRecordLayer::writeInitialClientHello(
Buf encodedClientHello) const {
return write(
TLSMessage{ContentType::handshake, std::move(encodedClientHello)},
ProtocolVersion::tls_1_0);
} | 0 | [
"CWE-119",
"CWE-835",
"CWE-787"
] | fizz | 40bbb161e72fb609608d53b9d64c56bb961a6ee2 | 125,572,714,623,850,000,000,000,000,000,000,000,000 | 6 | Avoid arithmetic operation on uint16 read from the wire.
Summary:
This could overflow previously.
CVE-2019-3560
Reviewed By: yfeldblum
Differential Revision: D14152362
fbshipit-source-id: c0ebb3fc59b49c7c23e6bcb90458c19cd891be65 |
CImg<T>& equalize(const unsigned int nb_levels, const T& min_value, const T& max_value) {
if (!nb_levels || is_empty()) return *this;
const T
vmin = min_value<max_value?min_value:max_value,
vmax = min_value<max_value?max_value:min_value;
CImg<ulongT> hist = get_histogram(nb_levels,... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 233,067,420,754,389,140,000,000,000,000,000,000,000 | 16 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static void register_hooks(apr_pool_t *p)
{
errorlog_hash = apr_hash_make(p);
ap_register_log_hooks(p);
ap_register_config_hooks(p);
ap_expr_init(p);
/* create_connection and pre_connection should always be hooked
* APR_HOOK_REALLY_LAST by core to give other modules the opportunity
* to i... | 0 | [] | httpd | ecebcc035ccd8d0e2984fe41420d9e944f456b3c | 3,170,177,252,886,498,000,000,000,000,000,000,000 | 65 | Merged r1734009,r1734231,r1734281,r1838055,r1838079,r1840229,r1876664,r1876674,r1876784,r1879078,r1881620,r1887311,r1888871 from trunk:
*) core: Split ap_create_request() from ap_read_request(). [Graham Leggett]
*) core, h2: common ap_parse_request_line() and ap_check_request_header()
code. [Yann Ylavic]
... |
static JSValue js_sys_getenv(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
{
const char *str, *val;
if (!argc) return GF_JS_EXCEPTION(ctx);
str = JS_ToCString(ctx, argv[0]);
if (!str) return GF_JS_EXCEPTION(ctx);
val = getenv(str);
JS_FreeCString(ctx, str);
return val ? JS_NewString(ctx, v... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 39,199,001,189,798,650,000,000,000,000,000,000,000 | 10 | fixed #2138 |
de265_error decoder_context::read_slice_NAL(bitreader& reader, NAL_unit* nal, nal_header& nal_hdr)
{
logdebug(LogHeaders,"---> read slice segment header\n");
// --- read slice header ---
slice_segment_header* shdr = new slice_segment_header;
bool continueDecoding;
de265_error err = shdr->read(&reader,this,... | 0 | [
"CWE-416"
] | libde265 | f538254e4658ef5ea4e233c2185dcbfd165e8911 | 274,974,730,474,827,300,000,000,000,000,000,000,000 | 75 | fix streams where SPS image size changes without refreshing PPS (#299) |
static int __init init_mqueue_fs(void)
{
int error;
mqueue_inode_cachep = kmem_cache_create("mqueue_inode_cache",
sizeof(struct mqueue_inode_info), 0,
SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, init_once);
if (mqueue_inode_cachep == NULL)
return -ENOMEM;
/* ignore failures - they are not fatal */
mq_sysctl_table... | 0 | [
"CWE-416"
] | linux | f991af3daabaecff34684fd51fac80319d1baad1 | 169,389,003,459,034,020,000,000,000,000,000,000,000 | 33 | mqueue: fix a use-after-free in sys_mq_notify()
The retry logic for netlink_attachskb() inside sys_mq_notify()
is nasty and vulnerable:
1) The sock refcnt is already released when retry is needed
2) The fd is controllable by user-space because we already
release the file refcnt
so we when retry but the fd has bee... |
get_trash_dirs_for_mount (GMount *mount)
{
GFile *root;
GFile *trash;
char *relpath;
GList *list;
root = g_mount_get_root (mount);
if (root == NULL) {
return NULL;
}
list = NULL;
if (g_file_is_native (root)) {
relpath = g_strdup_printf (".Trash/%d", getuid ());
trash = g_file_resolve_relative_path (r... | 0 | [] | nautilus | ca2fd475297946f163c32dcea897f25da892b89d | 280,627,059,828,326,600,000,000,000,000,000,000,000 | 38 | Add nautilus_file_mark_desktop_file_trusted(), this now adds a #! line if
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
* libnautilus-private/nautilus-file-operations.h:
Add nautilus_file_mark_desktop_file_trusted(), this now
adds a #! line if th... |
void color_sycc_to_rgb(opj_image_t *img)
{
if (img->numcomps < 3) {
img->color_space = OPJ_CLRSPC_GRAY;
return;
}
if ((img->comps[0].dx == 1)
&& (img->comps[1].dx == 2)
&& (img->comps[2].dx == 2)
&& (img->comps[0].dy == 1)
&& (img->comps[1].dy... | 0 | [
"CWE-119",
"CWE-787"
] | openjpeg | 2e5ab1d9987831c981ff05862e8ccf1381ed58ea | 308,850,589,571,366,050,000,000,000,000,000,000,000 | 34 | color_apply_icc_profile: avoid potential heap buffer overflow
Derived from a patch by Thuan Pham |
static int __init uio_init(void)
{
return init_uio_class();
} | 0 | [
"CWE-119",
"CWE-189",
"CWE-703"
] | linux | 7314e613d5ff9f0934f7a0f74ed7973b903315d1 | 264,800,093,391,216,000,000,000,000,000,000,000,000 | 4 | Fix a few incorrectly checked [io_]remap_pfn_range() calls
Nico Golde reports a few straggling uses of [io_]remap_pfn_range() that
really should use the vm_iomap_memory() helper. This trivially converts
two of them to the helper, and comments about why the third one really
needs to continue to use remap_pfn_range(), ... |
R_API void r_bin_java_print_source_debug_attr_summary(RBinJavaAttrInfo *attr) {
ut32 i = 0;
if (attr == NULL) {
eprintf ("Attempting to print an invalid RBinJavaSourceDebugExtensionAttr *.\n");
return;
}
printf ("Source Debug Extension Attribute Information:\n");
printf (" Attribute Offset: 0x%08"PFMT64x "\n"... | 0 | [
"CWE-119",
"CWE-788"
] | radare2 | 6c4428f018d385fc80a33ecddcb37becea685dd5 | 12,143,744,544,437,124,000,000,000,000,000,000,000 | 16 | Improve boundary checks to fix oobread segfaults ##crash
* Reported by Cen Zhang via huntr.dev
* Reproducer: bins/fuzzed/javaoob-havoc.class |
static struct page *get_next_sit_page(struct f2fs_sb_info *sbi,
unsigned int start)
{
struct sit_info *sit_i = SIT_I(sbi);
struct page *src_page, *dst_page;
pgoff_t src_off, dst_off;
void *src_addr, *dst_addr;
src_off = current_sit_addr(sbi, start);
dst_off = next_sit_addr(sbi, src_off);
/* get current si... | 0 | [
"CWE-20"
] | linux | 638164a2718f337ea224b747cf5977ef143166a4 | 148,142,554,979,343,180,000,000,000,000,000,000,000 | 27 | f2fs: fix potential panic during fstrim
As Ju Hyung Park reported:
"When 'fstrim' is called for manual trim, a BUG() can be triggered
randomly with this patch.
I'm seeing this issue on both x86 Desktop and arm64 Android phone.
On x86 Desktop, this was caused during Ubuntu boot-up. I have a
cronjob installed which c... |
static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
int (*do_msr)(struct kvm_vcpu *vcpu,
unsigned index, u64 *data),
int writeback)
{
struct kvm_msrs msrs;
struct kvm_msr_entry *entries;
int r, n;
unsigned size;
r = -EFAULT;
if (copy_from_user(&msrs, user_msrs, sizeof(msrs)))
... | 0 | [
"CWE-476"
] | linux | e97f852fd4561e77721bb9a4e0ea9d98305b1e93 | 54,602,805,492,039,570,000,000,000,000,000,000,000 | 40 | KVM: X86: Fix scan ioapic use-before-initialization
Reported by syzkaller:
BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8
PGD 80000003ec4da067 P4D 80000003ec4da067 PUD 3f7bfa067 PMD 0
Oops: 0000 [#1] PREEMPT SMP PTI
CPU: 7 PID: 5059 Comm: debug Tainted: G OE 4.19.0-rc5 #16... |
static void mld_query_stop_work(struct inet6_dev *idev)
{
spin_lock_bh(&idev->mc_query_lock);
if (cancel_delayed_work(&idev->mc_query_work))
__in6_dev_put(idev);
spin_unlock_bh(&idev->mc_query_lock);
} | 0 | [
"CWE-703"
] | linux | 2d3916f3189172d5c69d33065c3c21119fe539fc | 129,936,555,443,426,230,000,000,000,000,000,000,000 | 7 | ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
While investigating on why a synchronize_net() has been added recently
in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report()
might drop skbs in some cases.
Discussion about removing synchronize_net() from ipv6_mc_down()
will ha... |
void kvm_arch_hardware_unsetup(void)
{
} | 0 | [
"CWE-399"
] | kvm | 5b40572ed5f0344b9dbee486a17c589ce1abe1a3 | 201,992,460,033,276,700,000,000,000,000,000,000,000 | 3 | KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
If some vcpus are created before KVM_CREATE_IRQCHIP, then
irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading
to potential NULL pointer dereferences.
Fix by:
- ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called
... |
static int irda_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
struct sock *sk;
struct irda_sock *self;
IRDA_DEBUG(2, "%s()\n", __func__);
if (net != &init_net)
return -EAFNOSUPPORT;
/* Check for valid socket type */
switch (sock->type) {
case SOCK_STREAM: /* For TTP con... | 0 | [] | linux | fdac1e0697356ac212259f2147aa60c72e334861 | 118,340,842,922,346,020,000,000,000,000,000,000,000 | 80 | irda: prevent integer underflow in IRLMP_ENUMDEVICES
If the user-provided len is less than the expected offset, the
IRLMP_ENUMDEVICES getsockopt will do a copy_to_user() with a very large
size value. While this isn't be a security issue on x86 because it will
get caught by the access_ok() check, it may leak large amo... |
AP_DECLARE(void) ap_finalize_request_protocol(request_rec *r)
{
int status = ap_discard_request_body(r);
/* tell the filter chain there is no more content coming */
if (status) {
error_output_stream(r, status);
}
if (!r->eos_sent) {
end_output_stream(r);
}
} | 0 | [
"CWE-703"
] | httpd | be0f5335e3e73eb63253b050fdc23f252f5c8ae3 | 234,797,673,076,582,970,000,000,000,000,000,000,000 | 12 | *) SECURITY: CVE-2015-0253 (cve.mitre.org)
core: Fix a crash introduced in with ErrorDocument 400 pointing
to a local URL-path with the INCLUDES filter active, introduced
in 2.4.11. PR 57531. [Yann Ylavic]
Submitted By: ylavic
Committed By: covener
git-svn-id: https://svn.apache.org/repos/asf/http... |
void printServiceList(
service_info *service, Upnp_LogLevel level, Dbg_Module module)
{
while (service) {
if (service->serviceType) {
UpnpPrintf(level,
module,
__FILE__,
__LINE__,
"serviceType: %s\n",
service->serviceType);
}
if (service->serviceId) {
UpnpPrintf(level,
module,
... | 0 | [
"CWE-476"
] | pupnp | c805c1de1141cb22f74c0d94dd5664bda37398e0 | 249,204,720,380,048,430,000,000,000,000,000,000,000 | 68 | Fixes #177: NULL pointer dereference in FindServiceControlURLPath
Also fixes its dual bug in FindServiceEventURLPath. |
int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr)
{
return __ipv6_dev_mc_inc(dev, addr, MCAST_EXCLUDE);
} | 0 | [
"CWE-703"
] | linux | 2d3916f3189172d5c69d33065c3c21119fe539fc | 238,240,589,976,882,540,000,000,000,000,000,000,000 | 4 | ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
While investigating on why a synchronize_net() has been added recently
in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report()
might drop skbs in some cases.
Discussion about removing synchronize_net() from ipv6_mc_down()
will ha... |
inline std::shared_ptr<TTransport> getTransport() {
return ptrans_;
} | 0 | [
"CWE-20",
"CWE-755"
] | fbthrift | 01686e15ec77ccb4d49a77d5bce3a01601e54d64 | 15,976,181,019,822,387,000,000,000,000,000,000,000 | 3 | Throw on skipping an invalid type.
Summary:
Certain values (e.g.) T_STOP should not appear as a skip type. Allowing them to
can cause thrift to loop unboundedly.
Reviewed By: spalamarchuk
Differential Revision: D15102451
fbshipit-source-id: c08d52f44f37e9c212d3480233ac217105586c9f |
static GF_Err gf_m4v_parse_frame_mpeg4(GF_M4VParser *m4v, GF_M4VDecSpecInfo *dsi, u8 *frame_type, u32 *time_inc, u64 *size, u64 *start, Bool *is_coded)
{
u8 go, hasVOP, firstObj, secs;
s32 o_type;
u32 vop_inc = 0;
if (!m4v || !size || !start || !frame_type) return GF_BAD_PARAM;
*size = 0;
firstObj = 1;
hasVOP ... | 0 | [
"CWE-190",
"CWE-787"
] | gpac | 51cdb67ff7c5f1242ac58c5aa603ceaf1793b788 | 220,212,086,834,898,630,000,000,000,000,000,000,000 | 98 | add safety in avc/hevc/vvc sps/pps/vps ID check - cf #1720 #1721 #1722 |
static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
int write)
{
struct page *page;
int ret;
#ifdef CONFIG_STACK_GROWSUP
if (write) {
ret = expand_downwards(bprm->vma, pos);
if (ret < 0)
return NULL;
}
#endif
ret = get_user_pages(current, bprm->mm, pos,
1, write, 1, &page, N... | 0 | [
"CWE-200"
] | linux-2.6 | b66c5984017533316fd1951770302649baf1aa33 | 263,021,762,154,230,200,000,000,000,000,000,000,000 | 47 | exec: do not leave bprm->interp on stack
If a series of scripts are executed, each triggering module loading via
unprintable bytes in the script header, kernel stack contents can leak
into the command line.
Normally execution of binfmt_script and binfmt_misc happens recursively.
However, when modules are enabled, and... |
static double mp_list_width(_cimg_math_parser& mp) {
const unsigned int ind = (unsigned int)cimg::mod((int)_mp_arg(2),mp.imglist.width());
return (double)mp.imglist[ind]._width;
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 291,179,778,517,767,870,000,000,000,000,000,000,000 | 4 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static int imap_make_msg_set (IMAP_DATA* idata, BUFFER* buf, int flag,
int changed, int invert, int* pos)
{
HEADER** hdrs = idata->ctx->hdrs;
int count = 0; /* number of messages in message set */
int match = 0; /* whether current message matches flag condition */
unsigned int sets... | 0 | [
"CWE-78"
] | mutt | 185152818541f5cdc059cbff3f3e8b654fc27c1d | 37,266,239,983,131,356,000,000,000,000,000,000,000 | 84 | Properly quote IMAP mailbox names when (un)subscribing.
When handling automatic subscription (via $imap_check_subscribed), or
manual subscribe/unsubscribe commands, mutt generating a "mailboxes"
command but failed to properly escape backquotes.
Thanks to Jeriko One for the detailed bug report and patch, which this
co... |
h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
... | 1 | [
"CWE-476"
] | libjpeg-turbo | 9120a247436e84c0b4eea828cb11e8f665fcde30 | 31,960,765,257,887,900,000,000,000,000,000,000,000 | 66 | Fix jpeg_skip_scanlines() segfault w/merged upsamp
The additional segfault mentioned in #244 was due to the fact that
the merged upsamplers use a different private structure than the
non-merged upsamplers. jpeg_skip_scanlines() was assuming the latter, so
when merged upsampling was enabled, jpeg_skip_scanlines() clob... |
msg_end(void)
{
/*
* If the string is larger than the window,
* or the ruler option is set and we run into it,
* we have to redraw the window.
* Do not do this if we are abandoning the file or editing the command line.
*/
if (!exiting && need_wait_return && !(State & CMDLINE))
{
wa... | 0 | [
"CWE-416"
] | vim | 9f1a39a5d1cd7989ada2d1cb32f97d84360e050f | 114,536,447,072,558,940,000,000,000,000,000,000,000 | 16 | patch 8.2.4040: keeping track of allocated lines is too complicated
Problem: Keeping track of allocated lines in user functions is too
complicated.
Solution: Instead of freeing individual lines keep them all until the end. |
vncProperties::DialogProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam )
{
// We use the dialog-box's USERDATA to store a _this pointer
// This is set only once WM_INITDIALOG has been recieved, though!
vncProperties *_this = helper::SafeGetWindowUserData<vncProperties>(hwnd);... | 0 | [
"CWE-787"
] | UltraVNC | 36a31b37b98f70c1db0428f5ad83170d604fb352 | 230,356,876,134,111,300,000,000,000,000,000,000,000 | 1,019 | security fix |
parse_paged_cookie( Operation *op, SlapReply *rs )
{
int rc = LDAP_SUCCESS;
PagedResultsState *ps = op->o_pagedresults_state;
/* this function must be invoked only if the pagedResults
* control has been detected, parsed and partially checked
* by the frontend */
assert( get_pagedresults( op ) > SLAP_CONTROL_I... | 0 | [
"CWE-89"
] | openldap | 40f3ae4f5c9a8baf75b237220f62c436a571d66e | 154,342,311,821,255,900,000,000,000,000,000,000,000 | 44 | ITS#9815 slapd-sql: escape filter values
Escape filter values to slapd-sql (CVE-2022-29155) |
void tpm_dev_release(struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
tpm_dev_vendor_release(chip);
chip->release(dev);
kfree(chip);
} | 0 | [
"CWE-200"
] | linux | 1309d7afbed112f0e8e90be9af975550caa0076b | 245,015,322,373,847,720,000,000,000,000,000,000,000 | 9 | char/tpm: Fix unitialized usage of data buffer
This patch fixes information leakage to the userspace by initializing
the data buffer to zero.
Reported-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Marcel Selhorst <m.selhorst@sirrix.com>
[ Also re... |
goto_tabpage(int n)
{
tabpage_T *tp = NULL; // shut up compiler
tabpage_T *ttp;
int i;
if (text_locked())
{
// Not allowed when editing the command line.
text_locked_msg();
return;
}
CHECK_CMDWIN;
// If there is only one it can't work.
if (first_tabpage->tp_next == NULL)
{... | 0 | [
"CWE-476"
] | vim | 0f6e28f686dbb59ab3b562408ab9b2234797b9b1 | 2,901,400,688,321,336,000,000,000,000,000,000,000 | 67 | 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. |
static int php_libxml_streams_IO_close(void *context)
{
TSRMLS_FETCH();
return php_stream_close((php_stream*)context);
} | 0 | [
"CWE-200"
] | php-src | 8e76d0404b7f664ee6719fd98f0483f0ac4669d6 | 159,804,242,076,609,870,000,000,000,000,000,000,000 | 5 | Fixed external entity loading |
int bind_mount_fd_to_path(int src, const char *destname) {
char *proc;
if (asprintf(&proc, "/proc/self/fd/%d", src) < 0)
errExit("asprintf");
int rv = mount(proc, destname, NULL, MS_BIND|MS_REC, NULL);
if (rv < 0 && arg_debug)
printf("Failed mount: %s\n", strerror(errno));
free(proc);
return rv;
} | 0 | [
"CWE-269",
"CWE-94"
] | firejail | 27cde3d7d1e4e16d4190932347c7151dc2a84c50 | 55,925,496,346,606,570,000,000,000,000,000,000,000 | 12 | fixing CVE-2022-31214 |
int blobAddData(blob *b, const unsigned char *data, size_t len)
{
#if HAVE_CLI_GETPAGESIZE
static int pagesize;
int growth;
#endif
assert(b != NULL);
#ifdef CL_DEBUG
assert(b->magic == BLOBCLASS);
#endif
assert(data != NULL);
if (len == 0)
return 0;
if (b->isClosed) {
/*
... | 1 | [
"CWE-476"
] | clamav-devel | 8bb3716be9c7ab7c6a3a1889267b1072f48af87b | 212,045,518,553,265,200,000,000,000,000,000,000,000 | 85 | fuzz-22348 null deref in egg utf8 conversion
Corrected memory leaks and a null dereference in the egg utf8 conversion. |
int mp_2expt(fp_int* a, int b)
{
fp_2expt(a, b);
return MP_OKAY;
} | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 124,728,551,185,596,300,000,000,000,000,000,000,000 | 5 | 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. |
TEST(QueryProjectionTest, SortKeyMetaProjectionDoesNotRequireDocument) {
auto proj = createProjection("{}", "{a: 1, foo: {$meta: 'sortKey'}, _id: 0}");
ASSERT_TRUE(proj.metadataDeps()[DocumentMetadataFields::kSortKey]);
ASSERT_FALSE(proj.requiresDocument());
ASSERT_FALSE(proj.requiresMatchDetails());
... | 0 | [
"CWE-732"
] | mongo | cd583b6c4d8aa2364f255992708b9bb54e110cf4 | 5,450,124,920,091,118,000,000,000,000,000,000,000 | 9 | SERVER-53929 Add stricter parser checks around positional projection |
ReverseVideo(on)
int on;
{
if (display && D_revvid != on && D_CVR)
{
D_revvid = on;
if (D_revvid)
AddCStr(D_CVR);
else
AddCStr(D_CVN);
}
} | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 82,443,184,124,915,000,000,000,000,000,000,000,000 | 12 | ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.
Tested with gnome-terminal and xterm. When called with "?" argument the
current background color ... |
xfs_attr_filter(
u32 ioc_flags)
{
if (ioc_flags & XFS_IOC_ATTR_ROOT)
return XFS_ATTR_ROOT;
if (ioc_flags & XFS_IOC_ATTR_SECURE)
return XFS_ATTR_SECURE;
return 0;
} | 0 | [
"CWE-125"
] | linux | 983d8e60f50806f90534cc5373d0ce867e5aaf79 | 11,484,925,027,250,340,000,000,000,000,000,000,000 | 9 | xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
The old ALLOCSP/FREESP ioctls in XFS can be used to preallocate space at
the end of files, just like fallocate and RESVSP. Make the behavior
consistent with the other ioctls.
Reported-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Darric... |
dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
int num, size_t size, off_t fsize, int *flags)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
size_t offset, len;
unsigned char nbuf[BUFSIZ];
ssize_t bufsize;
if (size != xph_sizeof) {
if (file_printf(ms, ", corrupted program header size") == -1... | 1 | [
"CWE-20",
"CWE-703"
] | file | 445c8fb0ebff85195be94cd9f7e1df89cade5c7f | 167,181,215,373,437,700,000,000,000,000,000,000,000 | 55 | Bail out on partial reads, from Alexander Cherepanov |
pax_decode_header (struct tar_sparse_file *file)
{
if (file->stat_info->sparse_major > 0)
{
uintmax_t u;
char nbuf[UINTMAX_STRSIZE_BOUND];
union block *blk;
char *p;
size_t i;
#define COPY_BUF(b,buf,src) do \
{ ... | 1 | [] | tar | c15c42ccd1e2377945fd0414eca1a49294bff454 | 172,138,967,852,858,730,000,000,000,000,000,000,000 | 78 | Fix CVE-2018-20482
* NEWS: Update.
* src/sparse.c (sparse_dump_region): Handle short read condition.
(sparse_extract_region,check_data_region): Fix dumped_size calculation.
Handle short read condition.
(pax_decode_header): Fix dumped_size calculation.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at: Likew... |
int tracing_alloc_snapshot(void)
{
struct trace_array *tr = &global_trace;
int ret;
ret = tracing_alloc_snapshot_instance(tr);
WARN_ON(ret < 0);
return ret;
} | 0 | [
"CWE-416"
] | linux | 15fab63e1e57be9fdb5eec1bbc5916e9825e9acb | 110,174,602,548,892,100,000,000,000,000,000,000,000 | 10 | fs: prevent page refcount overflow in pipe_buf_get
Change pipe_buf_get() to return a bool indicating whether it succeeded
in raising the refcount of the page (if the thing in the pipe is a page).
This removes another mechanism for overflowing the page refcount. All
callers converted to handle a failure.
Reported-by:... |
longlong Item_func_bit_and::val_int()
{
DBUG_ASSERT(fixed == 1);
ulonglong arg1= (ulonglong) args[0]->val_int();
if (args[0]->null_value)
{
null_value=1; /* purecov: inspected */
return 0; /* purecov: inspected */
}
ulonglong arg2= (ulonglong) args[1]->val_int();
if (args[1]->null_value)
{
n... | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 130,149,384,454,091,100,000,000,000,000,000,000,000 | 18 | 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 ... |
zcvlit(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
ref *aop;
check_op(1);
aop = ACCESS_REF(op);
r_clear_attrs(aop, a_executable);
return 0;
} | 0 | [] | ghostpdl | 0edd3d6c634a577db261615a9dc2719bca7f6e01 | 230,933,996,620,047,000,000,000,000,000,000,000,000 | 10 | Bug 699659: Don't just assume an object is a t_(a)struct |
void GrpcHealthCheckerImpl::GrpcActiveHealthCheckSession::onInterval() {
if (!client_) {
Upstream::Host::CreateConnectionData conn =
host_->createHealthCheckConnection(parent_.dispatcher_, parent_.transportSocketOptions(),
parent_.transportSocketMatchMetadata().g... | 0 | [
"CWE-476"
] | envoy | 9b1c3962172a972bc0359398af6daa3790bb59db | 298,000,534,470,327,370,000,000,000,000,000,000,000 | 46 | healthcheck: fix grpc inline removal crashes (#749)
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Pradeep Rao <pcrao@google.com> |
PHP_FUNCTION(openssl_csr_export)
{
X509_REQ * csr;
zval * zcsr = NULL, *zout=NULL;
zend_bool notext = 1;
BIO * bio_out;
long csr_resource;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|b", &zcsr, &zout, ¬ext) == FAILURE) {
return;
}
RETVAL_FALSE;
csr = php_openssl_csr_from_zval(&zcsr, 0, &cs... | 0 | [
"CWE-200"
] | php-src | 270a406ac94b5fc5cc9ef59fc61e3b4b95648a3e | 211,074,022,168,298,840,000,000,000,000,000,000,000 | 42 | Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only |
static u32 gf_isom_probe_type(u32 type)
{
switch (type) {
case GF_ISOM_BOX_TYPE_FTYP:
case GF_ISOM_BOX_TYPE_MOOV:
return 2;
#ifndef GPAC_DISABLE_ISOM_FRAGMENTS
case GF_ISOM_BOX_TYPE_MOOF:
case GF_ISOM_BOX_TYPE_STYP:
case GF_ISOM_BOX_TYPE_SIDX:
case GF_ISOM_BOX_TYPE_EMSG:
case GF_ISOM_BOX_TYPE_PRFT:
//we m... | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 140,086,775,456,306,980,000,000,000,000,000,000,000 | 34 | fixed #1706 |
void tls1_free(SSL *s)
{
OPENSSL_free(s->tlsext_session_ticket);
ssl3_free(s);
} | 0 | [
"CWE-20"
] | openssl | 4ad93618d26a3ea23d36ad5498ff4f59eff3a4d2 | 136,169,811,976,986,610,000,000,000,000,000,000,000 | 5 | 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... |
zabortpdf14devicefilter(i_ctx_t *i_ctx_p)
{
return gs_abort_pdf14trans_device(igs);
} | 0 | [
"CWE-704"
] | ghostpdl | 548bb434e81dadcc9f71adf891a3ef5bea8e2b4e | 163,893,091,182,125,890,000,000,000,000,000,000,000 | 4 | PS interpreter - add some type checking
These were 'probably' safe anyway, since they mostly treat the objects
as integers without checking, which at least can't result in a crash.
Nevertheless, we ought to check.
The return from comparedictkeys could be wrong if one of the keys had
a value which was not an array, i... |
BGD_DECLARE(void *) gdImageWBMPPtr(gdImagePtr im, int *size, int fg)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
if (out == NULL) return NULL;
if (!_gdImageWBMPCtx(im, fg, out)) {
rv = gdDPExtractData(out, size);
} else {
rv = NULL;
}
out->gd_free(out);
return rv;
} | 0 | [
"CWE-415"
] | libgd | 553702980ae89c83f2d6e254d62cf82e204956d0 | 208,032,809,019,355,720,000,000,000,000,000,000,000 | 13 | Fix #492: Potential double-free in gdImage*Ptr()
Whenever `gdImage*Ptr()` calls `gdImage*Ctx()` and the latter fails, we
must not call `gdDPExtractData()`; otherwise a double-free would
happen. Since `gdImage*Ctx()` are void functions, and we can't change
that for BC reasons, we're introducing static helpers which ar... |
static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
{
struct input_dev *dev = to_input_dev(device);
INPUT_ADD_HOTPLUG_VAR("PRODUCT=%x/%x/%x/%x",
dev->id.bustype, dev->id.vendor,
dev->id.product, dev->id.version);
if (dev->name)
INPUT_ADD_HOTPLUG_VAR("NAME=\"%s\"", dev->name);
... | 0 | [
"CWE-703",
"CWE-787"
] | linux | cb222aed03d798fc074be55e59d9a112338ee784 | 286,447,909,778,390,800,000,000,000,000,000,000,000 | 38 | Input: add safety guards to input_set_keycode()
If we happen to have a garbage in input device's keycode table with values
too big we'll end up doing clear_bit() with offset way outside of our
bitmaps, damaging other objects within an input device or even outside of
it. Let's add sanity checks to the returned old keyc... |
static void d_shrink_add(struct dentry *dentry, struct list_head *list)
{
D_FLAG_VERIFY(dentry, 0);
list_add(&dentry->d_lru, list);
dentry->d_flags |= DCACHE_SHRINK_LIST | DCACHE_LRU_LIST;
this_cpu_inc(nr_dentry_unused);
} | 0 | [
"CWE-362",
"CWE-399"
] | linux | 49d31c2f389acfe83417083e1208422b4091cd9e | 30,567,276,210,353,040,000,000,000,000,000,000,000 | 7 | dentry name snapshots
take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified). In either case the pointer to stable
string is stored into the same st... |
int RGWCopyObj_ObjStore_SWIFT::init_dest_policy()
{
dest_policy.create_default(s->user->user_id, s->user->display_name);
return 0;
} | 0 | [
"CWE-617"
] | ceph | f44a8ae8aa27ecef69528db9aec220f12492810e | 18,660,351,842,728,472,000,000,000,000,000,000,000 | 6 | rgw: RGWSwiftWebsiteHandler::is_web_dir checks empty subdir_name
checking for empty name avoids later assertion in RGWObjectCtx::set_atomic
Fixes: CVE-2021-3531
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7196a469b4470f3c8628489df9a41ec8b... |
mysql_query(MYSQL *mysql, const char *query)
{
return mysql_real_query(mysql,query, (unsigned long) strlen(query));
} | 0 | [] | mariadb-connector-c | 27b2f3d1f1550dfaee0f63a331a406ab31c1b37e | 208,668,653,661,987,100,000,000,000,000,000,000,000 | 4 | various checks for corrupted packets in the protocol
also: check the return value of unpack_fields() |
bool get_date_from_item(Item *item, MYSQL_TIME *ltime, ulonglong fuzzydate)
{
bool rc= item->get_date(ltime, fuzzydate);
null_value= MY_TEST(rc || item->null_value);
return rc;
} | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 117,489,778,135,229,180,000,000,000,000,000,000,000 | 6 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
void ssl_hmac_free(SSL_HMAC *ctx)
{
if (ctx != NULL) {
EVP_MAC_CTX_free(ctx->ctx);
#ifndef OPENSSL_NO_DEPRECATED_3_0
HMAC_CTX_free(ctx->old_ctx);
#endif
OPENSSL_free(ctx);
}
} | 0 | [
"CWE-476"
] | openssl | a87f3fe01a5a894aa27ccd6a239155fd129988e4 | 100,319,861,664,385,930,000,000,000,000,000,000,000 | 10 | Fix NULL dereference in SSL_check_chain() for TLS 1.3
In the tls1_check_sig_alg() helper function, we loop through the list of
"signature_algorithms_cert" values received from the client and attempt
to look up each one in turn in our internal table that maps wire
codepoint to string-form name, digest and/or signature ... |
static OPJ_BOOL opj_j2k_get_end_header(opj_j2k_t *p_j2k,
struct opj_stream_private *p_stream,
struct opj_event_mgr * p_manager)
{
/* preconditions */
assert(p_j2k != 00);
assert(p_manager != 00);
assert(p_stream != 00);
O... | 0 | [
"CWE-416",
"CWE-787"
] | openjpeg | 4241ae6fbbf1de9658764a80944dc8108f2b4154 | 15,189,206,650,974,840,000,000,000,000,000,000,000 | 15 | Fix assertion in debug mode / heap-based buffer overflow in opj_write_bytes_LE for Cinema profiles with numresolutions = 1 (#985) |
static int stbi__pnm_isspace(char c)
{
return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r';
} | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 317,972,076,930,345,200,000,000,000,000,000,000,000 | 4 | 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. |
static vpx_codec_err_t decoder_get_si(vpx_codec_alg_priv_t *ctx,
vpx_codec_stream_info_t *si) {
const size_t sz = (si->sz >= sizeof(vp9_stream_info_t))
? sizeof(vp9_stream_info_t)
: sizeof(vpx_codec_stream_info_t);
memcpy(si, &ctx... | 0 | [
"CWE-125"
] | libvpx | 0681cff1ad36b3ef8ec242f59b5a6c4234ccfb88 | 91,347,364,578,631,660,000,000,000,000,000,000,000 | 10 | vp9: fix OOB read in decoder_peek_si_internal
Profile 1 or 3 bitstreams may require 11 bytes for the header in the
intra-only case.
Additionally add a check on the bit reader's error handler callback to
ensure it's non-NULL before calling to avoid future regressions.
This has existed since at least (pre-1.4.0):
09bf... |
cli_safe_read(MYSQL *mysql)
{
NET *net= &mysql->net;
ulong len=0;
restart:
if (net->vio != 0)
len=my_net_read(net);
if (len == packet_error || len == 0)
{
DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %lu",
vio_description(net->vio),len));
#ifdef MYSQL_SERVER
if (net->vio && v... | 0 | [
"CWE-254"
] | server | f0d774d48416bb06063184380b684380ca005a41 | 96,983,777,793,987,620,000,000,000,000,000,000,000 | 83 | MDEV-9212 ssl-validate-cert incorrect hostname check
Reimplement ssl_verify_server_cert() using the logic
from https://wiki.openssl.org/index.php/Hostname_validation
The bug was discovered by Alex Gaynor. |
*/
static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC)
{
php_wddx_add_chunk_static(packet, WDDX_STRING_S);
if (Z_STRLEN_P(var) > 0) {
char *buf;
size_t buf_len;
buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), &buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
php_wddx_a... | 0 | [
"CWE-476"
] | php-src | 6045de69c7dedcba3eadf7c4bba424b19c81d00d | 161,497,379,383,320,910,000,000,000,000,000,000,000 | 16 | Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
Proper soltion would be to call serialize/unserialize and deal with the result,
but this requires more work that should be done by wddx maintainer (not me). |
static int propfind_calcompset(const xmlChar *name, xmlNsPtr ns,
struct propfind_ctx *fctx,
xmlNodePtr resp __attribute__((unused)),
struct propstat propstat[],
void *rock __attribute__((unused)))
{
struct buf attrib = BUF_INITIALIZER;
const char *prop_annot =
ANNOT_NS "... | 0 | [
"CWE-787"
] | cyrus-imapd | a5779db8163b99463e25e7c476f9cbba438b65f3 | 218,870,628,316,639,500,000,000,000,000,000,000,000 | 47 | HTTP: don't overrun buffer when parsing strings with sscanf() |
explicit Dataset(OpKernelContext* ctx,
const sparse::SparseTensor& sparse_tensor)
: DatasetBase(DatasetContext(ctx)),
sparse_tensor_(sparse_tensor),
dtypes_({DT_INT64, sparse_tensor.dtype(), DT_INT64}),
shapes_({{-1, sparse_tensor.dims() - 1},
{-1},
... | 0 | [
"CWE-476"
] | tensorflow | 02cc160e29d20631de3859c6653184e3f876b9d7 | 158,590,103,727,388,370,000,000,000,000,000,000,000 | 8 | Prevent nullptr deref in SparseTensorSliceDataset
The arguments must determine a valid sparse tensor. This means that when indices are empty then the values must be empty too (and the reverse).
Also added test, by modifying existing test with empty sparse tensor to now run with an invalid sparse tensor input.
PiperO... |
string_capitalize(PyStringObject *self)
{
char *s = PyString_AS_STRING(self), *s_new;
Py_ssize_t i, n = PyString_GET_SIZE(self);
PyObject *newobj;
newobj = PyString_FromStringAndSize(NULL, n);
if (newobj == NULL)
return NULL;
s_new = PyString_AsString(newobj);
if (0 < n) {
i... | 0 | [
"CWE-190"
] | cpython | c3c9db89273fabc62ea1b48389d9a3000c1c03ae | 271,068,291,659,710,200,000,000,000,000,000,000,000 | 28 | [2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174) |
kadm5_delete_principal(void *server_handle, krb5_principal principal)
{
unsigned int ret;
kadm5_policy_ent_rec polent;
krb5_db_entry *kdb;
osa_princ_ent_rec adb;
kadm5_server_handle_t handle = server_handle;
CHECK_HANDLE(server_handle);
krb5_cl... | 0 | [
"CWE-703"
] | krb5 | c5be6209311d4a8f10fda37d0d3f876c1b33b77b | 141,114,695,448,764,350,000,000,000,000,000,000,000 | 54 | Null pointer deref in kadmind [CVE-2012-1013]
The fix for #6626 could cause kadmind to dereference a null pointer if
a create-principal request contains no password but does contain the
KRB5_KDB_DISALLOW_ALL_TIX flag (e.g. "addprinc -randkey -allow_tix
name"). Only clients authorized to create principals can trigger ... |
static void __io_req_task_cancel(struct io_kiocb *req, int error)
{
struct io_ring_ctx *ctx = req->ctx;
spin_lock_irq(&ctx->completion_lock);
io_cqring_fill_event(req, error);
io_commit_cqring(ctx);
spin_unlock_irq(&ctx->completion_lock);
io_cqring_ev_posted(ctx);
req_set_fail_links(req);
io_double_put_req(re... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 45,434,512,752,094,830,000,000,000,000,000,000,000 | 13 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
static void sixpack_write_wakeup(struct tty_struct *tty)
{
struct sixpack *sp = sp_get(tty);
int actual;
if (!sp)
return;
if (sp->xleft <= 0) {
/* Now serial buffer is almost free & we can start
* transmission of another packet */
sp->dev->stats.tx_packets++;
clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)... | 0 | [
"CWE-787"
] | linux | 19d1532a187669ce86d5a2696eb7275310070793 | 165,766,036,479,775,700,000,000,000,000,000,000,000 | 26 | net: 6pack: fix slab-out-of-bounds in decode_data
Syzbot reported slab-out-of bounds write in decode_data().
The problem was in missing validation checks.
Syzbot's reproducer generated malicious input, which caused
decode_data() to be called a lot in sixpack_decode(). Since
rx_count_cooked is only 400 bytes and noone... |
int unit_start(Unit *u) {
UnitActiveState state;
Unit *following;
int r;
assert(u);
/* If this is already started, then this will succeed. Note that this will even succeed if this unit
* is not startable by the user. This is relied on to detect when we need to wait for... | 0 | [
"CWE-269"
] | systemd | bf65b7e0c9fc215897b676ab9a7c9d1c688143ba | 198,110,562,644,662,450,000,000,000,000,000,000,000 | 83 | core: imply NNP and SUID/SGID restriction for DynamicUser=yes service
Let's be safe, rather than sorry. This way DynamicUser=yes services can
neither take benefit of, nor create SUID/SGID binaries.
Given that DynamicUser= is a recent addition only we should be able to
get away with turning this on, even though this i... |
static int get_vdev_port_node_info(struct mdesc_handle *md, u64 node,
union md_node_info *node_info)
{
const u64 *parent_cfg_hdlp;
const char *name;
const u64 *idp;
/*
* Virtual device nodes are distinguished by:
* 1. "id" property
* 2. "name" property
* 3. parent node "cfg-handle" property
*/
id... | 1 | [
"CWE-476"
] | sparc | 80caf43549e7e41a695c6d1e11066286538b336f | 177,015,394,107,935,270,000,000,000,000,000,000,000 | 26 | mdesc: fix a missing-check bug in get_vdev_port_node_info()
In get_vdev_port_node_info(), 'node_info->vdev_port.name' is allcoated
by kstrdup_const(), and it returns NULL when fails. So
'node_info->vdev_port.name' should be checked.
Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Signed-off-by: David S. Miller <d... |
static int io_recvmsg_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
#if defined(CONFIG_NET)
struct io_sr_msg *sr = &req->sr_msg;
struct io_async_ctx *io = req->io;
int ret;
sr->msg_flags = READ_ONCE(sqe->msg_flags);
sr->msg = u64_to_user_ptr(READ_ONCE(sqe->addr));
sr->len = READ_ONCE(sqe->le... | 0 | [] | linux | ff002b30181d30cdfbca316dadd099c3ca0d739c | 51,763,739,399,614,640,000,000,000,000,000,000,000 | 25 | io_uring: grab ->fs as part of async preparation
This passes it in to io-wq, so it assumes the right fs_struct when
executing async work that may need to do lookups.
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
const struct sctp_bind_addr *bp,
gfp_t gfp, int vparam_len)
{
struct sctp_supported_ext_param ext_param;
struct sctp_adaptation_ind_param aiparam;
struct sctp_paramhdr *auth_chunks = NULL;
struct sctp_paramhdr *auth_hmacs = NULL;
st... | 0 | [
"CWE-704"
] | linux | a2d859e3fc97e79d907761550dbc03ff1b36479c | 280,530,790,621,307,530,000,000,000,000,000,000,000 | 172 | sctp: account stream padding length for reconf chunk
sctp_make_strreset_req() makes repeated calls to sctp_addto_chunk()
which will automatically account for padding on each call. inreq and
outreq are already 4 bytes aligned, but the payload is not and doing
SCTP_PAD4(a + b) (which _sctp_make_chunk() did implicitly he... |
size_t node_def_count() const override { return graph_def_.node().size(); } | 0 | [
"CWE-125",
"CWE-369",
"CWE-908"
] | tensorflow | 0cc38aaa4064fd9e79101994ce9872c6d91f816b | 238,298,430,597,127,100,000,000,000,000,000,000,000 | 1 | Prevent unitialized memory access in `GraphConstructor::MakeEdge`
The `MakeEdge` implementation assumes that there exists an output at `output_index` of `src` node and an input at `input_index` of `dst` node. However, if this is not the case this results in accessing data out of bounds. Because we are accessing an arr... |
static int read_one_chunk(struct btrfs_fs_info *fs_info, struct btrfs_key *key,
struct extent_buffer *leaf,
struct btrfs_chunk *chunk)
{
struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
struct map_lookup *map;
struct extent_map *em;
u64 logical;
u64 length;
u64 devid;
u8 uuid[BTRFS_UUID_SI... | 1 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 99,345,876,596,157,940,000,000,000,000,000,000,000 | 104 | 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... |
bool Helper::isMounted(const QString &device)
{
const QJsonArray &array = getBlockDevices("-l " + device);
for (const QJsonValue &part : array) {
const QJsonObject &obj = part.toObject();
if (!obj.value("mountpoint").isNull())
return true;
}
return false;
} | 0 | [
"CWE-59",
"CWE-61"
] | deepin-clone | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | 327,204,265,681,256,440,000,000,000,000,000,000,000 | 13 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 |
static int xfrm_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
const struct xfrm_migrate *m, int num_migrate,
const struct xfrm_kmaddress *k)
{
return -ENOPROTOOPT;
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 225,175,762,422,454,640,000,000,000,000,000,000,000 | 6 | 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.
... |
static inline unsigned xfrm6_tunnel_spi_hash_byaddr(xfrm_address_t *addr)
{
unsigned h;
h = (__force u32)(addr->a6[0] ^ addr->a6[1] ^ addr->a6[2] ^ addr->a6[3]);
h ^= h >> 16;
h ^= h >> 8;
h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1;
return h;
} | 0 | [] | linux-2.6 | d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978 | 248,417,090,128,138,040,000,000,000,000,000,000,000 | 11 | tunnels: fix netns vs proto registration ordering
Same stuff as in ip_gre patch: receive hook can be called before netns
setup is done, oopsing in net_generic().
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
OperatorShellMake(const char *operatorName,
Oid operatorNamespace,
Oid leftTypeId,
Oid rightTypeId)
{
Relation pg_operator_desc;
Oid operatorObjectId;
int i;
HeapTuple tup;
Datum values[Natts_pg_operator];
bool nulls[Natts_pg_operator];
NameData oname;
TupleDesc tupDesc;
/*
* validat... | 0 | [
"CWE-94"
] | postgres | b9b21acc766db54d8c337d508d0fe2f5bf2daab0 | 144,792,080,395,337,270,000,000,000,000,000,000,000 | 91 | In extensions, don't replace objects not belonging to the extension.
Previously, if an extension script did CREATE OR REPLACE and there was
an existing object not belonging to the extension, it would overwrite
the object and adopt it into the extension. This is problematic, first
because the overwrite is probably uni... |
static UINT drive_process_irp_write(DRIVE_DEVICE* drive, IRP* irp)
{
DRIVE_FILE* file;
UINT32 Length;
UINT64 Offset;
void* ptr;
if (!drive || !irp || !irp->input || !irp->output || !irp->Complete)
return ERROR_INVALID_PARAMETER;
if (Stream_GetRemainingLength(irp->input) < 32)
return ERROR_INVALID_DATA;
St... | 0 | [
"CWE-125"
] | FreeRDP | 6b485b146a1b9d6ce72dfd7b5f36456c166e7a16 | 157,422,508,498,581,150,000,000,000,000,000,000,000 | 41 | Fixed oob read in irp_write and similar |
bool CanReceiveMessage(User* source, User* target, SilenceEntry::SilenceFlags flag)
{
// Servers handle their own clients.
if (!IS_LOCAL(target))
return true;
if (exemptuline && source->server->IsULine())
return true;
SilenceList* list = cmd.ext.get(target);
if (!list)
return true;
for (Silenc... | 0 | [
"CWE-416"
] | inspircd | 7b47de3c194f239c5fea09a0e49696c9af017d51 | 103,579,882,541,270,380,000,000,000,000,000,000,000 | 24 | Copy the silence flags when sending update notifications.
This fixes a crash bug in the silence module on some versions of GCC. |
int fxInt8Compare(const void* p, const void* q)
{
txS1 a = *((txS1*)p);
txS1 b = *((txS1*)q);
return (a < b) ? -1 : (a > b) ? 1 : 0;
} | 0 | [
"CWE-125"
] | moddable | 135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45 | 155,467,921,734,491,820,000,000,000,000,000,000,000 | 6 | XS: #896 |
int wc_RsaExportKey(RsaKey* key,
byte* e, word32* eSz, byte* n, word32* nSz,
byte* d, word32* dSz, byte* p, word32* pSz,
byte* q, word32* qSz)
{
int ret = BAD_FUNC_ARG;
if (key && e && eSz && n && nSz && d && dSz && p && pSz && q && qSz)
ret =... | 0 | [
"CWE-310",
"CWE-787"
] | wolfssl | fb2288c46dd4c864b78f00a47a364b96a09a5c0f | 309,205,884,793,719,550,000,000,000,000,000,000,000 | 36 | RSA-PSS: Handle edge case with encoding message to hash
When the key is small relative to the digest (1024-bit key, 64-byte
hash, 61-byte salt length), the internal message to hash is larger than
the output size.
Allocate a buffer for the message when this happens. |
raptor_xml_writer_set_option(raptor_xml_writer *xml_writer,
raptor_option option, char* string, int integer)
{
return raptor_object_options_set_option(&xml_writer->options, option,
string, integer);
} | 0 | [
"CWE-787"
] | raptor | 590681e546cd9aa18d57dc2ea1858cb734a3863f | 220,035,537,033,540,600,000,000,000,000,000,000,000 | 6 | Calcualte max nspace declarations correctly for XML writer
(raptor_xml_writer_start_element_common): Calculate max including for
each attribute a potential name and value.
Fixes Issues #0000617 http://bugs.librdf.org/mantis/view.php?id=617
and #0000618 http://bugs.librdf.org/mantis/view.php?id=618 |
static int atusb_get_and_show_build(struct atusb *atusb)
{
struct usb_device *usb_dev = atusb->usb_dev;
char *build;
int ret;
build = kmalloc(ATUSB_BUILD_SIZE + 1, GFP_KERNEL);
if (!build)
return -ENOMEM;
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_BUILD, ATUSB_REQ_FROM_DEV, 0, 0,
... | 0 | [
"CWE-399",
"CWE-119"
] | linux | 05a974efa4bdf6e2a150e3f27dc6fcf0a9ad5655 | 72,189,477,846,028,690,000,000,000,000,000,000,000 | 21 | ieee802154: atusb: do not use the stack for buffers to make them DMA able
From 4.9 we should really avoid using the stack here as this will not be DMA
able on various platforms. This changes the buffers already being present in
time of 4.9 being released. This should go into stable as well.
Reported-by: Dan Carpenter... |
int ssl3_get_key_exchange(SSL *s)
{
#ifndef OPENSSL_NO_RSA
unsigned char *q, md_buf[EVP_MAX_MD_SIZE * 2];
#endif
EVP_MD_CTX md_ctx;
unsigned char *param, *p;
int al, j, ok;
long i, param_len, n, alg_k, alg_a;
EVP_PKEY *pkey = NULL;
const EVP_MD *md = NULL;
#ifndef OPENSSL_NO_RSA
RSA *rsa... | 0 | [
"CWE-310"
] | openssl | 63830384e90d9b36d2793d4891501ec024827433 | 198,141,058,059,909,800,000,000,000,000,000,000,000 | 666 | client: reject handshakes with DH parameters < 768 bits.
Since the client has no way of communicating her supported parameter
range to the server, connections to servers that choose weak DH will
simply fail.
Reviewed-by: Kurt Roeckx <kurt@openssl.org> |
http_client_check_response_cb (SoupSession *session, SoupMessage *msg, gpointer user_data)
{
GError *error;
CheckData *data = user_data;
GTlsCertificateFlags cert_flags;
gboolean op_res;
gboolean using_https;
error = NULL;
op_res = FALSE;
if (msg->status_code == SOUP_STATUS_CANCELLED)
goto out;
... | 1 | [
"CWE-310"
] | gnome-online-accounts | 9cf4bc0ced2c53bcdd36922caa65afc8a167bbd8 | 74,744,793,288,281,340,000,000,000,000,000,000,000 | 43 | Guard against invalid SSL certificates
For providers like Exchange which use libsoup to talk to a HTTPS
server it is not enough to warn the user about an invalid certificate.
We should make sure that we abort the connection before any
credentials have been sent.
Fixes: CVE-2013-1799 |
static void __init of_unittest_printf(void)
{
struct device_node *np;
const char *full_name = "/testcase-data/platform-tests/test-device@1/dev@100";
char phandle_str[16] = "";
np = of_find_node_by_path(full_name);
if (!np) {
unittest(np, "testcase data missing\n");
return;
}
num_to_str(phandle_str, sizeof(... | 0 | [
"CWE-401"
] | linux | e13de8fe0d6a51341671bbe384826d527afe8d44 | 74,589,832,594,821,780,000,000,000,000,000,000,000 | 33 | of: unittest: fix memory leak in unittest_data_add
In unittest_data_add, a copy buffer is created via kmemdup. This buffer
is leaked if of_fdt_unflatten_tree fails. The release for the
unittest_data buffer is added.
Fixes: b951f9dc7f25 ("Enabling OF selftest to run without machine's devicetree")
Signed-off-by: Navid ... |
Value ExpressionFieldPath::evaluate(const Document& root, Variables* variables) const {
if (_fieldPath.getPathLength() == 1) // get the whole variable
return variables->getValue(_variable, root);
if (_variable == Variables::kRootId) {
// ROOT is always a document so use optimized code path
... | 0 | [] | mongo | 1772b9a0393b55e6a280a35e8f0a1f75c014f301 | 218,725,730,923,452,060,000,000,000,000,000,000,000 | 19 | SERVER-49404 Enforce additional checks in $arrayToObject |
static int input_defuzz_abs_event(int value, int old_val, int fuzz)
{
if (fuzz) {
if (value > old_val - fuzz / 2 && value < old_val + fuzz / 2)
return old_val;
if (value > old_val - fuzz && value < old_val + fuzz)
return (old_val * 3 + value) / 4;
if (value > old_val - fuzz * 2 && value < old_val + fuzz ... | 0 | [
"CWE-703",
"CWE-787"
] | linux | cb222aed03d798fc074be55e59d9a112338ee784 | 134,538,726,938,588,700,000,000,000,000,000,000,000 | 15 | Input: add safety guards to input_set_keycode()
If we happen to have a garbage in input device's keycode table with values
too big we'll end up doing clear_bit() with offset way outside of our
bitmaps, damaging other objects within an input device or even outside of
it. Let's add sanity checks to the returned old keyc... |
bool WebContents::IsGuest() const {
return type_ == Type::WEB_VIEW;
} | 0 | [
"CWE-284",
"CWE-693"
] | electron | 18613925610ba319da7f497b6deed85ad712c59b | 280,318,045,356,322,360,000,000,000,000,000,000,000 | 3 | refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25108)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25065)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL
* spec: add test for x-site _top navigation
* chore: old cod... |
static void dccp_deliver_input_to_ccids(struct sock *sk, struct sk_buff *skb)
{
const struct dccp_sock *dp = dccp_sk(sk);
/* Don't deliver to RX CCID when node has shut down read end. */
if (!(sk->sk_shutdown & RCV_SHUTDOWN))
ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb);
/*
* Until the TX queue has be... | 0 | [
"CWE-200",
"CWE-415"
] | linux | 5edabca9d4cff7f1f2b68f0bac55ef99d9798ba4 | 268,529,477,810,459,400,000,000,000,000,000,000,000 | 14 | dccp: fix freeing skb too early for IPV6_RECVPKTINFO
In the current DCCP implementation an skb for a DCCP_PKT_REQUEST packet
is forcibly freed via __kfree_skb in dccp_rcv_state_process if
dccp_v6_conn_request successfully returns.
However, if IPV6_RECVPKTINFO is set on a socket, the address of the skb
is saved to ire... |
static int selinux_file_mprotect(struct vm_area_struct *vma,
unsigned long reqprot,
unsigned long prot)
{
const struct cred *cred = current_cred();
if (selinux_checkreqprot)
prot = reqprot;
if (default_noexec &&
(prot & PROT_EXEC) && !(vma->vm_flags & VM_EXEC)) {
int rc = 0;
if (vma->vm_start ... | 0 | [
"CWE-682"
] | linux-stable | 0c461cb727d146c9ef2d3e86214f498b78b7d125 | 171,636,856,700,063,260,000,000,000,000,000,000,000 | 36 | selinux: fix off-by-one in setprocattr
SELinux tries to support setting/clearing of /proc/pid/attr attributes
from the shell by ignoring terminating newlines and treating an
attribute value that begins with a NUL or newline as an attempt to
clear the attribute. However, the test for clearing attributes has
always bee... |
UnicodeString::UnicodeString(const char *codepageData, int32_t dataLength) {
fUnion.fFields.fLengthAndFlags = kShortString;
// if there's nothing to convert, do nothing
if(codepageData == 0 || dataLength == 0 || dataLength < -1) {
return;
}
if(dataLength == -1) {
dataLength = (int32_t)uprv_strlen(code... | 0 | [
"CWE-190",
"CWE-787"
] | icu | b7d08bc04a4296982fcef8b6b8a354a9e4e7afca | 336,073,958,493,481,600,000,000,000,000,000,000,000 | 11 | ICU-20958 Prevent SEGV_MAPERR in append
See #971 |
rsvg_cairo_render_free (RsvgRender * self)
{
RsvgCairoRender *me = RSVG_CAIRO_RENDER (self);
/* TODO */
g_free (me);
} | 0 | [] | librsvg | a51919f7e1ca9c535390a746fbf6e28c8402dc61 | 151,011,010,390,882,950,000,000,000,000,000,000,000 | 8 | rsvg: Add rsvg_acquire_node()
This function does proper recursion checks when looking up resources
from URLs and thereby helps avoiding infinite loops when cyclic
references span multiple types of elements. |
static bool is_cmpxchg_insn(const struct bpf_insn *insn)
{
return BPF_CLASS(insn->code) == BPF_STX &&
BPF_MODE(insn->code) == BPF_ATOMIC &&
insn->imm == BPF_CMPXCHG;
} | 0 | [
"CWE-307"
] | linux | 350a5c4dd2452ea999cc5e1d4a8dbf12de2f97ef | 146,062,298,153,214,750,000,000,000,000,000,000,000 | 6 | bpf: Dont allow vmlinux BTF to be used in map_create and prog_load.
The syzbot got FD of vmlinux BTF and passed it into map_create which caused
crash in btf_type_id_size() when it tried to access resolved_ids. The vmlinux
BTF doesn't have 'resolved_ids' and 'resolved_sizes' initialized to save
memory. To avoid such is... |
TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_disable_discovery_enable_access_encrypt)
// *INDENT-ON*
{
PubSubReader<HelloWorldType> reader(TEST_TOPIC_NAME);
PubSubWriter<HelloWorldType> writer(TEST_TOPIC_NAME);
std::string govern... | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 232,484,853,366,396,020,000,000,000,000,000,000,000 | 9 | 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... |
static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf,
uint8_t *data, int len)
{
int offset;
uint8_t *rpkt;
switch (ocf) {
case OCF_CSR_SEND_FIRMWARE:
/* Check if this is the bd_address packet */
if (len >= 18 + 8 && data[12] == 0x01 && data[13] == 0x00) {
... | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 241,655,847,222,274,370,000,000,000,000,000,000,000 | 38 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
static inline Quantum ReadVIPSPixelNONE(Image *image,
const VIPSBandFormat format,const VIPSType type)
{
switch(type)
{
case VIPSTypeB_W:
case VIPSTypeRGB:
{
unsigned char
c;
switch(format)
{
case VIPSBandFormatUCHAR:
case VIPSBandFormatCHAR:
... | 0 | [
"CWE-772"
] | ImageMagick | dd367e0c3c3f37fbf1c20fa107b67a668b22c6e2 | 173,057,661,006,047,550,000,000,000,000,000,000,000 | 90 | https://github.com/ImageMagick/ImageMagick/issues/770 |
void flush_itimer_signals(void)
{
struct task_struct *tsk = current;
unsigned long flags;
spin_lock_irqsave(&tsk->sighand->siglock, flags);
__flush_itimer_signals(&tsk->pending);
__flush_itimer_signals(&tsk->signal->shared_pending);
spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
} | 0 | [] | linux-2.6 | 0083fc2c50e6c5127c2802ad323adf8143ab7856 | 272,658,411,832,886,730,000,000,000,000,000,000,000 | 10 | do_sigaltstack: avoid copying 'stack_t' as a structure to user space
Ulrich Drepper correctly points out that there is generally padding in
the structure on 64-bit hosts, and that copying the structure from
kernel to user space can leak information from the kernel stack in those
padding bytes.
Avoid the whole issue b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.