func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void ssl_write_ecjpake_kkpp_ext( mbedtls_ssl_context *ssl,
unsigned char *buf,
size_t *olen )
{
int ret;
unsigned char *p = buf;
const unsigned char *end = ssl->out_msg + MBEDTLS_SSL_MAX_CONTENT_LEN;
size_t kkpp_len;
... | 0 | [
"CWE-119",
"CWE-125",
"CWE-295"
] | mbedtls | a1098f81c252b317ad34ea978aea2bc47760b215 | 200,265,351,393,996,860,000,000,000,000,000,000,000 | 75 | Add bounds check before signature length read |
static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval *object;
zval *property = _get_zval_ptr_cv(&opline->op... | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 255,827,738,962,390,400,000,000,000,000,000,000,000 | 86 | - 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 |
xfs_da3_node_read_verify(
struct xfs_buf *bp)
{
struct xfs_mount *mp = bp->b_target->bt_mount;
struct xfs_da_blkinfo *info = bp->b_addr;
switch (be16_to_cpu(info->magic)) {
case XFS_DA3_NODE_MAGIC:
if (!xfs_verify_cksum(bp->b_addr, BBTOB(bp->b_length),
XFS_DA3_NODE_CRC_OFF))
break;
/* fall ... | 0 | [
"CWE-399"
] | linux | c88547a8119e3b581318ab65e9b72f27f23e641d | 66,786,888,204,441,460,000,000,000,000,000,000,000 | 34 | xfs: fix directory hash ordering bug
Commit f5ea1100 ("xfs: add CRCs to dir2/da node blocks") introduced
in 3.10 incorrectly converted the btree hash index array pointer in
xfs_da3_fixhashpath(). It resulted in the the current hash always
being compared against the first entry in the btree rather than the
current bloc... |
std::string collectErrorStr(const std::vector<JsonTestCase::TestErrors>& errors) {
std::string result;
for (size_t i = 0; i < errors.size(); ++i) {
auto error = errors[i];
result = result + error.first + " - " + error.second;
if (i != errors.size() - 1) {
... | 0 | [
"CWE-755"
] | mongo | 75f7184eafa78006a698cda4c4adfb57f1290047 | 339,572,986,476,647,520,000,000,000,000,000,000,000 | 11 | SERVER-50170 fix max staleness read preference parameter for server selection |
static void usbredir_free_streams(USBDevice *udev, USBEndpoint **eps,
int nr_eps)
{
#if USBREDIR_VERSION >= 0x000700
USBRedirDevice *dev = USB_REDIRECT(udev);
struct usb_redir_free_bulk_streams_header free_streams;
int i;
if (!usbredirparser_peer_has_cap(dev->parser,
... | 0 | [
"CWE-770"
] | qemu | 7ec54f9eb62b5d177e30eb8b1cad795a5f8d8986 | 307,463,017,172,382,740,000,000,000,000,000,000,000 | 21 | usb/redir: avoid dynamic stack allocation (CVE-2021-3527)
Use autofree heap allocation instead.
Fixes: 4f4321c11ff ("usb: use iovecs in USBPacket")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id:... |
static XMLRPC_OPTIONS XMLRPC_GetDefaultOptions() {
static STRUCT_XMLRPC_OPTIONS options = {
xmlrpc_case_exact,
xmlrpc_case_sensitive
};
return &options;
} | 0 | [
"CWE-119"
] | php-src | 88412772d295ebf7dd34409534507dc9bcac726e | 111,127,260,373,214,900,000,000,000,000,000,000,000 | 7 | Fix bug #68027 - fix date parsing in XMLRPC lib |
static void kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn,
struct mm_struct *mm,
unsigned long start,
unsigned long end)
{
struct kvm *kvm = mmu_notifier_to_kvm(mn);
int need_tlb_flush = 0, idx;
idx = srcu_read_lock(&kvm->srcu);
spin_lock(&kvm->mmu_lock);
/*
* The... | 0 | [
"CWE-399"
] | linux | 12d6e7538e2d418c08f082b1b44ffa5fb7270ed8 | 79,860,640,916,366,780,000,000,000,000,000,000,000 | 25 | KVM: perform an invalid memslot step for gpa base change
PPC must flush all translations before the new memory slot
is visible.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com> |
static int rtl8xxxu_start_firmware(struct rtl8xxxu_priv *priv)
{
struct device *dev = &priv->udev->dev;
int ret = 0, i;
u32 val32;
/* Poll checksum report */
for (i = 0; i < RTL8XXXU_FIRMWARE_POLL_MAX; i++) {
val32 = rtl8xxxu_read32(priv, REG_MCU_FW_DL);
if (val32 & MCU_FW_DL_CSUM_REPORT)
break;
}
if (i... | 0 | [
"CWE-400",
"CWE-401"
] | linux | a2cdd07488e666aa93a49a3fc9c9b1299e27ef3c | 227,911,653,179,997,500,000,000,000,000,000,000,000 | 53 | rtl8xxxu: prevent leaking urb
In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb
should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org> |
XML_FreeContentModel(XML_Parser parser, XML_Content *model) {
if (parser != NULL)
FREE(parser, model);
} | 0 | [
"CWE-611",
"CWE-776",
"CWE-415",
"CWE-125"
] | libexpat | c20b758c332d9a13afbbb276d30db1d183a85d43 | 83,573,273,833,204,180,000,000,000,000,000,000,000 | 4 | xmlparse.c: Deny internal entities closing the doctype |
static int vmci_transport_notify_send_init(
struct vsock_sock *vsk,
struct vsock_transport_send_notify_data *data)
{
return vmci_trans(vsk)->notify_ops->send_init(
&vsk->sk,
(struct vmci_transport_send_notify_data *)data);
} | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 275,958,680,401,589,770,000,000,000,000,000,000,000 | 8 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
void fastd_receive(fastd_socket_t *sock) {
size_t max_len = max_size_t(fastd_max_payload(ctx.max_mtu) + conf.overhead, MAX_HANDSHAKE_SIZE);
fastd_buffer_t *buffer = fastd_buffer_alloc(max_len, conf.decrypt_headroom);
fastd_peer_address_t local_addr;
fastd_peer_address_t recvaddr;
struct iovec buffer_vec = { .iov_b... | 0 | [
"CWE-617",
"CWE-119",
"CWE-284"
] | fastd | 737925113363b6130879729cdff9ccc46c33eaea | 45,380,823,722,832,440,000,000,000,000,000,000,000 | 43 | receive: fix buffer leak when receiving invalid packets
For fastd versions before v20, this was just a memory leak (which could
still be used for DoS, as it's remotely triggerable). With the new
buffer management of fastd v20, this will trigger an assertion failure
instead as soon as the buffer pool is empty. |
static UINT32 _GetLastErrorToIoStatus(SERIAL_DEVICE* serial)
{
/* http://msdn.microsoft.com/en-us/library/ff547466%28v=vs.85%29.aspx#generic_status_values_for_serial_device_control_requests
*/
switch (GetLastError())
{
case ERROR_BAD_DEVICE:
return STATUS_INVALID_DEVICE_REQUEST;
case ERROR_CALL_NOT_IMPLEME... | 0 | [
"CWE-125"
] | FreeRDP | 6b485b146a1b9d6ce72dfd7b5f36456c166e7a16 | 92,430,765,027,121,800,000,000,000,000,000,000,000 | 44 | Fixed oob read in irp_write and similar |
static ssize_t dns_stream_read(DnsStream *s, void *buf, size_t count) {
ssize_t ss;
#if ENABLE_DNS_OVER_TLS
if (s->encrypted)
ss = dnstls_stream_read(s, buf, count);
else
#endif
{
ss = read(s->fd, buf, count);
if (ss < 0)
... | 0 | [
"CWE-416",
"CWE-703"
] | systemd | d973d94dec349fb676fdd844f6fe2ada3538f27c | 335,584,946,964,854,280,000,000,000,000,000,000,000 | 16 | resolved: pin stream while calling callbacks for it
These callbacks might unref the stream, but we still have to access it,
let's hence ref it explicitly.
Maybe fixes: #10725 |
static inline void sctp_assoc_pending_pmtu(struct sock *sk, struct sctp_association *asoc)
{
sctp_assoc_sync_pmtu(sk, asoc);
asoc->pmtu_pending = 0;
} | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 18,744,143,673,277,084,000,000,000,000,000,000,000 | 6 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
size_t _copy_from_iter(void *addr, size_t bytes, struct iov_iter *i)
{
if (unlikely(iov_iter_is_pipe(i))) {
WARN_ON(1);
return 0;
}
if (iter_is_iovec(i))
might_fault();
iterate_and_advance(i, bytes, base, len, off,
copyin(addr + off, base, len),
memcpy(addr + off, base, len)
)
return bytes;
} | 0 | [
"CWE-665",
"CWE-284"
] | linux | 9d2231c5d74e13b2a0546fee6737ee4446017903 | 25,317,001,219,990,650,000,000,000,000,000,000,000 | 15 | lib/iov_iter: initialize "flags" in new pipe_buffer
The functions copy_page_to_iter_pipe() and push_pipe() can both
allocate a new pipe_buffer, but the "flags" member initializer is
missing.
Fixes: 241699cd72a8 ("new iov_iter flavour: pipe-backed")
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.k... |
int quic_decode(QuicContext *quic, QuicImageType type, uint8_t *buf, int stride)
{
Encoder *encoder = (Encoder *)quic;
unsigned int row;
uint8_t *prev;
spice_assert(buf);
switch (encoder->type) {
case QUIC_IMAGE_TYPE_RGB32:
case QUIC_IMAGE_TYPE_RGB24:
if (type == QUIC_IMAGE_TYPE_RG... | 0 | [] | spice-common | 762e0abae36033ccde658fd52d3235887b60862d | 216,434,611,734,101,040,000,000,000,000,000,000,000 | 59 | quic: Check we have some data to start decoding quic image
All paths already pass some data to quic_decode_begin but for the
test check it, it's not that expensive test.
Checking for not 0 is enough, all other words will potentially be
read calling more_io_words but we need one to avoid a potential
initial buffer over... |
ReturnCode_t DataWriterImpl::get_offered_incompatible_qos_status(
OfferedIncompatibleQosStatus& status)
{
if (writer_ == nullptr)
{
return ReturnCode_t::RETCODE_NOT_ENABLED;
}
std::unique_lock<RecursiveTimedMutex> lock(writer_->getMutex());
status = offered_incompatible_qos_status_... | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 243,131,514,501,440,700,000,000,000,000,000,000,000 | 14 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
int kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
{
if (cr3 == kvm_read_cr3(vcpu) && !pdptrs_changed(vcpu)) {
kvm_mmu_sync_roots(vcpu);
kvm_mmu_flush_tlb(vcpu);
return 0;
}
if (is_long_mode(vcpu)) {
if (kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE)) {
if (cr3 & CR3_PCID_ENABLED_RESERVED_BITS)
return... | 0 | [
"CWE-119",
"CWE-703",
"CWE-120"
] | linux | a08d3b3b99efd509133946056531cdf8f3a0c09b | 247,620,177,483,676,600,000,000,000,000,000,000,000 | 34 | kvm: x86: fix emulator buffer overflow (CVE-2014-0049)
The problem occurs when the guest performs a pusha with the stack
address pointing to an mmio address (or an invalid guest physical
address) to start with, but then extending into an ordinary guest
physical address. When doing repeated emulated pushes
emulator_re... |
static void muscle_load_single_acl(sc_file_t* file, int operation, unsigned short acl)
{
int key;
/* Everybody by default.... */
sc_file_add_acl_entry(file, operation, SC_AC_NONE, 0);
if(acl == 0xFFFF) {
sc_file_add_acl_entry(file, operation, SC_AC_NEVER, 0);
return;
}
for(key = 0; key < 16; key++) {
if(acl... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 184,585,344,262,728,700,000,000,000,000,000,000,000 | 15 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
ClearArea(x1, y1, xs, xe, x2, y2, bce, uselayfn)
int x1, y1, xs, xe, x2, y2, bce, uselayfn;
{
int y, xxe;
struct canvas *cv;
struct viewport *vp;
debug2("Clear %d,%d", x1, y1);
debug2(" %d-%d", xs, xe);
debug2(" %d,%d", x2, y2);
debug2(" uselayfn=%d bce=%d\n", uselayfn, bce);
ASSERT(display);
if (x1 ... | 0 | [] | screen | c5db181b6e017cfccb8d7842ce140e59294d9f62 | 107,004,622,843,955,320,000,000,000,000,000,000,000 | 111 | 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 ... |
do_mount (GVfsBackend *backend,
GVfsJobMount *job,
GMountSpec *mount_spec,
GMountSource *mount_source,
gboolean is_automount)
{
GVfsBackendDav *dav_backend = G_VFS_BACKEND_DAV (backend);
MountAuthData *data;
SoupSession *session;
SoupMessage *msg_opts;
So... | 0 | [] | gvfs | 0abdd97989d5274d84017490aff3bf07a71fd672 | 257,377,158,091,254,200,000,000,000,000,000,000,000 | 199 | dav: don't unescape the uri twice
path_equal tries to unescape path before comparing. Unfortunately
this function is used also for already unescaped paths. Therefore
unescaping can fail. This commit reverts changes which was done in
commit 50af53d and unescape just uris, which aren't unescaped yet.
https://bugzilla.g... |
static void compute_ideal_colors_and_weights_2_comp(
const block_size_descriptor& bsd,
const image_block& blk,
const error_weight_block& ewb,
const partition_info& pi,
endpoints_and_weights& ei,
int component1,
int component2
) {
int partition_count = pi.partition_count;
ei.ep.partition_count = partition_count... | 0 | [
"CWE-787"
] | astc-encoder | bdd385fe19bf2737bead4b5664acdfdeca7aab15 | 192,599,537,259,590,400,000,000,000,000,000,000,000 | 146 | Only load based on texel index if undecimated |
bool __fastcall TOwnConsole::CommandLineOnly()
{
return false;
}
| 0 | [
"CWE-787"
] | winscp | faa96e8144e6925a380f94a97aa382c9427f688d | 151,927,587,332,340,530,000,000,000,000,000,000,000 | 4 | Bug 1943: Prevent loading session settings that can lead to remote code execution from handled URLs
https://winscp.net/tracker/1943
(cherry picked from commit ec584f5189a856cd79509f754722a6898045c5e0)
Source commit: 0f4be408b3f01132b00682da72d925d6c4ee649b |
static void tls_log_func(int level, const char *str)
{
fprintf(stderr, "|<%d>| %s", level, str);
} | 0 | [
"CWE-290"
] | curl | b09c8ee15771c614c4bf3ddac893cdb12187c844 | 105,430,278,188,300,210,000,000,000,000,000,000,000 | 4 | vtls: add 'isproxy' argument to Curl_ssl_get/addsessionid()
To make sure we set and extract the correct session.
Reported-by: Mingtao Yang
Bug: https://curl.se/docs/CVE-2021-22890.html
CVE-2021-22890 |
ptaChangeRefcount(PTA *pta,
l_int32 delta)
{
PROCNAME("ptaChangeRefcount");
if (!pta)
return ERROR_INT("pta not defined", procName, 1);
pta->refcount += delta;
return 0;
} | 0 | [
"CWE-119",
"CWE-787"
] | leptonica | ee301cb2029db8a6289c5295daa42bba7715e99a | 20,750,127,841,545,048,000,000,000,000,000,000,000 | 10 | Security fixes: expect final changes for release 1.75.3.
* Fixed a debian security issue with fscanf() reading a string with
possible buffer overflow.
* There were also a few similar situations with sscanf(). |
link_to_maj_min_ino (char *file_name, int st_dev_maj, int st_dev_min,
ino_t st_ino)
{
int link_res;
char *link_name;
link_res = -1;
/* Is the file a link to a previously copied file? */
link_name = find_inode_file (st_ino,
st_dev_maj,
st_dev_min);
if (link_name == NULL)
add_i... | 0 | [
"CWE-190"
] | cpio | dd96882877721703e19272fe25034560b794061b | 56,848,415,916,229,300,000,000,000,000,000,000,000 | 18 | Rewrite dynamic string support.
* src/dstring.c (ds_init): Take a single argument.
(ds_free): New function.
(ds_resize): Take a single argument. Use x2nrealloc to expand
the storage.
(ds_reset,ds_append,ds_concat,ds_endswith): New function.
(ds_fgetstr): Rewrite. In particular, this fixes integer overflow.
* src/dst... |
GetEmptyMatrixMaxBufSize(const char *name, int rank, size_t *size)
{
int err = 0;
size_t nBytes = 0, len, rank_size;
size_t tag_size = 8, array_flags_size = 8;
/* Add the Array Flags tag and space to the number of bytes */
nBytes += tag_size + array_flags_size;
/* Get size of variable name, pa... | 0 | [
"CWE-200",
"CWE-401"
] | matio | b53b62b756920f4c1509f4ee06427f66c3b5c9c4 | 172,870,072,930,612,700,000,000,000,000,000,000,000 | 52 | Fix memory leak
As reported by https://github.com/tbeu/matio/issues/186 |
static inline int xfrm_byidx_should_resize(struct net *net, int total)
{
unsigned int hmask = net->xfrm.policy_idx_hmask;
if ((hmask + 1) < xfrm_policy_hashmax &&
total > hmask)
return 1;
return 0;
} | 0 | [
"CWE-125"
] | ipsec | 7bab09631c2a303f87a7eb7e3d69e888673b9b7e | 48,877,846,841,560,890,000,000,000,000,000,000,000 | 10 | xfrm: policy: check policy direction value
The 'dir' parameter in xfrm_migrate() is a user-controlled byte which is used
as an array index. This can lead to an out-of-bound access, kernel lockup and
DoS. Add a check for the 'dir' value.
This fixes CVE-2017-11600.
References: https://bugzilla.redhat.com/show_bug.cgi?... |
grammar_current_rule_symbol_append (symbol *sym, location loc,
named_ref *name)
{
if (current_rule->action_props.code)
grammar_midrule_action ();
symbol_list *p = grammar_symbol_append (sym, loc);
if (name)
assign_named_ref (p, name);
if (sym->content->status == undec... | 0 | [] | bison | b7aab2dbad43aaf14eebe78d54aafa245a000988 | 149,497,276,857,693,550,000,000,000,000,000,000,000 | 11 | fix: crash when redefining the EOF token
Reported by Agency for Defense Development.
https://lists.gnu.org/r/bug-bison/2020-08/msg00008.html
On an empty such as
%token FOO
BAR
FOO 0
%%
input: %empty
we crash because when we find FOO 0, we decrement ntokens (since FOO
was discovered... |
static unsigned int check_time(gnutls_x509_crt_t crt, time_t now)
{
int status = 0;
time_t t;
t = gnutls_x509_crt_get_activation_time (crt);
if (t == (time_t) - 1 || now < t)
{
status |= GNUTLS_CERT_NOT_ACTIVATED;
status |= GNUTLS_CERT_INVALID;
return status;
}
t = gnutls_x509_crt_get_... | 0 | [
"CWE-17"
] | gnutls | 897cbce62c0263a498088ac3e465aa5f05f8719c | 157,717,028,947,425,250,000,000,000,000,000,000,000 | 23 | Extended time verification to trusted certificate list as well. Introduced
the flag GNUTLS_VERIFY_DISABLE_TRUSTED_TIME_CHECKS that will prevent the
trusted certificate list verification. |
static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
int rc = -ENOIOCTLCMD;
struct sock *sk = sock->sk;
void __user *argp = (void __user *)arg;
switch (cmd) {
/* Protocol layer */
case TIOCOUTQ: {
long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
if (amount < 0)
amount = ... | 0 | [
"CWE-276"
] | linux | 6cc03e8aa36c51f3b26a0d21a3c4ce2809c842ac | 51,707,178,283,166,860,000,000,000,000,000,000,000 | 52 | appletalk: enforce CAP_NET_RAW for raw sockets
When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked
first.
Signed-off-by: Ori Nimron <orinimron123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net> |
static noinline void key_gc_unused_keys(struct list_head *keys)
{
while (!list_empty(keys)) {
struct key *key =
list_entry(keys->next, struct key, graveyard_link);
list_del(&key->graveyard_link);
kdebug("- %u", key->serial);
key_check(key);
/* Throw away the key data */
if (key->type->destroy)
key-... | 1 | [
"CWE-20",
"CWE-190"
] | linux | f05819df10d7b09f6d1eb6f8534a8f68e5a4fe61 | 179,454,672,219,116,500,000,000,000,000,000,000,000 | 38 | KEYS: Fix crash when attempt to garbage collect an uninstantiated keyring
The following sequence of commands:
i=`keyctl add user a a @s`
keyctl request2 keyring foo bar @t
keyctl unlink $i @s
tries to invoke an upcall to instantiate a keyring if one doesn't already
exist by that name within the user's ke... |
static void process_command(conn *c, char *command) {
token_t tokens[MAX_TOKENS];
size_t ntokens;
int comm;
assert(c != NULL);
MEMCACHED_PROCESS_COMMAND_START(c->sfd, c->rcurr, c->rbytes);
if (settings.verbose > 1)
fprintf(stderr, "<%d %s\n", c->sfd, command);
/*
* for comm... | 0 | [
"CWE-189"
] | memcached | 6695ccbc525c36d693aaa3e8337b36aa0c784424 | 162,868,267,498,970,720,000,000,000,000,000,000,000 | 172 | Fix segfault on specially crafted packet. |
static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
void *ptr)
{
EVP_AES_HMAC_SHA1 *key = data(ctx);
switch (type) {
case EVP_CTRL_AEAD_SET_MAC_KEY:
{
unsigned int i;
unsigned char hmac_key[64];
memset(... | 1 | [] | openssl | 1a3701f4fe0530a40ec073cd78d02cfcc26c0f8e | 87,837,004,564,116,270,000,000,000,000,000,000,000 | 131 | Sanity check EVP_CTRL_AEAD_TLS_AAD
The various implementations of EVP_CTRL_AEAD_TLS_AAD expect a buffer of at
least 13 bytes long. Add sanity checks to ensure that the length is at
least that. Also add a new constant (EVP_AEAD_TLS1_AAD_LEN) to evp.h to
represent this length. Thanks to Kevin Wojtysiak (Int3 Solutions) ... |
test_gui_tabmenu_event(dict_T *args UNUSED)
{
# ifdef FEAT_GUI_TABLINE
int tabnr;
int item;
if (!dict_has_key(args, "tabnr")
|| !dict_has_key(args, "item"))
return FALSE;
tabnr = (int)dict_get_number(args, "tabnr");
item = (int)dict_get_number(args, "item");
send_tabline_menu_event(tab... | 0 | [
"CWE-416"
] | vim | 249e1b903a9c0460d618f6dcc59aeb8c03b24b20 | 57,825,039,383,933,410,000,000,000,000,000,000,000 | 17 | patch 9.0.0213: using freed memory with error in assert argument
Problem: Using freed memory with error in assert argument.
Solution: Make a copy of the error. |
static void convergeephemerons (global_State *g) {
int changed;
int dir = 0;
do {
GCObject *w;
GCObject *next = g->ephemeron; /* get ephemeron list */
g->ephemeron = NULL; /* tables may return to this list when traversed */
changed = 0;
while ((w = next) != NULL) { /* for each ephemeron tab... | 0 | [
"CWE-125"
] | lua | 127e7a6c8942b362aa3c6627f44d660a4fb75312 | 170,418,948,230,590,770,000,000,000,000,000,000,000 | 18 | Fixed bug of old finalized objects in the GC
When an object aged OLD1 is finalized, it is moved from the list
'finobj' to the *beginning* of the list 'allgc'. So, this part of the
list (and not only the survival list) must be visited by 'markold'. |
inline static int php_openssl_safe_mode_chk(char *filename TSRMLS_DC)
{
if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
return -1;
}
if (php_check_open_basedir(filename TSRMLS_CC)) {
return -1;
}
return 0;
} | 0 | [
"CWE-200"
] | php-src | 270a406ac94b5fc5cc9ef59fc61e3b4b95648a3e | 146,126,537,554,895,190,000,000,000,000,000,000,000 | 11 | Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only |
static inline void __d_set_inode_and_type(struct dentry *dentry,
struct inode *inode,
unsigned type_flags)
{
unsigned flags;
dentry->d_inode = inode;
smp_wmb();
flags = READ_ONCE(dentry->d_flags);
flags &= ~(DCACHE_ENTRY_TYPE | DCACHE_FALLTHRU);
flags |= type_flags;
WRITE_ONCE(dentry->d_flags, fla... | 0 | [
"CWE-401",
"CWE-254"
] | linux | cde93be45a8a90d8c264c776fab63487b5038a65 | 141,167,040,813,998,960,000,000,000,000,000,000,000 | 13 | dcache: Handle escaped paths in prepend_path
A rename can result in a dentry that by walking up d_parent
will never reach it's mnt_root. For lack of a better term
I call this an escaped path.
prepend_path is called by four different functions __d_path,
d_absolute_path, d_path, and getcwd.
__d_path only wants to see... |
static void bind_const_locs(struct vrend_linked_shader_program *sprog,
int id)
{
if (sprog->ss[id]->sel->sinfo.num_consts) {
char name[32];
snprintf(name, 32, "%sconst0", pipe_shader_to_prefix(id));
sprog->const_location[id] = glGetUniformLocation(sprog->id, name);
} else
... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 100,802,007,599,191,040,000,000,000,000,000,000,000 | 10 | 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> |
BOOL IsAllZeroes (unsigned char* pbData, DWORD dwDataLen)
{
while (dwDataLen--)
{
if (*pbData)
return FALSE;
pbData++;
}
return TRUE;
} | 0 | [
"CWE-119",
"CWE-787"
] | VeraCrypt | f30f9339c9a0b9bbcc6f5ad38804af39db1f479e | 118,205,345,952,014,070,000,000,000,000,000,000,000 | 10 | 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. |
static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
const char
*option,
*sampling_factor,
*value;
ErrorManager
error_manager;
Image
*volatile volatile_image;
int
colorspace,
quality;
JSAMPLE
*volatile jpeg_pixels;
... | 0 | [
"CWE-200",
"CWE-703"
] | ImageMagick | f6463ca9588579633bbaed9460899d892aa3c64a | 71,607,698,861,672,940,000,000,000,000,000,000,000 | 791 | Zero pixel buffer |
static RzList *strings(RzBinFile *bf) {
if (!bf) {
return NULL;
}
LuacBinInfo *bin_info_obj = GET_INTERNAL_BIN_INFO_OBJ(bf);
if (!bin_info_obj) {
return NULL;
}
return bin_info_obj->string_list;
} | 1 | [
"CWE-200",
"CWE-787"
] | rizin | 05bbd147caccc60162d6fba9baaaf24befa281cd | 221,187,456,620,693,900,000,000,000,000,000,000,000 | 11 | Fix oob read on _luac_build_info and luac memleaks |
TEST_F(QuicUnencryptedServerTransportTest, TestPendingOneRttData) {
recvClientHello();
auto data = IOBuf::copyBuffer("bad data");
size_t expectedPendingLen =
server->getConn().transportSettings.maxPacketsToBuffer;
for (size_t i = 0; i < expectedPendingLen + 10; ++i) {
StreamId streamId = static_cast<S... | 0 | [
"CWE-617",
"CWE-703"
] | mvfst | a67083ff4b8dcbb7ee2839da6338032030d712b0 | 57,011,298,777,276,090,000,000,000,000,000,000,000 | 25 | Close connection if we derive an extra 1-rtt write cipher
Summary: Fixes CVE-2021-24029
Reviewed By: mjoras, lnicco
Differential Revision: D26613890
fbshipit-source-id: 19bb2be2c731808144e1a074ece313fba11f1945 |
static int ext4_ext_truncate_extend_restart(handle_t *handle,
struct inode *inode,
int needed)
{
int err;
if (!ext4_handle_valid(handle))
return 0;
if (handle->h_buffer_credits >= needed)
return 0;
/*
* If we need to extend the journal get a few extra blocks
* while we're at it for effici... | 0 | [
"CWE-125"
] | linux | bc890a60247171294acc0bd67d211fa4b88d40ba | 269,888,726,380,693,600,000,000,000,000,000,000,000 | 24 | ext4: verify the depth of extent tree in ext4_find_extent()
If there is a corupted file system where the claimed depth of the
extent tree is -1, this can cause a massive buffer overrun leading to
sadness.
This addresses CVE-2018-10877.
https://bugzilla.kernel.org/show_bug.cgi?id=199417
Signed-off-by: Theodore Ts'o ... |
GF_Err hnti_box_dump(GF_Box *a, FILE * trace)
{
gf_isom_box_dump_start(a, "HintTrackInfoBox", trace);
gf_fprintf(trace, ">\n");
gf_isom_box_dump_done("HintTrackInfoBox", a, trace);
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 248,001,373,641,045,170,000,000,000,000,000,000,000 | 7 | fixed #2138 |
zeqproc(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
ref2_t stack[MAX_DEPTH + 1];
ref2_t *top = stack;
make_array(&stack[0].proc1, 0, 1, op - 1);
make_array(&stack[0].proc2, 0, 1, op);
for (;;) {
long i;
if (r_size(&top->proc1) == 0) {
/* Finished these arrays, go up to nex... | 1 | [] | ghostpdl | 4f83478c88c2e05d6e8d79ca4557eb039354d2f3 | 296,662,451,619,257,640,000,000,000,000,000,000,000 | 63 | Bug 697799: have .eqproc check its parameters
The Ghostscript custom operator .eqproc was not check the number or type of
the parameters it was given. |
static struct receiver *cutBackTo(struct receiver **rcvrs, u_int32_t size, u_int32_t max) {
struct receiver *r, *tmp;
int i=0;
int count;
if(size < max) //return the original table
return *rcvrs;
count = size - max;
HASH_ITER(hh, *rcvrs, r, tmp) {
if(i++ == count)
return r;
HASH_DEL(*rc... | 0 | [
"CWE-125"
] | nDPI | b7e666e465f138ae48ab81976726e67deed12701 | 248,993,185,648,948,930,000,000,000,000,000,000,000 | 20 | Added fix to avoid potential heap buffer overflow in H.323 dissector
Modified HTTP report information to make it closer to the HTTP field names |
pluscount(p, g)
struct parse *p;
register struct re_guts *g;
{
register sop *scan;
register sop s;
register sopno plusnest = 0;
register sopno maxnest = 0;
if (p->error != 0)
return(0); /* there may not be an OEND */
scan = g->strip + 1;
do {
s = *scan++;
switch (OP(s)) {
case OPLUS_:
plusnest++;
... | 0 | [] | php-src | 124fb22a13fafa3648e4e15b4f207c7096d8155e | 18,474,783,793,941,650,000,000,000,000,000,000,000 | 30 | Fixed bug #68739 #68740 #68741 |
fire_sched_out_preempt_notifiers(struct task_struct *curr,
struct task_struct *next)
{
if (static_key_false(&preempt_notifier_key))
__fire_sched_out_preempt_notifiers(curr, next);
} | 0 | [
"CWE-119"
] | linux | 29d6455178a09e1dc340380c582b13356227e8df | 259,260,862,699,492,140,000,000,000,000,000,000,000 | 6 | sched: panic on corrupted stack end
Until now, hitting this BUG_ON caused a recursive oops (because oops
handling involves do_exit(), which calls into the scheduler, which in
turn raises an oops), which caused stuff below the stack to be
overwritten until a panic happened (e.g. via an oops in interrupt
context, cause... |
~Sql_mode_save() { thd->variables.sql_mode = old_mode; } | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 7,248,530,576,348,869,000,000,000,000,000,000,000 | 1 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
const char *castToCharPtr() const {
assert(isASCII() && "Cannot cast char16_t pointer to char pointer");
if (!isHandle_) {
return static_cast<const char *>(nonManagedStringPtr_) + startIndex_;
}
assert(isHandle_ && "StringView does not contain a valid string");
return (*strPrim())->castToASC... | 0 | [
"CWE-416",
"CWE-703"
] | hermes | d86e185e485b6330216dee8e854455c694e3a36e | 58,793,079,353,706,880,000,000,000,000,000,000,000 | 8 | Fix a bug in transient object property assignment and getUTF16Ref
Summary:
The returned `UTF16Ref` from `StringView::getUTF16Ref` can be invalidated by
appending more contents to the same allocator.
This case was encountered in `transientObjectPutErrorMessage`, resulting in
using free'd memory.
Reviewed By: tmikov
D... |
template<> struct type<unsigned int> { | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 87,287,759,961,777,130,000,000,000,000,000,000,000 | 1 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void MP4_FreeBox_stss( MP4_Box_t *p_box )
{
FREENULL( p_box->data.p_stss->i_sample_number );
} | 0 | [
"CWE-120",
"CWE-191",
"CWE-787"
] | vlc | 2e7c7091a61aa5d07e7997b393d821e91f593c39 | 58,082,576,904,324,800,000,000,000,000,000,000,000 | 4 | demux: mp4: fix buffer overflow in parsing of string boxes.
We ensure that pbox->i_size is never smaller than 8 to avoid an
integer underflow in the third argument of the subsequent call to
memcpy. We also make sure no truncation occurs when passing values
derived from the 64 bit integer p_box->i_size to arguments of ... |
bgp_get_channel(struct bgp_proto *p, u32 afi)
{
uint i;
for (i = 0; i < p->channel_count; i++)
if (p->afi_map[i] == afi)
return p->channel_map[i];
return NULL;
} | 0 | [
"CWE-787"
] | bird | 8388f5a7e14108a1458fea35bfbb5a453e2c563c | 110,062,380,878,145,780,000,000,000,000,000,000,000 | 10 | BGP: Fix bugs in handling of shutdown messages
There is an improper check for valid message size, which may lead to
stack overflow and buffer leaks to log when a large message is received.
Thanks to Daniel McCarney for bugreport and analysis. |
static void init_repository_format(struct repository_format *format)
{
const struct repository_format fresh = REPOSITORY_FORMAT_INIT;
memcpy(format, &fresh, sizeof(fresh));
} | 0 | [
"CWE-22"
] | git | 3b0bf2704980b1ed6018622bdf5377ec22289688 | 4,561,810,783,104,843,000,000,000,000,000,000,000 | 6 | setup: tighten ownership checks post CVE-2022-24765
8959555cee7 (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if nee... |
cql_server::response::placeholder<int32_t> cql_server::response::write_int_placeholder() {
return placeholder<int32_t>(_body.write_place_holder(sizeof(int32_t)));
} | 0 | [] | scylladb | 1c2eef384da439b0457b6d71c7e37d7268e471cb | 239,617,745,577,524,600,000,000,000,000,000,000,000 | 3 | transport/server.cc: Return correct size of decompressed lz4 buffer
An incorrect size is returned from the function, which could lead to
crashes or undefined behavior. Fix by erroring out in these cases.
Fixes #11476 |
static int sctp_listen_start(struct sock *sk, int backlog)
{
struct sctp_sock *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep;
struct crypto_shash *tfm = NULL;
char alg[32];
/* Allocate HMAC for generating cookie. */
if (!sp->hmac && sp->sctp_hmac_alg) {
sprintf(alg, "hmac(%s)", sp->sctp_hmac_alg);
tfm ... | 0 | [
"CWE-617",
"CWE-362"
] | linux | 2dcab598484185dea7ec22219c76dcdd59e3cb90 | 330,887,683,879,596,500,000,000,000,000,000,000,000 | 45 | sctp: avoid BUG_ON on sctp_wait_for_sndbuf
Alexander Popov reported that an application may trigger a BUG_ON in
sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
waiting on it to queue more data and meanwhile another thread peels off
the association being used by the first thread.
This patch replaces ... |
keepalived_main(int argc, char **argv)
{
bool report_stopped = true;
struct utsname uname_buf;
char *end;
/* Ensure time_now is set. We then don't have to check anywhere
* else if it is set. */
set_time_now();
/* Save command line options in case need to log them later */
save_cmd_line_options(argc, argv);
... | 0 | [
"CWE-59",
"CWE-61"
] | keepalived | 04f2d32871bb3b11d7dc024039952f2fe2750306 | 78,708,647,750,567,010,000,000,000,000,000,000,000 | 344 | When opening files for write, ensure they aren't symbolic links
Issue #1048 identified that if, for example, a non privileged user
created a symbolic link from /etc/keepalvied.data to /etc/passwd,
writing to /etc/keepalived.data (which could be invoked via DBus)
would cause /etc/passwd to be overwritten.
This commit ... |
static int ati_bpp_from_datatype(ATIVGAState *s)
{
switch (s->regs.dp_datatype & 0xf) {
case 2:
return 8;
case 3:
case 4:
return 16;
case 5:
return 24;
case 6:
return 32;
default:
qemu_log_mask(LOG_UNIMP, "Unknown dst datatype %d\n",
... | 0 | [
"CWE-190"
] | qemu | ac2071c3791b67fc7af78b8ceb320c01ca1b5df7 | 308,959,096,820,305,550,000,000,000,000,000,000,000 | 18 | ati-vga: Fix checks in ati_2d_blt() to avoid crash
In some corner cases (that never happen during normal operation but a
malicious guest could program wrong values) pixman functions were
called with parameters that result in a crash. Fix this and add more
checks to disallow such cases.
Reported-by: Ziming Zhang <ezra... |
char *
ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign,
char **rve)
{
U u;
char *s, *s0;
int bufsize;
uint32_t manh, manl;
u.d = d;
if (word0(u) & Sign_bit) {
/* set sign for everything, including 0's and NaNs */
*sign = 1;
word0(u) &= ~Sign_bit; /* clear sign bit *... | 0 | [
"CWE-119"
] | ruby | 60c29bbbf6574e0e947c56e71c3c3ca11620ee15 | 164,932,451,107,649,530,000,000,000,000,000,000,000 | 81 | merge revision(s) 43775:
* util.c (ruby_strtod): ignore too long fraction part, which does not
affect the result.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@43776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
int inet_sk_rebuild_header(struct sock *sk)
{
struct inet_sock *inet = inet_sk(sk);
struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0);
__be32 daddr;
int err;
/* Route is OK, nothing to do. */
if (rt)
return 0;
/* Reroute. */
daddr = inet->inet_daddr;
if (inet->opt && inet->opt->srr)
daddr = inet... | 1 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 106,828,541,222,360,000,000,000,000,000,000,000,000 | 40 | inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options
Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.
Another thread can ch... |
ofpact_put_reg_load(struct ofpbuf *ofpacts, const struct mf_field *field,
const void *value, const void *mask)
{
struct ofpact_set_field *sf = ofpact_put_set_field(ofpacts, field, value,
mask);
sf->ofpact.raw = NXAST_RAW_REG_LOAD;
r... | 0 | [
"CWE-125"
] | ovs | 9237a63c47bd314b807cda0bd2216264e82edbe8 | 296,901,430,957,495,440,000,000,000,000,000,000,000 | 9 | ofp-actions: Avoid buffer overread in BUNDLE action decoding.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
e_mail_parser_get_parsers (EMailParser *parser,
const gchar *mime_type)
{
EMailExtensionRegistry *reg;
EMailParserClass *parser_class;
gchar *as_mime_type;
GQueue *parsers;
g_return_val_if_fail (E_IS_MAIL_PARSER (parser), NULL);
parser_class = E_MAIL_PARSER_GET_CLASS (parser);
g_return_val_if_fail (parse... | 0 | [
"CWE-347"
] | evolution | 9c55a311325f5905d8b8403b96607e46cf343f21 | 267,814,109,784,573,100,000,000,000,000,000,000,000 | 28 | I#120 - Show security bar above message headers
Closes https://gitlab.gnome.org/GNOME/evolution/issues/120 |
R_API void r_core_anal_type_init(RCore *core) {
Sdb *types = NULL;
const char *anal_arch = NULL, *os = NULL;
char *dbpath;
if (!core || !core->anal) {
return;
}
const char *dir_prefix = r_config_get (core->config, "dir.prefix");
int bits = core->assembler->bits;
types = core->anal->sdb_types;
// make sure t... | 0 | [
"CWE-125"
] | radare2 | 1f37c04f2a762500222dda2459e6a04646feeedf | 38,628,909,052,093,790,000,000,000,000,000,000,000 | 48 | Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923) |
static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_DC)
{
*table = NULL;
*n = 0;
return zend_std_get_properties(object TSRMLS_CC); | 0 | [] | php-src | c377f1a715476934133f3254d1e0d4bf3743e2d2 | 2,738,895,749,305,506,500,000,000,000,000,000,000 | 6 | Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) |
static void __net_exit default_device_exit(struct net *net)
{
struct net_device *dev, *aux;
/*
* Push all migratable network devices back to the
* initial network namespace
*/
rtnl_lock();
for_each_netdev_safe(net, dev, aux) {
int err;
char fb_name[IFNAMSIZ];
/* Ignore unmoveable devices (i.e. loopback... | 0 | [
"CWE-399"
] | linux | 6ec82562ffc6f297d0de36d65776cff8e5704867 | 110,579,933,554,560,200,000,000,000,000,000,000,000 | 31 | veth: Dont kfree_skb() after dev_forward_skb()
In case of congestion, netif_rx() frees the skb, so we must assume
dev_forward_skb() also consume skb.
Bug introduced by commit 445409602c092
(veth: move loopback logic to common location)
We must change dev_forward_skb() to always consume skb, and veth to not
double fr... |
DEFUN(ldHist, HISTORY, "Show browsing history")
{
cmd_loadBuffer(historyBuffer(URLHist), BP_NO_URL, LB_NOLINK);
} | 0 | [
"CWE-59",
"CWE-241"
] | w3m | 18dcbadf2771cdb0c18509b14e4e73505b242753 | 309,609,481,546,644,730,000,000,000,000,000,000,000 | 4 | Make temporary directory safely when ~/.w3m is unwritable |
GF_Err ssix_box_read(GF_Box *s, GF_BitStream *bs)
{
u32 i,j;
GF_SubsegmentIndexBox *ptr = (GF_SubsegmentIndexBox*)s;
ISOM_DECREASE_SIZE(ptr, 4)
ptr->subsegment_count = gf_bs_read_u32(bs);
//each subseg has at least one range_count (4 bytes), abort if not enough bytes (broken box)
if (ptr->size < ptr->subsegment... | 0 | [
"CWE-476",
"CWE-787"
] | gpac | b8f8b202d4fc23eb0ab4ce71ae96536ca6f5d3f8 | 107,855,333,087,846,770,000,000,000,000,000,000,000 | 32 | fixed #1757 |
static void disable_file(OPERATION op, const char *filename) {
assert(filename);
assert(op <OPERATION_MAX);
EUID_ASSERT();
// Resolve all symlinks
char* fname = realpath(filename, NULL);
if (fname == NULL && errno != EACCES) {
return;
}
if (fname == NULL && errno == EACCES) {
// realpath and stat functions... | 0 | [
"CWE-269",
"CWE-94"
] | firejail | 27cde3d7d1e4e16d4190932347c7151dc2a84c50 | 25,276,672,037,262,600,000,000,000,000,000,000,000 | 153 | fixing CVE-2022-31214 |
ofputil_encode_ofp11_group_mod(enum ofp_version ofp_version,
const struct ofputil_group_mod *gm)
{
struct ofpbuf *b;
struct ofp11_group_mod *ogm;
size_t start_ogm;
struct ofputil_bucket *bucket;
b = ofpraw_alloc(OFPRAW_OFPT11_GROUP_MOD, ofp_version, 0);
start_ogm ... | 0 | [
"CWE-772"
] | ovs | 77ad4225d125030420d897c873e4734ac708c66b | 260,703,877,221,628,220,000,000,000,000,000,000,000 | 22 | ofp-util: Fix memory leaks on error cases in ofputil_decode_group_mod().
Found by libFuzzer.
Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> |
AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb)
{
char *last_field = NULL;
apr_size_t last_len = 0;
apr_size_t alloc_len = 0;
char *field;
char *value;
apr_size_t len;
int fields_read = 0;
char *tmp_field;
core_server_config *conf = ap_get_core_modul... | 0 | [] | httpd | ecebcc035ccd8d0e2984fe41420d9e944f456b3c | 200,103,169,594,159,200,000,000,000,000,000,000,000 | 258 | 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]
... |
void EbmlMaster::Remove(size_t Index)
{
if (Index < ElementList.size()) {
std::vector<EbmlElement *>::iterator Itr = ElementList.begin();
while (Index-- > 0) {
++Itr;
}
ElementList.erase(Itr);
}
} | 0 | [
"CWE-703"
] | libebml | 88409e2a94dd3b40ff81d08bf6d92f486d036b24 | 337,111,580,902,062,980,000,000,000,000,000,000,000 | 11 | EbmlMaster: propagate upper level element after infinite sized one correctly
When the parser encountered a deeply nested element with an infinite
size then a following element of an upper level was not propagated
correctly. Instead the element with the infinite size was added into the
EBML element tree a second time r... |
void giveup_vsx(struct task_struct *tsk)
{
giveup_fpu_maybe_transactional(tsk);
giveup_altivec_maybe_transactional(tsk);
__giveup_vsx(tsk);
} | 0 | [
"CWE-20"
] | linux | 621b5060e823301d0cba4cb52a7ee3491922d291 | 86,057,455,839,680,800,000,000,000,000,000,000,000 | 6 | powerpc/tm: Fix crash when forking inside a transaction
When we fork/clone we currently don't copy any of the TM state to the new
thread. This results in a TM bad thing (program check) when the new process is
switched in as the kernel does a tmrechkpt with TEXASR FS not set. Also, since
R1 is from userspace, we trig... |
static int iwl_pcie_load_firmware_chunk(struct iwl_trans *trans,
u32 dst_addr, dma_addr_t phy_addr,
u32 byte_cnt)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
unsigned long flags;
int ret;
trans_pcie->ucode_write_complete = false;
if (!iwl_trans_grab_nic_access(trans, &flags))... | 0 | [
"CWE-476"
] | linux | 8188a18ee2e48c9a7461139838048363bfce3fef | 6,252,524,686,823,483,000,000,000,000,000,000,000 | 27 | iwlwifi: pcie: fix rb_allocator workqueue allocation
We don't handle failures in the rb_allocator workqueue allocation
correctly. To fix that, move the code earlier so the cleanup is
easier and we don't have to undo all the interrupt allocations in
this case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Sig... |
AA_5_StopARTIMtimer(PRIVATE_NETWORKKEY ** /*network*/,
PRIVATE_ASSOCIATIONKEY ** association, int nextState, void * /*params*/)
{
(*association)->timerStart = 0;
(*association)->protocolState = nextState;
return EC_Normal;
} | 0 | [
"CWE-415",
"CWE-703",
"CWE-401"
] | dcmtk | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | 288,162,879,907,814,670,000,000,000,000,000,000,000 | 7 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. |
completeopt_was_set(void)
{
compl_no_insert = FALSE;
compl_no_select = FALSE;
if (strstr((char *)p_cot, "noselect") != NULL)
compl_no_select = TRUE;
if (strstr((char *)p_cot, "noinsert") != NULL)
compl_no_insert = TRUE;
} | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 95,229,964,224,455,520,000,000,000,000,000,000,000 | 9 | patch 9.0.0020: with some completion reading past end of string
Problem: With some completion reading past end of string.
Solution: Check the length of the string. |
void CLASS xtrans_interpolate (int passes)
{
int c, d, f, g, h, i, v, ng, row, col, top, left, mrow, mcol;
int val, ndir, pass, hm[8], avg[4], color[3][8];
static const short orth[12] = { 1,0,0,1,-1,0,0,-1,1,0,0,1 },
patt[2][16] = { { 0,1,0,-1,2,0,-1,0,1,1,1,-1,0,0,0,0 },
{ 0,1,0,-2,1,0,-2,0,1,1,-2,-2,1,-1,-1... | 0 | [] | LibRaw | 9ae25d8c3a6bfb40c582538193264f74c9b93bc0 | 164,175,359,938,132,550,000,000,000,000,000,000,000 | 222 | backported 0.15.4 datachecks |
static int ntop_delete_redis_key(lua_State* vm) {
char *key;
ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__);
if(ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING)) return(CONST_LUA_PARAM_ERROR);
if((key = (char*)lua_tostring(vm, 1)) == NULL) return(CONST_LUA_PARAM_ERROR);
ntop->getRed... | 0 | [
"CWE-284",
"CWE-352"
] | ntopng | f91fbe3d94c8346884271838ae3406ae633f6f15 | 210,228,030,417,374,600,000,000,000,000,000,000,000 | 10 | Check for presence of crsf in admin scripts |
void __d_lookup_done(struct dentry *dentry)
{
struct hlist_bl_head *b = in_lookup_hash(dentry->d_parent,
dentry->d_name.hash);
hlist_bl_lock(b);
dentry->d_flags &= ~DCACHE_PAR_LOOKUP;
__hlist_bl_del(&dentry->d_u.d_in_lookup_hash);
wake_up_all(dentry->d_wait);
dentry->d_wait = NULL;
hlist_bl_unlock(b);
IN... | 0 | [
"CWE-362",
"CWE-399"
] | linux | 49d31c2f389acfe83417083e1208422b4091cd9e | 289,462,674,501,000,000,000,000,000,000,000,000,000 | 13 | 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... |
sp_package *LEX::get_sp_package() const
{
return sphead ? sphead->get_package() : NULL;
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 32,253,569,916,247,244,000,000,000,000,000,000,000 | 4 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
xfs_filemap_pmd_fault(
struct vm_area_struct *vma,
unsigned long addr,
pmd_t *pmd,
unsigned int flags)
{
struct inode *inode = file_inode(vma->vm_file);
struct xfs_inode *ip = XFS_I(inode);
int ret;
if (!IS_DAX(inode))
return VM_FAULT_FALLBACK;
trace_xfs_filemap_pmd_fault(ip);
sb_start_pagefault(i... | 0 | [
"CWE-19"
] | linux | fc0561cefc04e7803c0f6501ca4f310a502f65b8 | 255,004,557,508,184,940,000,000,000,000,000,000,000 | 25 | xfs: optimise away log forces on timestamp updates for fdatasync
xfs: timestamp updates cause excessive fdatasync log traffic
Sage Weil reported that a ceph test workload was writing to the
log on every fdatasync during an overwrite workload. Event tracing
showed that the only metadata modification being made was the... |
agent_genkey (ctrl_t ctrl, char **cache_nonce_addr,
const char *keyparms, int no_protection,
const char *passphrase, gcry_sexp_t *r_pubkey)
{
gpg_error_t err;
struct genkey_parm_s gk_parm;
struct cache_nonce_parm_s cn_parm;
struct default_inq_parm_s dfltparm;
membuf_t data;
size_... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 130,276,530,816,545,220,000,000,000,000,000,000,000 | 59 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
xmlRelaxNGDefaultTypeCompare(void *data ATTRIBUTE_UNUSED,
const xmlChar * type,
const xmlChar * value1,
xmlNodePtr ctxt1 ATTRIBUTE_UNUSED,
void *comp1 ATTRIBUTE_UNUSED,
const ... | 0 | [
"CWE-134"
] | libxml2 | 502f6a6d08b08c04b3ddfb1cd21b2f699c1b7f5b | 74,779,983,977,685,760,000,000,000,000,000,000,000 | 38 | More format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
adds a new xmlEscapeFormatString() function to escape composed format
strings |
encode_algorithm_id(cms_context *cms, SECItem *der, SECOidTag tag)
{
SECAlgorithmID id;
int rc = generate_algorithm_id(cms, &id, tag);
if (rc < 0)
return rc;
void *ret;
ret = SEC_ASN1EncodeItem(cms->arena, der, &id,
SECOID_AlgorithmIDTemplate);
if (ret == NULL)
cnreterr(-1, cms, "could not encode Algo... | 0 | [
"CWE-787"
] | pesign | b879dda52f8122de697d145977c285fb0a022d76 | 165,292,840,420,730,510,000,000,000,000,000,000,000 | 16 | Handle NULL pwdata in cms_set_pw_data()
When 12f16710ee44ef64ddb044a3523c3c4c4d90039a rewrote this function, it
didn't handle the NULL pwdata invocation from daemon.c. This leads to a
explicit NULL dereference and crash on all attempts to daemonize pesign.
Signed-off-by: Robbie Harwood <rharwood@redhat.com> |
bool AES_GCM_EncryptContext::Encrypt(
const void *pPlaintextData, size_t cbPlaintextData,
const void *pIV,
void *pEncryptedDataAndTag, uint32 *pcbEncryptedDataAndTag,
const void *pAdditionalAuthenticationData, size_t cbAuthenticationData
) {
// Make sure caller's buffer is big enough to hold the result.
if ( cbP... | 0 | [
"CWE-787"
] | GameNetworkingSockets | bea84e2844b647532a9b7fbc3a6a8989d66e49e3 | 272,717,973,150,967,370,000,000,000,000,000,000,000 | 28 | Check if output buffer is too small.
It really seems like libsodium (whose entire purpose is to make crypto
idiot-proof) making me mess with these details is a flaw in the API design.
Also, correct Hungarian. |
static BOOL update_send_cache_glyph(rdpContext* context,
const CACHE_GLYPH_ORDER* cache_glyph)
{
wStream* s;
UINT16 flags;
size_t bm, em, inf;
int headerLength;
INT16 orderLength;
rdpUpdate* update = context->update;
flags = 0;
headerLength = 6;
inf = update_approximate_cach... | 0 | [
"CWE-119",
"CWE-787"
] | FreeRDP | 445a5a42c500ceb80f8fa7f2c11f3682538033f3 | 194,709,737,151,970,420,000,000,000,000,000,000,000 | 40 | Fixed CVE-2018-8786
Thanks to Eyal Itkin from Check Point Software Technologies. |
struct request *elv_rb_latter_request(struct request_queue *q,
struct request *rq)
{
struct rb_node *rbnext = rb_next(&rq->rb_node);
if (rbnext)
return rb_entry_rq(rbnext);
return NULL;
} | 0 | [
"CWE-416"
] | linux | c3e2219216c92919a6bd1711f340f5faa98695e6 | 317,512,218,817,022,500,000,000,000,000,000,000,000 | 10 | block: free sched's request pool in blk_cleanup_queue
In theory, IO scheduler belongs to request queue, and the request pool
of sched tags belongs to the request queue too.
However, the current tags allocation interfaces are re-used for both
driver tags and sched tags, and driver tags is definitely host wide,
and doe... |
void agmethod_upd(Agraph_t * g, void *obj, Agsym_t * sym)
{
if (g->clos->callbacks_enabled)
agupdcb(g, obj, sym, g->clos->cb);
else
agrecord_callback(g, obj, CB_UPDATE, sym);
} | 0 | [
"CWE-476"
] | graphviz | 839085f8026afd6f6920a0c31ad2a9d880d97932 | 270,685,004,604,904,930,000,000,000,000,000,000,000 | 7 | attempted fix for null pointer deference on malformed input |
bool CUser::SetChanBufferSize(unsigned int u, bool bForce) {
if (!bForce && u > CZNC::Get().GetMaxBufferSize()) return false;
for (CIRCNetwork* pNetwork : m_vIRCNetworks) {
for (CChan* pChan : pNetwork->GetChans()) {
pChan->InheritBufferCount(u, bForce);
}
}
m_uChanBufferSize... | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 156,710,113,205,453,550,000,000,000,000,000,000,000 | 10 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
int TNEFRawRead(TNEFStruct *TNEF, BYTE *data, DWORD size, WORD *checksum) {
WORD temp;
int i;
if (TNEF->IO.ReadProc(&TNEF->IO, sizeof(BYTE), size, data) < size) {
if (TNEF->Debug >= 1)
printf("ERROR: Error reading data\n");
return YTNEF_ERROR_READING_DATA;
}
if (checksum != NULL) {
*check... | 0 | [
"CWE-399",
"CWE-125"
] | ytnef | 3cb0f914d6427073f262e1b2b5fd973e3043cdf7 | 7,789,261,343,634,154,000,000,000,000,000,000,000 | 20 | BugFix - Potential OOB with Fields of Size 0
Thanks to @hannob for contributing a malformed TNEF stream with
a Version field of size 0. Now such files will return an error
indicating invalid data. |
static void mlx5_fill_inl_bsf(struct ib_sig_domain *domain,
struct mlx5_bsf_inl *inl)
{
/* Valid inline section and allow BSF refresh */
inl->vld_refresh = cpu_to_be16(MLX5_BSF_INL_VALID |
MLX5_BSF_REFRESH_DIF);
inl->dif_apptag = cpu_to_be16(domain->sig.dif.app_tag);
inl->dif_reftag = cpu_to_be3... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 0625b4ba1a5d4703c7fb01c497bd6c156908af00 | 313,560,854,648,884,540,000,000,000,000,000,000,000 | 26 | IB/mlx5: Fix leaking stack memory to userspace
mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes
were written.
Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp")
Cc: <stable@vger.kernel.org>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <... |
unsigned int run() const { return be::peek<W>(_e+sizeof(W)); } | 0 | [
"CWE-476"
] | graphite | db132b4731a9b4c9534144ba3a18e65b390e9ff6 | 339,683,168,006,297,780,000,000,000,000,000,000,000 | 1 | Deprecate and make ineffective gr_face_dumbRendering |
static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct net_device *dev;
struct sock *sk = sock->sk;
if (peer)
return -EOPNOTSUPP;
uaddr->sa_family = AF_PACKET;
rcu_read_lock();
dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex);
if ... | 1 | [
"CWE-909"
] | linux-2.6 | 67286640f638f5ad41a946b9a3dc75327950248f | 328,198,438,257,263,270,000,000,000,000,000,000,000 | 21 | net: packet: fix information leak to userland
packet_getname_spkt() doesn't initialize all members of sa_data field of
sockaddr struct if strlen(dev->name) < 13. This structure is then copied
to userland. It leads to leaking of contents of kernel stack memory.
We have to fully fill sa_data with strncpy() instead of ... |
int x509parse_crlfile( x509_crl *chain, const char *path )
{
int ret;
size_t n;
unsigned char *buf;
if ( (ret = load_file( path, &buf, &n ) ) != 0 )
return( ret );
ret = x509parse_crl( chain, buf, n );
memset( buf, 0, n + 1 );
free( buf );
return( ret );
} | 0 | [
"CWE-310"
] | polarssl | 43f9799ce61c6392a014d0a2ea136b4b3a9ee194 | 329,606,319,519,063,570,000,000,000,000,000,000,000 | 16 | RSA blinding on CRT operations to counter timing attacks |
_PUBLIC_ bool ldap_encode(struct ldap_message *msg,
const struct ldap_control_handler *control_handlers,
DATA_BLOB *result, TALLOC_CTX *mem_ctx)
{
struct asn1_data *data = asn1_init(mem_ctx);
int i, j;
if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) goto err;
if (!asn1_write_Intege... | 0 | [
"CWE-399"
] | samba | 530d50a1abdcdf4d1775652d4c456c1274d83d8d | 256,738,813,231,219,140,000,000,000,000,000,000,000 | 315 | CVE-2015-7540: s4: libcli: ldap message - Ensure all asn1_XX returns are checked.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9187
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): F... |
void DL_Dxf::addDimAngular(DL_CreationInterface* creationInterface) {
DL_DimensionData d = getDimData();
// angular dimension:
DL_DimAngular2LData da(
// definition point 1
getRealValue(13, 0.0),
getRealValue(23, 0.0),
getRealValue(33, 0.0),
// definition point 2
... | 0 | [
"CWE-191"
] | qcad | 1eeffc5daf5a06cf6213ffc19e95923cdebb2eb8 | 196,965,721,071,562,800,000,000,000,000,000,000,000 | 23 | check vertexIndex which might be -1 for broken DXF |
home_address_compare (EContact *ecard1,
EContact *ecard2)
{
return address_compare (ecard1, ecard2, E_CONTACT_ADDRESS_LABEL_HOME);
} | 0 | [] | evolution-data-server | 34bad61738e2127736947ac50e0c7969cc944972 | 328,357,023,662,074,100,000,000,000,000,000,000,000 | 5 | Bug 796174 - strcat() considered unsafe for buffer overflow |
static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type)
{
int err = 0;
/* Only support initial user namespace for now. */
/*
* We return ECONNREFUSED because it tricks userspace into thinking
* that audit was not configured into the kernel. Lots of users
* configure their PAM stack (because that's wha... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 331,019,886,689,680,220,000,000,000,000,000,000,000 | 55 | 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.
... |
ASC_rejectAssociation(
T_ASC_Association * association,
const T_ASC_RejectParameters * rejectParameters,
void **associatePDU,
unsigned long *associatePDUlength)
{
DUL_ABORTITEMS l_abort;
if (association == NULL) return ASC_NULLKEY;
if (association->DULassociation == NULL) return ASC_NULLKEY... | 0 | [
"CWE-415",
"CWE-703",
"CWE-401"
] | dcmtk | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | 175,711,556,925,355,080,000,000,000,000,000,000,000 | 31 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. |
static int do_brk_flags(unsigned long addr, unsigned long request, unsigned long flags, struct list_head *uf)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma, *prev;
unsigned long len;
struct rb_node **rb_link, *rb_parent;
pgoff_t pgoff = addr >> PAGE_SHIFT;
int error;
len = PAGE_ALIGN(request)... | 0 | [
"CWE-119"
] | linux | 1be7107fbe18eed3e319a6c3e83c78254b693acb | 59,244,971,005,205,190,000,000,000,000,000,000,000 | 85 | mm: larger stack guard gap, between vmas
Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.