anchor_id stringlengths 13 16 | anchor stringlengths 63 78.9k | anchor_diff stringlengths 125 3.42k | positive_id stringlengths 13 16 | positive stringlengths 57 78.9k | positive_diff stringlengths 136 3.42k | negative_id stringlengths 13 16 | negative stringlengths 57 129k | negative_diff stringlengths 136 3.42k | hard_negative stringlengths 103 79k |
|---|---|---|---|---|---|---|---|---|---|
CVE-2024-0321 | char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicode_type)
{
u32 i, j, len;
char *sOK;
char szLineConv[2048];
unsigned short *sptr;
memset(szLine, 0, sizeof(char)*lineSize);
sOK = gf_fgets(szLine, lineSize, txt_in);
if (!sOK) return NULL;
if (unicode_type<=1) {
j=0;
len = (u32)... | --- vulnerable
+++ patched
@@ -71,6 +71,10 @@
GF_LOG(GF_LOG_DEBUG, GF_LOG_PARSER, ("[TXTIn] Line too long to convert to utf8 (len: %d)\n", len));
j = GF_ARRAY_LENGTH(szLineConv) -1 ;
}
+ if ( j >= lineSize ) {
+ GF_LOG(GF_LOG_DEBUG, GF_LOG_PARSER, ("[TXTIn] UT8 converted line too long for buffer (len: %d,... | CVE-2024-10964 | void handle_add_plugin(nng_aio *aio)
{
neu_plugin_t *plugin = neu_rest_get_plugin();
NEU_PROCESS_HTTP_REQUEST_VALIDATE_JWT(
aio, neu_json_add_plugin_req_t, neu_json_decode_add_plugin_req, {
int ret = 0;
neu_reqresp_head_t header = { 0 };
neu_req... | --- vulnerable
+++ patched
@@ -11,7 +11,7 @@
header.ctx = aio;
header.type = NEU_REQ_ADD_PLUGIN;
header.otel_trace_type = NEU_OTEL_TRACE_TYPE_REST_COMM;
- strcpy(cmd.library, req->library);
+ strncpy(cmd.library, req->library, NEU_PLUGI... | CVE-2025-48964 | int gather_statistics(struct ping_rts *rts, uint8_t *icmph, int icmplen,
int cc, uint16_t seq, int hops,
int csfailed, struct timeval *tv, char *from,
void (*pr_reply)(uint8_t *icmph, int cc), int multicast,
int wrong_source)
{
int dupflag = 0;
long triptime = 0;
uint8_t *ptr = icmph ... | --- vulnerable
+++ patched
@@ -52,7 +52,7 @@
if (triptime > rts->tmax)
rts->tmax = triptime;
if (!rts->rtt)
- rts->rtt = triptime * 8;
+ rts->rtt = ((uint64_t)triptime) * 8;
else
rts->rtt += triptime - rts->rtt / 8;
if (rts->opt_adaptive) | char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicode_type)
{
u32 i, j, len;
char *sOK;
char szLineConv[2048];
unsigned short *sptr;
memset(szLine, 0, sizeof(char)*lineSize);
sOK = gf_fgets(szLine, lineSize, txt_in);
if (!sOK) return NULL;
if (unicode_type<=1) {
j=0;
len = (u32)... |
CVE-2017-12988 | static int
telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print)
{
int i, x;
u_int c;
const u_char *osp, *p;
#define FETCH(c, sp, length) \
do { \
if (length < 1) \
goto pktend; \
ND_TCHECK(*sp); \
c = *sp++; \
length--; \
} while (0)
osp = sp;
FETCH(c, sp, length);
if (c... | --- vulnerable
+++ patched
@@ -54,6 +54,7 @@
break;
p++;
}
+ ND_TCHECK(*p);
if (*p != IAC)
goto pktend;
| CVE-2017-12992 | void
ripng_print(netdissect_options *ndo, const u_char *dat, unsigned int length)
{
register const struct rip6 *rp = (const struct rip6 *)dat;
register const struct netinfo6 *ni;
register u_int amt;
register u_int i;
int j;
int trunc;
if (ndo->ndo_snapend < dat)
return;
amt = ndo->ndo_snapend - dat;
i = min... | --- vulnerable
+++ patched
@@ -3,65 +3,74 @@
{
register const struct rip6 *rp = (const struct rip6 *)dat;
register const struct netinfo6 *ni;
- register u_int amt;
- register u_int i;
- int j;
- int trunc;
+ unsigned int length_left;
+ u_int j;
- if (ndo->ndo_snapend < dat)
- return;
- amt = ndo->ndo_snapend - ... | CVE-2022-2522 | static char_u *
ins_compl_infercase_gettext(
char_u *str,
int char_len,
int compl_char_len,
int min_len,
char_u **tofree)
{
int *wca; // Wide character array.
char_u *p;
int i, c;
int has_lower = FALSE;
int was_letter = FALSE;
garray_T gap;
IObuff[0] = NUL;
// Allocate wide... | --- vulnerable
+++ patched
@@ -114,6 +114,7 @@
// growarray. Add the character in the next round.
if (ga_grow(&gap, IOSIZE) == FAIL)
return (char_u *)"[failed]";
+ *p = NUL;
STRCPY(gap.ga_data, IObuff);
gap.ga_len = (int)STRLEN(IObuff);
} | static int
telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print)
{
int i, x;
u_int c;
const u_char *osp, *p;
#define FETCH(c, sp, length) \
do { \
if (length < 1) \
goto pktend; \
ND_TCHECK(*sp); \
c = *sp++; \
length--; \
} while (0)
osp = sp;
FETCH(c, sp, length);
if (c... |
CVE-2017-14039 | static OPJ_BOOL opj_j2k_write_sod(opj_j2k_t *p_j2k,
opj_tcd_t * p_tile_coder,
OPJ_BYTE * p_data,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 p_total_data_size,
... | --- vulnerable
+++ patched
@@ -16,6 +16,12 @@
assert(p_stream != 00);
OPJ_UNUSED(p_stream);
+
+ if (p_total_data_size < 4) {
+ opj_event_msg(p_manager, EVT_ERROR,
+ "Not enough bytes in output buffer to write SOD marker\n");
+ return OPJ_FALSE;
+ }
opj_write_b... | CVE-2017-14164 | static OPJ_BOOL opj_j2k_write_sot(opj_j2k_t *p_j2k,
OPJ_BYTE * p_data,
OPJ_UINT32 * p_data_written,
const opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager
... | --- vulnerable
+++ patched
@@ -1,5 +1,6 @@
static OPJ_BOOL opj_j2k_write_sot(opj_j2k_t *p_j2k,
OPJ_BYTE * p_data,
+ OPJ_UINT32 p_total_data_size,
OPJ_UINT32 * p_data_written,
const ... | CVE-2022-28044 | bool initialise_control(rzip_control *control)
{
time_t now_t, tdiff;
char localeptr[] = "./", *eptr; /* for environment */
size_t len;
memset(control, 0, sizeof(rzip_control));
control->msgout = stderr;
control->msgerr = stderr;
register_outputfile(control, control->msgout);
control->flags = FLAG_SHOW_PROGRES... | --- vulnerable
+++ patched
@@ -9,7 +9,7 @@
control->msgerr = stderr;
register_outputfile(control, control->msgout);
control->flags = FLAG_SHOW_PROGRESS | FLAG_KEEP_FILES | FLAG_THRESHOLD;
- control->suffix = ".lrz";
+ control->suffix = strdup(".lrz");
control->compression_level = 7;
control->ramsize = get_ram... | static OPJ_BOOL opj_j2k_write_sod(opj_j2k_t *p_j2k,
opj_tcd_t * p_tile_coder,
OPJ_BYTE * p_data,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 p_total_data_size,
... |
CVE-2016-1709 | int32_t ByteArray::Get(int32_t index) {
return InternalGet(index) & 0xff;
} | --- vulnerable
+++ patched
@@ -1,3 +1,5 @@
int32_t ByteArray::Get(int32_t index) {
+ if (index < 0 || index >= Length())
+ return -1;
return InternalGet(index) & 0xff;
} | CVE-2022-28069 | static int vax_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, RAnalOpMask mask) {
op->size = 1;
if (len < 1) {
return -1;
}
op->addr = addr;
op->type = R_ANAL_OP_TYPE_UNK;
switch (buf[0]) {
case 0x04:
op->type = R_ANAL_OP_TYPE_RET;
break;
case 0x2e:
op->type = R_ANAL_OP_TYPE_MOV;
op-... | --- vulnerable
+++ patched
@@ -137,7 +137,7 @@
case 0xfb: // calls
op->type = R_ANAL_OP_TYPE_CALL;
op->size = 7;
- {
+ if (len > 6) {
int oa = 3;
ut32 delta = buf[oa];
delta |= (ut32)(buf[oa + 1]) << 8; | CVE-2017-8069 | static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
{
return usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
RTL8150_REQ_GET_REGS, RTL8150_REQT_READ,
indx, 0, data, size, 500);
} | --- vulnerable
+++ patched
@@ -1,6 +1,17 @@
static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
{
- return usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
- RTL8150_REQ_GET_REGS, RTL8150_REQT_READ,
- indx, 0, data, size, 500);
+ void *buf;
+ int ret;
+
+ buf = kmalloc... | int32_t ByteArray::Get(int32_t index) {
if (index < 0 || index >= Length())
return -1;
return InternalGet(index) & 0xff;
} |
CVE-2010-5332 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
{
struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table;
int i, err = 0;
int free = -1;
mutex_lock(&table->mutex);
for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) {
if (free < 0 && (table->refs[i] == 0)) {
fr... | --- vulnerable
+++ patched
@@ -19,6 +19,11 @@
++table->refs[i];
goto out;
}
+ }
+
+ if (free < 0) {
+ err = -ENOMEM;
+ goto out;
}
if (table->total == table->max) { | CVE-2016-7799 | MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile)
{
#define MaxDirectoryStack 16
#define EXIF_DELIMITER "\n"
#define EXIF_NUM_FORMATS 12
#define TAG_EXIF_OFFSET 0x8769
#define TAG_INTEROP_OFFSET 0xa005
typedef struct _DirectoryInfo
{
unsigned char
*directory;
size_t
entr... | --- vulnerable
+++ patched
@@ -122,7 +122,7 @@
break; /* corrupt EXIF */
tag_value=(ssize_t) ReadProfileShort(endian,q);
format=(ssize_t) ReadProfileShort(endian,q+2);
- if ((format-1) >= EXIF_NUM_FORMATS)
+ if ((format < 0) || ((format-1) >= EXIF_NUM_FORMATS))
break;
c... | CVE-2016-10071 | static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image *image, *image2=NULL,
*rotated_image;
register Quantum *q;
unsigned int status;
MATHeader MATLAB_HDR;
size_t size;
size_t CellType;
QuantumInfo *quantum_info;
ImageInfo *clone_info;
int i;
ssize_t ldblk;
... | --- vulnerable
+++ patched
@@ -267,7 +267,7 @@
return(DestroyImageList(image));
/* ----- Load raster data ----- */
- BImgBuff = (unsigned char *) AcquireQuantumMemory((size_t) (ldblk),sizeof(unsigned char)); /* Ldblk was set in the check phase */
+ BImgBuff = (unsigned char *) AcquireQuantumMemory(... | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
{
struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table;
int i, err = 0;
int free = -1;
mutex_lock(&table->mutex);
for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) {
if (free < 0 && (table->refs[i] == 0)) {
fr... |
CVE-2023-0433 | static int
same_leader(
linenr_T lnum,
int leader1_len,
char_u *leader1_flags,
int leader2_len,
char_u *leader2_flags)
{
int idx1 = 0, idx2 = 0;
char_u *p;
char_u *line1;
char_u *line2;
if (leader1_len == 0)
return (leader2_len == 0);
// If first leader ha... | --- vulnerable
+++ patched
@@ -14,6 +14,9 @@
if (leader1_len == 0)
return (leader2_len == 0);
+ char_u *lnum_line = NULL;
+ int line_len = 0;
+
// If first leader has 'f' flag, the lines can be joined only if the
// second line does not have a leader.
// If first leader has 'e' flag, ... | CVE-2024-42484 | void espnow_recv_cb(const uint8_t *addr, const uint8_t *data, int size)
#endif
{
espnow_data_t *espnow_data = (espnow_data_t *)data;
wifi_pkt_rx_ctrl_t *rx_ctrl = NULL;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 1)
uint8_t * addr = recv_info->src_addr;
rx_ctrl = recv_info->rx_ctrl;
#else
wifi... | --- vulnerable
+++ patched
@@ -126,12 +126,17 @@
ESP_LOGD(TAG, ">1.2< group_id: " MACSTR ", dest_addr: " MACSTR,
MAC2STR(group_info->group_id), MAC2STR(espnow_data->dest_addr));
- ESP_LOGD(TAG, ">1.2< addr_mun: %d, dest_addr: " MACSTR, group_info->addrs_num,
+ ESP_LOGD(TAG, ">... | CVE-2016-9793 | int sock_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int val;
int valbool;
struct linger ling;
int ret = 0;
/*
* Options without arguments
*/
if (optname == SO_BINDTODEVICE)
return sock_setbindtodevice(sk, optval, o... | --- vulnerable
+++ patched
@@ -58,7 +58,7 @@
val = min_t(u32, val, sysctl_wmem_max);
set_sndbuf:
sk->sk_userlocks |= SOCK_SNDBUF_LOCK;
- sk->sk_sndbuf = max_t(u32, val * 2, SOCK_MIN_SNDBUF);
+ sk->sk_sndbuf = max_t(int, val * 2, SOCK_MIN_SNDBUF);
/* Wake up sending tasks if we upped the value. */
sk->sk_... | static int
same_leader(
linenr_T lnum,
int leader1_len,
char_u *leader1_flags,
int leader2_len,
char_u *leader2_flags)
{
int idx1 = 0, idx2 = 0;
char_u *p;
char_u *line1;
char_u *line2;
if (leader1_len == 0)
return (leader2_len == 0);
char_u *lnum_line = ... |
CVE-2013-1929 | static void tg3_read_vpd(struct tg3 *tp)
{
u8 *vpd_data;
unsigned int block_end, rosize, len;
u32 vpdlen;
int j, i = 0;
vpd_data = (u8 *)tg3_vpd_readblock(tp, &vpdlen);
if (!vpd_data)
goto out_no_vpd;
i = pci_vpd_find_tag(vpd_data, 0, vpdlen, PCI_VPD_LRDT_RO_DATA);
if (i < 0)
goto out_not_found;
rosize ... | --- vulnerable
+++ patched
@@ -41,8 +41,11 @@
if (j + len > block_end)
goto partno;
- memcpy(tp->fw_ver, &vpd_data[j], len);
- strncat(tp->fw_ver, " bc ", vpdlen - len - 1);
+ if (len >= sizeof(tp->fw_ver))
+ len = sizeof(tp->fw_ver) - 1;
+ memset(tp->fw_ver, 0, sizeof(tp->fw_ver));
+ snprintf(tp->fw_ve... | CVE-2024-47248 | static void gen_prov_cont(struct prov_rx *rx, struct os_mbuf *buf)
{
uint8_t seg = CONT_SEG_INDEX(rx->gpc);
BT_DBG("len %u, seg_index %u", buf->om_len, seg);
if (!link.rx.seg && link.rx.id == rx->xact_id) {
if (!ack_pending()) {
BT_DBG("Resending ack");
gen_prov_ack_send(rx->xact_id);
}
return;
}
i... | --- vulnerable
+++ patched
@@ -41,6 +41,11 @@
return;
}
+ if (XACT_SEG_OFFSET(seg) + buf->om_len > RX_BUFFER_MAX) {
+ BT_WARN("Rx buffer overflow. Malformed generic prov frame?");
+ return;
+ }
+
memcpy(XACT_SEG_DATA(seg), buf->om_data, buf->om_len);
XACT_SEG_RECV(seg);
| CVE-2022-2454 | static Fixed lsr_translate_coords(GF_LASeRCodec *lsr, u32 val, u32 nb_bits)
{
#ifdef GPAC_FIXED_POINT
if (val >> (nb_bits-1) ) {
s32 neg = (s32) val - (1<<nb_bits);
if (neg < -FIX_ONE / 2)
return 2 * gf_divfix(INT2FIX(neg/2), lsr->res_factor);
return gf_divfix(INT2FIX(neg), lsr->res_factor);
} else {
if (v... | --- vulnerable
+++ patched
@@ -1,5 +1,7 @@
static Fixed lsr_translate_coords(GF_LASeRCodec *lsr, u32 val, u32 nb_bits)
{
+ if (!nb_bits) return 0;
+
#ifdef GPAC_FIXED_POINT
if (val >> (nb_bits-1) ) {
s32 neg = (s32) val - (1<<nb_bits); | static void tg3_read_vpd(struct tg3 *tp)
{
u8 *vpd_data;
unsigned int block_end, rosize, len;
u32 vpdlen;
int j, i = 0;
vpd_data = (u8 *)tg3_vpd_readblock(tp, &vpdlen);
if (!vpd_data)
goto out_no_vpd;
i = pci_vpd_find_tag(vpd_data, 0, vpdlen, PCI_VPD_LRDT_RO_DATA);
if (i < 0)
goto out_not_found;
rosize ... |
CVE-2023-23456 | void PackTmt::pack(OutputFile *fo) {
big_relocs = 0;
Packer::handleStub(fi, fo, adam_offset);
const unsigned usize = ih.imagesize;
const unsigned rsize = ih.relocsize;
ibuf.alloc(usize + rsize + 128);
obuf.allocForCompression(usize + rsize + 128);
MemBuffer mb_wrkmem;
mb_wrkmem.alloc... | --- vulnerable
+++ patched
@@ -10,7 +10,7 @@
obuf.allocForCompression(usize + rsize + 128);
MemBuffer mb_wrkmem;
- mb_wrkmem.alloc(rsize + EXTRA_INFO); // relocations
+ mb_wrkmem.alloc(rsize + EXTRA_INFO + 4); // relocations + original entry point + relocsize
SPAN_S_VAR(upx_byte, wrkmem, mb_wrkme... | CVE-2023-33975 | static int _rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *pkt,
size_t offset, unsigned page)
{
union {
gnrc_sixlowpan_frag_rb_base_t *super;
gnrc_sixlowpan_frag_rb_t *rbuf;
gnrc_sixlowpan_frag_vrb_t *vrb;
} entry;
const uint8_t *src = gnrc_netif_hdr_get_s... | --- vulnerable
+++ patched
@@ -168,6 +168,19 @@
else if (IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR) &&
sixlowpan_sfr_rfrag_is(pkt->data)) {
entry.super->datagram_size--;
+ /* Check, if fragment is still small enough to fit datagram size.
+ ... | CVE-2013-6763 | static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
unsigned int len;
unsigned long start=0, off;
struct au1200fb_device *fbdev = info->par;
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
return -EINVAL;
}
start = fbdev->fb_phys & PAGE_MASK;
len = PAGE_ALIGN((start & ~PAGE_MASK) + f... | --- vulnerable
+++ patched
@@ -1,30 +1,9 @@
static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
-
{
- unsigned int len;
- unsigned long start=0, off;
struct au1200fb_device *fbdev = info->par;
-
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
- return -EINVAL;
- }
-
- start = fbdev->fb_phys... | void PackTmt::pack(OutputFile *fo) {
big_relocs = 0;
Packer::handleStub(fi, fo, adam_offset);
const unsigned usize = ih.imagesize;
const unsigned rsize = ih.relocsize;
ibuf.alloc(usize + rsize + 128);
obuf.allocForCompression(usize + rsize + 128);
MemBuffer mb_wrkmem;
mb_wrkmem.alloc... |
CVE-2023-46928 | GF_EXPORT
GF_Err gf_media_change_pl(GF_ISOFile *file, u32 track, u32 profile, u32 compat, u32 level)
{
u32 i, count, stype;
GF_Err e;
GF_AVCConfig *avcc;
stype = gf_isom_get_media_subtype(file, track, 1);
switch (stype) {
case GF_ISOM_SUBTYPE_AVC_H264:
case GF_ISOM_SUBTYPE_AVC2_H264:
case GF_ISOM_SUBTYPE_AVC3_... | --- vulnerable
+++ patched
@@ -17,6 +17,10 @@
}
avcc = gf_isom_avc_config_get(file, track, 1);
+
+ if (!avcc)
+ return GF_NON_COMPLIANT_BITSTREAM;
+
if (level) avcc->AVCLevelIndication = level;
if (compat) avcc->profile_compatibility = compat;
if (profile) avcc->AVCProfileIndication = profile; | CVE-2023-46930 | GF_EXPORT
u32 gf_isom_find_od_id_for_track(GF_ISOFile *file, u32 track)
{
u32 i, j, di, the_od_id;
GF_TrackBox *od_tk;
GF_TrackBox *tk = gf_isom_get_track_from_file(file, track);
if (!tk) return 0;
i=0;
while ( (od_tk = (GF_TrackBox*)gf_list_enum(file->moov->trackList, &i))) {
if (od_tk->Media->handler->handle... | --- vulnerable
+++ patched
@@ -8,6 +8,13 @@
i=0;
while ( (od_tk = (GF_TrackBox*)gf_list_enum(file->moov->trackList, &i))) {
+ if (!od_tk || !od_tk->Media || !od_tk->Media->handler || !od_tk->Media->information ||
+ !od_tk->Media->information->sampleTable || !od_tk->Media->information->sampleTable->SampleSize ... | CVE-2017-10671 | static void
de_dotdot( char* file )
{
char* cp;
char* cp2;
int l;
/* Collapse any multiple / sequences. */
while ( ( cp = strstr( file, "//") ) != (char*) 0 )
{
for ( cp2 = cp + 2; *cp2 == '/'; ++cp2 )
continue;
(void) strcpy( cp + 1, cp2 );
}
/* Remove leading ./ and any /./ sequ... | --- vulnerable
+++ patched
@@ -17,7 +17,7 @@
while ( strncmp( file, "./", 2 ) == 0 )
(void) memmove( file, file + 2, strlen( file ) - 1 );
while ( ( cp = strstr( file, "/./") ) != (char*) 0 )
- (void) memmove( cp, cp + 2, strlen( file ) - 1 );
+ (void) memmove( cp, cp + 2, strlen( cp ) - 1 );
/* Alte... | GF_EXPORT
GF_Err gf_media_change_pl(GF_ISOFile *file, u32 track, u32 profile, u32 compat, u32 level)
{
u32 i, count, stype;
GF_Err e;
GF_AVCConfig *avcc;
stype = gf_isom_get_media_subtype(file, track, 1);
switch (stype) {
case GF_ISOM_SUBTYPE_AVC_H264:
case GF_ISOM_SUBTYPE_AVC2_H264:
case GF_ISOM_SUBTYPE_AVC3_... |
CVE-2016-7151 | // return register of given instruction id
// return 0 if not found
// this is to handle instructions embedding accumulate registers into AsmStrs[]
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access)
{
unsigned int first = 0;
unsigned int last = ARR_SIZE(insn_regs_intel) - 1;
unsigned int mid = ARR_... | --- vulnerable
+++ patched
@@ -3,9 +3,10 @@
// this is to handle instructions embedding accumulate registers into AsmStrs[]
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access)
{
+ static bool intel_regs_sorted = false;
unsigned int first = 0;
unsigned int last = ARR_SIZE(insn_regs_intel) - 1;
- ... | CVE-2022-0631 | mrb_value
mrb_f_send(mrb_state *mrb, mrb_value self)
{
mrb_sym name;
mrb_value block, *regs;
mrb_method_t m;
struct RClass *c;
mrb_callinfo *ci = mrb->c->ci;
int n = ci->n;
if (ci->cci > CINFO_NONE) {
funcall:;
const mrb_value *argv;
mrb_int argc;
mrb_get_args(mrb, "n*&", &name, &argv, &arg... | --- vulnerable
+++ patched
@@ -19,9 +19,11 @@
regs = mrb->c->ci->stack+1;
if (n == 0) {
+ argnum_error:
mrb_argnum_error(mrb, 0, 1, -1);
}
else if (n == 15) {
+ if (RARRAY_LEN(regs[0]) == 0) goto argnum_error;
name = mrb_obj_to_sym(mrb, RARRAY_PTR(regs[0])[0]);
}
else { | CVE-2022-48468 | static protobuf_c_boolean
parse_required_member(ScannedMember *scanned_member,
void *member,
ProtobufCAllocator *allocator,
protobuf_c_boolean maybe_clear)
{
unsigned len = scanned_member->len;
const uint8_t *data = scanned_member->data;
uint8_t wire_type = scanned_member->wire_type;
switch... | --- vulnerable
+++ patched
@@ -109,10 +109,13 @@
return FALSE;
def_mess = scanned_member->field->default_value;
- subm = protobuf_c_message_unpack(scanned_member->field->descriptor,
- allocator,
- len - pref_len,
- data + pref_len);
+ if (len >= pref_len)
+ subm = protobuf_c_message_unpac... | // return register of given instruction id
// return 0 if not found
// this is to handle instructions embedding accumulate registers into AsmStrs[]
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access)
{
static bool intel_regs_sorted = false;
unsigned int first = 0;
unsigned int last = ARR_SIZE(insn_r... |
CVE-2013-2127 | void LibRaw::exp_bef(float shift, float smooth)
{
// params limits
if(shift>8) shift = 8;
if(shift<0.25) shift = 0.25;
if(smooth < 0.0) smooth = 0.0;
if(smooth > 1.0) smooth = 1.0;
unsigned short *lut = (ushort*)malloc((TBLN+1)*sizeof(unsigned short));
if(shift <=1.0)
{
... | --- vulnerable
+++ patched
@@ -46,8 +46,10 @@
imgdata.image[i][3] = lut[imgdata.image[i][3]];
}
- C.data_maximum = lut[C.data_maximum];
- C.maximum = lut[C.maximum];
+ if(C.data_maximum <=TBLN)
+ C.data_maximum = lut[C.data_maximum];
+ if(C.maximum <= TBLN)
+ C.maximum = lut[C.maximum];
... | CVE-2017-7407 | void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo)
{
FILE *stream = stdout;
const char *ptr = writeinfo;
char *stringp = NULL;
long longinfo;
double doubleinfo;
while(ptr && *ptr) {
if('%' == *ptr) {
if('%' == ptr[1]) {
/* an escaped %-letter */
fputc('%',... | --- vulnerable
+++ patched
@@ -7,7 +7,7 @@
double doubleinfo;
while(ptr && *ptr) {
- if('%' == *ptr) {
+ if('%' == *ptr && ptr[1]) {
if('%' == ptr[1]) {
/* an escaped %-letter */
fputc('%', stream); | CVE-2007-6761 | static int __videobuf_mmap_mapper(struct videobuf_queue *q,
struct vm_area_struct *vma)
{
struct videbuf_vmalloc_memory *mem;
struct videobuf_mapping *map;
unsigned int first;
int retval;
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
if (! (vma->vm_flags & VM_WRITE) || ! (vma->vm_flags & VM_SHARED))
... | --- vulnerable
+++ patched
@@ -27,7 +27,7 @@
}
/* create mapping + update buffer list */
- map = q->bufs[first]->map = kmalloc(sizeof(struct videobuf_mapping),GFP_KERNEL);
+ map = q->bufs[first]->map = kzalloc(sizeof(struct videobuf_mapping),GFP_KERNEL);
if (NULL == map)
return -ENOMEM;
| void LibRaw::exp_bef(float shift, float smooth)
{
// params limits
if(shift>8) shift = 8;
if(shift<0.25) shift = 0.25;
if(smooth < 0.0) smooth = 0.0;
if(smooth > 1.0) smooth = 1.0;
unsigned short *lut = (ushort*)malloc((TBLN+1)*sizeof(unsigned short));
if(shift <=1.0)
{
... |
CVE-2013-2021 | static void check_user_password(struct pdf_struct *pdf, int R, const char *O,
const char *U, int32_t P, int EM,
unsigned length, unsigned oulen)
{
unsigned i;
uint8_t result[16];
char data[32];
cli_md5_ctx md5;
struct arc4_state arc4;
unsigned password_empty = 0;
dbg_printhex("U: ",... | --- vulnerable
+++ patched
@@ -24,7 +24,7 @@
password_empty = 1;
/* Algorithm 3.2a could be used to recover encryption key */
}
- } else {
+ } else if ((R >= 2) && (R <= 4)) {
/* 7.6.3.3 Algorithm 2 */
cli_md5_init(&md5);
/* empty password, password == padding */
@@ -38,9 +38,9 @@
cli_md... | CVE-2022-1886 | void
do_put(
int regname,
char_u *expr_result, // result for regname "=" when compiled
int dir, // BACKWARD for 'P', FORWARD for 'p'
long count,
int flags)
{
char_u *ptr;
char_u *newp, *oldp;
int yanklen;
int totlen = 0; // init for gcc
linenr_T lnum;
colnr_T col;
... | --- vulnerable
+++ patched
@@ -696,9 +696,12 @@
len = STRLEN(y_array[y_size - 1]);
col = (colnr_T)len - lendiff;
if (col > 1)
- curbuf->b_op_end.col = col - 1
- - mb_head_off(y_array[y_size - 1],
+ {
+ curbuf->b_op_end.col = col - 1;
+ if (len > 0)
+ curbuf->b_op_end.col -= mb_head_off(... | CVE-2022-0351 | /*
* Handle sixth level expression:
* number number constant
* 0zFFFFFFFF Blob constant
* "string" string constant
* 'string' literal string constant
* &option-name option value
* @r register contents
* identifier variable value
* function() function call
* $VAR environment variable
* (exp... | --- vulnerable
+++ patched
@@ -43,6 +43,7 @@
char_u *start_leader, *end_leader;
int ret = OK;
char_u *alias;
+ static int recurse = 0;
/*
* Initialise variable so that clear_tv() can't mistake this for a
@@ -68,6 +69,15 @@
++*arg;
return FAIL;
}
+
+ // Limit recursion to 1000... | static void check_user_password(struct pdf_struct *pdf, int R, const char *O,
const char *U, int32_t P, int EM,
unsigned length, unsigned oulen)
{
unsigned i;
uint8_t result[16];
char data[32];
cli_md5_ctx md5;
struct arc4_state arc4;
unsigned password_empty = 0;
dbg_printhex("U: ",... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 437