code stringlengths 14 2.05k | label int64 0 1 | programming_language stringclasses 7
values | cwe_id stringlengths 6 14 | cwe_name stringlengths 5 98 ⌀ | description stringlengths 36 379 ⌀ | url stringlengths 36 48 ⌀ | label_name stringclasses 2
values |
|---|---|---|---|---|---|---|---|
get_register(
int name,
int copy) // make a copy, if FALSE make register empty.
{
yankreg_T *reg;
int i;
#ifdef FEAT_CLIPBOARD
// When Visual area changed, may have to update selection. Obtain the
// selection too.
if (name == '*' && clip_star.available)
{
if (clip_isautosel_star()... | 0 | C | CWE-476 | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | https://cwe.mitre.org/data/definitions/476.html | vulnerable |
regtilde(char_u *source, int magic)
{
char_u *newsub = source;
char_u *tmpsub;
char_u *p;
int len;
int prevlen;
for (p = newsub; *p; ++p)
{
if ((*p == '~' && magic) || (*p == '\\' && *(p + 1) == '~' && !magic))
{
if (reg_prev_sub != NULL)
{
// length = len(newsub) - 1 + len(... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
is_qf_win(win_T *win, qf_info_T *qi)
{
// A window displaying the quickfix buffer will have the w_llist_ref field
// set to NULL.
// A window displaying a location list buffer will have the w_llist_ref
// pointing to the location list.
if (bt_quickfix(win->w_buffer))
if ((IS_QF_STACK(qi) && win->w_... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
ex_history(exarg_T *eap)
{
histentry_T *hist;
int histype1 = HIST_CMD;
int histype2 = HIST_CMD;
int hisidx1 = 1;
int hisidx2 = -1;
int idx;
int i, j, k;
char_u *end;
char_u *arg = eap->arg;
if (hislen == 0)
{
msg(_("'history' option is zero"));
return;
}
if ... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
ex_history(exarg_T *eap)
{
histentry_T *hist;
int histype1 = HIST_CMD;
int histype2 = HIST_CMD;
int hisidx1 = 1;
int hisidx2 = -1;
int idx;
int i, j, k;
char_u *end;
char_u *arg = eap->arg;
if (hislen == 0)
{
msg(_("'history' option is zero"));
return;
}
if ... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
get_list_range(char_u **str, int *num1, int *num2)
{
int len;
int first = FALSE;
varnumber_T num;
*str = skipwhite(*str);
if (**str == '-' || vim_isdigit(**str)) // parse "from" part of range
{
vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0, FALSE, NULL);
*str += len;
*num1 = (int)num;
fi... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
get_list_range(char_u **str, int *num1, int *num2)
{
int len;
int first = FALSE;
varnumber_T num;
*str = skipwhite(*str);
if (**str == '-' || vim_isdigit(**str)) // parse "from" part of range
{
vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0, FALSE, NULL);
*str += len;
*num1 = (int)num;
fi... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
shift_line(
int left,
int round,
int amount,
int call_changed_bytes) // call changed_bytes()
{
int count;
int i, j;
int sw_val = (int)get_sw_value_indent(curbuf);
count = get_indent(); // get current indent
if (round) // round off indent
{
i = count / sw_val; // number of... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
static bool meta_set(RAnal *a, RAnalMetaType type, int subtype, ut64 from, ut64 to, const char *str) {
if (to < from) {
return false;
}
RSpace *space = r_spaces_current (&a->meta_spaces);
RIntervalNode *node = find_node_at (a, type, space, from);
RAnalMetaItem *item = node ? node->data : R_NEW0 (RAnalMetaItem);
... | 0 | C | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | vulnerable |
R_API size_t r_str_ansi_strip(char *str) {
size_t i = 0;
while (str[i]) {
size_t chlen = __str_ansi_length (str + i);
if (chlen > 1) {
r_str_cpy (str + i + 1, str + i + chlen);
}
i++;
}
return i;
} | 0 | C | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | vulnerable |
static RList *patch_relocs(RBin *b) {
r_return_val_if_fail (b && b->iob.io && b->iob.io->desc, NULL);
RBinObject *bo = r_bin_cur_object (b);
RIO *io = b->iob.io;
if (!bo || !bo->bin_obj) {
return NULL;
}
struct r_bin_coff_obj *bin = (struct r_bin_coff_obj*)bo->bin_obj;
if (bin->hdr.f_flags & COFF_FLAGS_TI_F_EX... | 0 | C | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | vulnerable |
static int getid(char ch) {
const char *keys = "[]<>+-,.";
const char *cidx = strchr (keys, ch);
return cidx? cidx - keys + 1: 0;
} | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
static void process_constructors(RKernelCacheObj *obj, struct MACH0_(obj_t) *mach0, RList *ret, ut64 paddr, bool is_first, int mode, const char *prefix) {
const RVector *sections = MACH0_(load_sections) (mach0);
if (!sections) {
return;
}
int type;
struct section_t *section;
r_vector_foreach (sections, section)... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
Bool gf_sg_proto_field_is_sftime_offset(GF_Node *node, GF_FieldInfo *field)
{
u32 i;
GF_Route *r;
GF_ProtoInstance *inst;
GF_FieldInfo inf;
if (node->sgprivate->tag != TAG_ProtoNode) return 0;
if (field->fieldType != GF_SG_VRML_SFTIME) return 0;
inst = (GF_ProtoInstance *) node;
/*check in interface if this is... | 0 | C | CWE-121 | Stack-based Buffer Overflow | A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function). | https://cwe.mitre.org/data/definitions/121.html | vulnerable |
static s32 svc_parse_slice(GF_BitStream *bs, AVCState *avc, AVCSliceInfo *si)
{
s32 pps_id;
/*s->current_picture.reference= h->nal_ref_idc != 0;*/
gf_bs_read_ue_log(bs, "first_mb_in_slice");
si->slice_type = gf_bs_read_ue_log(bs, "slice_type");
if (si->slice_type > 9) return -1;
pps_id = gf_bs_read_ue_log(bs, "... | 0 | C | CWE-120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | https://cwe.mitre.org/data/definitions/120.html | vulnerable |
GF_Err Q_DecCoordOnUnitSphere(GF_BifsDecoder *codec, GF_BitStream *bs, u32 NbBits, u32 NbComp, Fixed *m_ft)
{
u32 i, orient, sign;
s32 value;
Fixed tang[4], delta;
s32 dir;
if (NbComp != 2 && NbComp != 3) return GF_BAD_PARAM;
//only 2 or 3 comp in the quantized version
dir = 1;
if(NbComp == 2) dir -= 2 * gf_b... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
GF_Err dac3_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_AC3ConfigBox *ptr = (GF_AC3ConfigBox *)s;
if (ptr->cfg.is_ec3) s->type = GF_ISOM_BOX_TYPE_DEC3;
e = gf_isom_box_write_header(s, bs);
if (ptr->cfg.is_ec3) s->type = GF_ISOM_BOX_TYPE_DAC3;
if (e) return e;
e = gf_odf_ac3_cfg_write_bs(&ptr->cfg, b... | 0 | C | CWE-122 | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | vulnerable |
GF_Err video_sample_entry_box_size(GF_Box *s)
{
GF_Box *b;
u32 pos=0;
GF_MPEGVisualSampleEntryBox *ptr = (GF_MPEGVisualSampleEntryBox *)s;
gf_isom_video_sample_entry_size((GF_VisualSampleEntryBox *)s);
/*make sure we write the config box first, we don't care about the rest*/
/*mp4v*/
gf_isom_check_position(s, ... | 0 | C | CWE-122 | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | vulnerable |
void gf_isom_check_position(GF_Box *s, GF_Box *child, u32 *pos)
{
if (!s || !s->child_boxes || !child || !pos) return;
if (s->internal_flags & GF_ISOM_ORDER_FREEZE)
return;
s32 cur_pos = gf_list_find(s->child_boxes, child);
//happens when partially cloning boxes
if (cur_pos < 0) return;
if (cur_pos != (s32... | 0 | C | CWE-122 | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | vulnerable |
GF_EXPORT
GF_Err gf_isom_box_write(GF_Box *a, GF_BitStream *bs)
{
GF_Err e;
u64 pos = gf_bs_get_position(bs);
if (!a) return GF_BAD_PARAM;
//box has been disabled, do not write
if (!a->size) return GF_OK;
if (a->registry->disabled) {
GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[iso file] Box %s disabled registry... | 0 | C | CWE-122 | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | vulnerable |
const u32 *gf_isom_get_track_switch_parameter(GF_ISOFile *movie, u32 trackNumber, u32 group_index, u32 *switchGroupID, u32 *criteriaListSize)
{
GF_TrackBox *trak;
GF_UserDataMap *map;
GF_TrackSelectionBox *tsel;
trak = gf_isom_get_track_from_file(movie, trackNumber);
if (!group_index || !trak || !trak->udta) retu... | 0 | C | CWE-122 | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | vulnerable |
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... | 0 | C | CWE-193 | Off-by-one Error | A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value. | https://cwe.mitre.org/data/definitions/193.html | vulnerable |
void gf_filter_pid_inst_del(GF_FilterPidInst *pidinst)
{
assert(pidinst);
gf_filter_pid_inst_reset(pidinst);
gf_fq_del(pidinst->packets, (gf_destruct_fun) pcki_del);
gf_mx_del(pidinst->pck_mx);
gf_list_del(pidinst->pck_reassembly);
if (pidinst->props) {
assert(pidinst->props->reference_count);
if (safe_int_... | 0 | C | CWE-400 | Uncontrolled Resource Consumption | The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | vulnerable |
static GF_Err xml_sax_append_string(GF_SAXParser *parser, char *string)
{
u32 size = parser->line_size;
u32 nl_size = (u32) strlen(string);
if (!nl_size) return GF_OK;
if ( (parser->alloc_size < size+nl_size+1)
/* || (parser->alloc_size / 2 ) > size+nl_size+1 */
)
{
parser->alloc_size = size+nl_s... | 0 | C | CWE-476 | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | https://cwe.mitre.org/data/definitions/476.html | vulnerable |
int AVI_read_audio(avi_t *AVI, u8 *audbuf, int bytes, int *continuous)
{
int nr, todo;
s64 pos;
if(AVI->mode==AVI_MODE_WRITE) {
AVI_errno = AVI_ERR_NOT_PERM;
return -1;
}
if(!AVI->track[AVI->aptr].audio_index) {
AVI_errno = AVI_ERR_NO_IDX;
return -1;
}
nr = 0; /* total number of bytes read */
... | 0 | C | CWE-122 | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | vulnerable |
int AVI_read_frame(avi_t *AVI, u8 *vidbuf, int *keyframe)
{
int n;
if(AVI->mode==AVI_MODE_WRITE) {
AVI_errno = AVI_ERR_NOT_PERM;
return -1;
}
if(!AVI->video_index) {
AVI_errno = AVI_ERR_NO_IDX;
return -1;
}
if(AVI->video_pos < 0 || AVI->video_pos >= AVI->video_frames) return -1;
n = (u32) AVI->... | 0 | C | CWE-122 | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | vulnerable |
static void get_info_for_all_streams (mpeg2ps_t *ps)
{
u8 stream_ix, max_ix, av;
mpeg2ps_stream_t *sptr;
u8 *buffer;
u32 buflen;
file_seek_to(ps->fd, 0);
// av will be 0 for video streams, 1 for audio streams
// av is just so I don't have to dup a lot of code that does the
// same thing.
for (av = 0; av < 2;... | 0 | C | CWE-476 | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | https://cwe.mitre.org/data/definitions/476.html | vulnerable |
static u32 swf_get_32(SWFReader *read)
{
u32 val, res;
val = swf_read_int(read, 32);
res = (val&0xFF);
res <<=8;
res |= ((val>>8)&0xFF);
res<<=8;
res |= ((val>>16)&0xFF);
res<<=8;
res|= ((val>>24)&0xFF);
return res;
} | 0 | C | CWE-1077 | Floating Point Comparison with Incorrect Operator | The code performs a comparison such as an
equality test between two float (floating point) values, but
it uses comparison operators that do not account for the
possibility of loss of precision. | https://cwe.mitre.org/data/definitions/1077.html | vulnerable |
static s16 swf_get_s16(SWFReader *read)
{
s16 val;
u8 v1;
v1 = swf_read_int(read, 8);
val = swf_read_sint(read, 8);
val = (val<<8)&0xFF00;
val |= (v1&0xFF);
return val;
} | 0 | C | CWE-1077 | Floating Point Comparison with Incorrect Operator | The code performs a comparison such as an
equality test between two float (floating point) values, but
it uses comparison operators that do not account for the
possibility of loss of precision. | https://cwe.mitre.org/data/definitions/1077.html | vulnerable |
static u16 swf_get_16(SWFReader *read)
{
u16 val, res;
val = swf_read_int(read, 16);
res = (val&0xFF);
res <<=8;
res |= ((val>>8)&0xFF);
return res;
} | 0 | C | CWE-1077 | Floating Point Comparison with Incorrect Operator | The code performs a comparison such as an
equality test between two float (floating point) values, but
it uses comparison operators that do not account for the
possibility of loss of precision. | https://cwe.mitre.org/data/definitions/1077.html | vulnerable |
char *gf_bt_get_next(GF_BTParser *parser, Bool point_break)
{
u32 has_quote;
Bool go = 1;
s32 i;
gf_bt_check_line(parser);
i=0;
has_quote = 0;
while (go) {
if (parser->line_buffer[parser->line_pos + i] == '\"') {
if (!has_quote) has_quote = 1;
else has_quote = 0;
parser->line_pos += 1;
if (parser-... | 0 | C | CWE-125 | Out-of-bounds Read | The product reads data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/125.html | vulnerable |
GF_Err chnl_box_size(GF_Box *s)
{
GF_ChannelLayoutBox *ptr = (GF_ChannelLayoutBox *) s;
s->size += 1;
if (ptr->layout.stream_structure & 1) {
s->size += 1;
if (ptr->layout.definedLayout==0) {
u32 i;
for (i=0; i<ptr->layout.channels_count; i++) {
s->size+=1;
if (ptr->layout.layouts[i].position==126)... | 0 | C | CWE-125 | Out-of-bounds Read | The product reads data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/125.html | vulnerable |
GF_Err chnl_box_read(GF_Box *s,GF_BitStream *bs)
{
GF_ChannelLayoutBox *ptr = (GF_ChannelLayoutBox *) s;
ISOM_DECREASE_SIZE(s, 1)
ptr->layout.stream_structure = gf_bs_read_u8(bs);
if (ptr->layout.stream_structure & 1) {
ISOM_DECREASE_SIZE(s, 1)
ptr->layout.definedLayout = gf_bs_read_u8(bs);
if (ptr->layout.d... | 0 | C | CWE-125 | Out-of-bounds Read | The product reads data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/125.html | vulnerable |
GF_Err chnl_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_ChannelLayoutBox *ptr = (GF_ChannelLayoutBox *) s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u8(bs, ptr->layout.stream_structure);
if (ptr->layout.stream_structure & 1) {
gf_bs_write_u8(bs, ptr->layout.definedLayout);
if... | 0 | C | CWE-125 | Out-of-bounds Read | The product reads data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/125.html | vulnerable |
GF_Err gf_isom_use_compact_size(GF_ISOFile *movie, u32 trackNumber, Bool CompactionOn)
{
GF_TrackBox *trak;
u32 i, size;
GF_SampleSizeBox *stsz;
GF_Err e;
e = CanAccessMovie(movie, GF_ISOM_OPEN_WRITE);
if (e) return e;
trak = gf_isom_get_track_from_file(movie, trackNumber);
if (!trak) return GF_BAD_PARAM;
i... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
static GF_Err gf_isom_set_root_iod(GF_ISOFile *movie)
{
GF_IsomInitialObjectDescriptor *iod;
GF_IsomObjectDescriptor *od;
GF_Err e;
e = gf_isom_insert_moov(movie);
if (e) return e;
if (!movie->moov->iods) {
AddMovieIOD(movie->moov, 1);
return GF_OK;
}
//if OD, switch to IOD
if (movie->moov->iods->descrip... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
GF_Err gf_isom_update_sample_description_from_template(GF_ISOFile *file, u32 track, u32 sampleDescriptionIndex, u8 *data, u32 size)
{
GF_BitStream *bs;
GF_TrackBox *trak;
GF_Box *ent, *tpl_ent;
GF_Err e;
/*get orig sample desc and clone it*/
trak = gf_isom_get_track_from_file(file, track);
if (!trak || !sampleDe... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
static GF_SampleGroupDescriptionBox *get_sgdp(GF_SampleTableBox *stbl, void *traf, u32 grouping_type, Bool *is_traf_sgdp)
#endif /* GPAC_DISABLE_ISOM_FRAGMENTS */
{
GF_List *groupList=NULL;
GF_List **parent=NULL;
GF_SampleGroupDescriptionBox *sgdesc=NULL;
u32 count, i;
#ifndef GPAC_DISABLE_ISOM_FRAGMENTS
if (!stb... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
update_job_run (updateJobPtr job)
{
/* Here we decide on the source type and the proper execution
methods which then do anything they want with the job and
pass the processed job to update_process_finished_job()
for result dequeuing */
/* everything starting with '|' is a local command */
if (*(job->req... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
p_ntp_time(netdissect_options *ndo,
const struct l_fixedpt *lfp)
{
uint32_t i;
uint32_t uf;
uint32_t f;
double ff;
i = GET_BE_U_4(lfp->int_part);
uf = GET_BE_U_4(lfp->fraction);
ff = uf;
if (ff < 0.0) /* some compilers are buggy */
ff += FMAXINT;
ff = ff / FMAXINT; /* shift radix point by 32 bits */
... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
ahcp_time_print(netdissect_options *ndo,
const u_char *cp, uint8_t len)
{
time_t t;
struct tm *tm;
char buf[BUFSIZE];
if (len != 4)
goto invalid;
t = GET_BE_U_4(cp);
if (NULL == (tm = gmtime(&t)))
ND_PRINT(": gmtime() error");
else if (0 == strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm)... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
arista_print_date_hms_time(netdissect_options *ndo, uint32_t seconds,
uint32_t nanoseconds)
{
time_t ts;
struct tm *tm;
char buf[BUFSIZE];
ts = seconds + (nanoseconds / 1000000000);
nanoseconds %= 1000000000;
if (NULL == (tm = gmtime(&ts)))
ND_PRINT("gmtime() error");
else if (0 == strftime(buf, sizeof(buf)... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
static void zep_print_ts(netdissect_options *ndo, const u_char *p)
{
int32_t i;
uint32_t uf;
uint32_t f;
float ff;
i = GET_BE_U_4(p);
uf = GET_BE_U_4(p + 4);
ff = (float) uf;
if (ff < 0.0) /* some compilers are buggy */
ff += FMAXINT;
ff = (float) (ff / FMAXINT); /* shift radix point by 32 bits */... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
MakeFilename(char *buffer, char *orig_name, int cnt, int max_chars)
{
char *filename = malloc(PATH_MAX + 1);
if (filename == NULL)
error("%s: malloc", __func__);
/* Process with strftime if Gflag is set. */
if (Gflag != 0) {
struct tm *local_tm;
/* Conve... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
ts_date_hmsfrac_print(netdissect_options *ndo, long sec, long usec,
enum date_flag date_flag, enum time_flag time_flag)
{
time_t Time = sec;
struct tm *tm;
char timestr[32];
if ((unsigned)sec & 0x80000000) {
ND_PRINT("[Error converting time]");
return;
}
if (time_flag == LOCAL_TIME)
tm = localtime... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
void hrandfieldCommand(client *c) {
long l;
int withvalues = 0;
robj *hash;
listpackEntry ele;
if (c->argc >= 3) {
if (getLongFromObjectOrReply(c,c->argv[2],&l,NULL) != C_OK) return;
if (c->argc > 4 || (c->argc == 4 && strcasecmp(c->argv[3]->ptr,"withvalues"))) {
addRepl... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
void zrandmemberCommand(client *c) {
long l;
int withscores = 0;
robj *zset;
listpackEntry ele;
if (c->argc >= 3) {
if (getLongFromObjectOrReply(c,c->argv[2],&l,NULL) != C_OK) return;
if (c->argc > 4 || (c->argc == 4 && strcasecmp(c->argv[3]->ptr,"withscores"))) {
addRep... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
void msetGenericCommand(client *c, int nx) {
int j;
int setkey_flags = 0;
if ((c->argc % 2) == 0) {
addReplyErrorArity(c);
return;
}
/* Handle the NX flag. The MSETNX semantic is to return zero and don't
* set anything if at least one key already exists. */
if (nx) {
... | 0 | C | CWE-77 | Improper Neutralization of Special Elements used in a Command ('Command Injection') | The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/77.html | vulnerable |
static int _anetTcpServer(char *err, int port, char *bindaddr, int af, int backlog)
{
int s = -1, rv;
char _port[6]; /* strlen("65535") */
struct addrinfo hints, *servinfo, *p;
snprintf(_port,6,"%d",port);
memset(&hints,0,sizeof(hints));
hints.ai_family = af;
hints.ai_socktype = SOCK_STREA... | 0 | C | CWE-668 | Exposure of Resource to Wrong Sphere | The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. | https://cwe.mitre.org/data/definitions/668.html | vulnerable |
int anetUnixServer(char *err, char *path, mode_t perm, int backlog)
{
int s;
struct sockaddr_un sa;
if (strlen(path) > sizeof(sa.sun_path)-1) {
anetSetError(err,"unix socket path too long (%zu), must be under %zu", strlen(path), sizeof(sa.sun_path));
return ANET_ERR;
}
if ((s = anet... | 0 | C | CWE-668 | Exposure of Resource to Wrong Sphere | The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. | https://cwe.mitre.org/data/definitions/668.html | vulnerable |
static int anetListen(char *err, int s, struct sockaddr *sa, socklen_t len, int backlog) {
if (bind(s,sa,len) == -1) {
anetSetError(err, "bind: %s", strerror(errno));
close(s);
return ANET_ERR;
}
if (listen(s, backlog) == -1) {
anetSetError(err, "listen: %s", strerror(errno)... | 0 | C | CWE-668 | Exposure of Resource to Wrong Sphere | The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. | https://cwe.mitre.org/data/definitions/668.html | vulnerable |
Tss2_RC_Decode(TSS2_RC rc)
{
static __thread char buf[TSS2_ERR_LAYER_NAME_MAX + TSS2_ERR_LAYER_ERROR_STR_MAX + 1];
clearbuf(buf);
UINT8 layer = tss2_rc_layer_number_get(rc);
TSS2_RC_HANDLER handler = layer_handler[layer].handler;
const char *lname = layer_handler[layer].name;
if (lname[0]) {... | 0 | C | CWE-120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | https://cwe.mitre.org/data/definitions/120.html | vulnerable |
unknown_layer_handler(TSS2_RC rc)
{
static __thread char buf[32];
clearbuf(buf);
catbuf(buf, "0x%X", tpm2_error_get(rc));
return buf;
} | 0 | C | CWE-120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | https://cwe.mitre.org/data/definitions/120.html | vulnerable |
test_custom_handler(void **state)
{
(void) state;
/*
* Test registering a custom handler
*/
TSS2_RC_HANDLER old = Tss2_RC_SetHandler(1, "cstm", custom_err_handler);
assert_null(old);
/*
* Test getting error strings
*/
unsigned i;
for (i = 1; i < 4; i++) {
// Mak... | 0 | C | CWE-120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | https://cwe.mitre.org/data/definitions/120.html | vulnerable |
sigterm_handler(int sig) // I - Signal number (unused)
{
(void)sig;
fprintf(stderr,
"DEBUG: beh: Job canceled.\n");
if (job_canceled)
_exit(CUPS_BACKEND_OK);
else
job_canceled = 1;
} | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
call_backend(char *uri, // I - URI of final destination
int argc, // I - Number of command line
// arguments
char **argv, // I - Command-line arguments
char *filename) // I - File name of input data
{
const char *cups_... | 0 | C | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
_pdfioDictSetValue(
pdfio_dict_t *dict, // I - Dictionary
const char *key, // I - Key
_pdfio_value_t *value) // I - Value
{
_pdfio_pair_t *pair; // Current pair
PDFIO_DEBUG("_pdfioDictSetValue(dict=%p, key=\"%s\", value=%p)\n", dict, key, (void *)value);
// See if the key is already set.... | 0 | C | CWE-835 | Loop with Unreachable Exit Condition ('Infinite Loop') | The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. | https://cwe.mitre.org/data/definitions/835.html | vulnerable |
_pdfioTokenGet(_pdfio_token_t *tb, // I - Token buffer/stack
char *buffer, // I - String buffer
size_t bufsize) // I - Size of string buffer
{
// See if we have a token waiting on the stack...
if (tb->num_tokens > 0)
{
// Yes, return it...
tb->num_tokens --;
strncpy(b... | 0 | C | CWE-835 | Loop with Unreachable Exit Condition ('Infinite Loop') | The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. | https://cwe.mitre.org/data/definitions/835.html | vulnerable |
static void _clean_slate_datagram(gnrc_sixlowpan_frag_fb_t *fbuf)
{
clist_node_t new_queue = { .next = NULL };
fbuf->sfr.arq_timeout_event.msg.content.ptr = NULL;
/* remove potentially scheduled timers for this datagram */
evtimer_del((evtimer_t *)(&_arq_timer),
&fbuf->sfr.arq_timeout_e... | 0 | C | CWE-362 | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The product contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. | https://cwe.mitre.org/data/definitions/362.html | vulnerable |
static void _sched_arq_timeout(gnrc_sixlowpan_frag_fb_t *fbuf, uint32_t offset)
{
if (IS_ACTIVE(CONFIG_GNRC_SIXLOWPAN_SFR_MOCK_ARQ_TIMER)) {
/* mock does not need to be scheduled */
return;
}
if (fbuf->sfr.arq_timeout_event.msg.content.ptr != NULL) {
DEBUG("6lo sfr: ARQ timeout for d... | 0 | C | CWE-362 | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The product contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. | https://cwe.mitre.org/data/definitions/362.html | vulnerable |
compat_cipher_proposal(struct ssh *ssh, char *cipher_prop)
{
if (!(ssh->compat & SSH_BUG_BIGENDIANAES))
return cipher_prop;
debug2_f("original cipher proposal: %s", cipher_prop);
if ((cipher_prop = match_filter_denylist(cipher_prop, "aes*")) == NULL)
fatal("match_filter_denylist failed");
debug2_f("compat ciphe... | 0 | C | CWE-415 | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | https://cwe.mitre.org/data/definitions/415.html | vulnerable |
compat_kex_proposal(struct ssh *ssh, char *p)
{
if ((ssh->compat & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0)
return p;
debug2_f("original KEX proposal: %s", p);
if ((ssh->compat & SSH_BUG_CURVE25519PAD) != 0)
if ((p = match_filter_denylist(p,
"curve25519-sha256@libssh.org")) == NULL)
fatal("match_fil... | 0 | C | CWE-415 | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | https://cwe.mitre.org/data/definitions/415.html | vulnerable |
compat_pkalg_proposal(struct ssh *ssh, char *pkalg_prop)
{
if (!(ssh->compat & SSH_BUG_RSASIGMD5))
return pkalg_prop;
debug2_f("original public key proposal: %s", pkalg_prop);
if ((pkalg_prop = match_filter_denylist(pkalg_prop, "ssh-rsa")) == NULL)
fatal("match_filter_denylist failed");
debug2_f("compat public ... | 0 | C | CWE-415 | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | https://cwe.mitre.org/data/definitions/415.html | vulnerable |
process_request_identities(SocketEntry *e)
{
Identity *id;
struct sshbuf *msg, *keys;
int r;
u_int nentries = 0;
debug2_f("entering");
if ((msg = sshbuf_new()) == NULL || (keys = sshbuf_new()) == NULL)
fatal_f("sshbuf_new failed");
TAILQ_FOREACH(id, &idtab->idlist, next) {
/* identity not visible, don't in... | 0 | C | NVD-CWE-noinfo | null | null | null | vulnerable |
static int ntlm_decode_u16l_str_hdr(struct ntlm_ctx *ctx,
struct wire_field_hdr *str_hdr,
struct ntlm_buffer *buffer,
size_t payload_offs, char **str)
{
char *in, *out = NULL;
uint16_t str_len;
uint32... | 0 | C | CWE-787 | Out-of-bounds Write | The product writes data past the end, or before the beginning, of the intended buffer. | https://cwe.mitre.org/data/definitions/787.html | vulnerable |
void SetClipboardText(const char *text)
{
#if defined(PLATFORM_DESKTOP)
glfwSetClipboardString(CORE.Window.handle, text);
#endif
#if defined(PLATFORM_WEB)
emscripten_run_script(TextFormat("navigator.clipboard.writeText('%s')", text));
#endif
} | 0 | C | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
const char *GetClipboardText(void)
{
#if defined(PLATFORM_DESKTOP)
return glfwGetClipboardString(CORE.Window.handle);
#endif
#if defined(PLATFORM_WEB)
// Accessing clipboard data from browser is tricky due to security reasons
// The method to use is navigator.clipboard.readText() but this is an asynchronous... | 0 | C | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
static memcached_return_t _read_one_response(memcached_instance_st *instance, char *buffer,
const size_t buffer_length,
memcached_result_st *result) {
memcached_server_response_decrement(instance);
if (result == NULL) {
M... | 0 | C | CWE-200 | Exposure of Sensitive Information to an Unauthorized Actor | The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. | https://cwe.mitre.org/data/definitions/200.html | vulnerable |
ascii_load_sockaddr(struct sockaddr_storage *ss, char *buf)
{
struct sockaddr_in6 ssin6;
struct sockaddr_in ssin;
memset(&ssin, 0, sizeof ssin);
memset(&ssin6, 0, sizeof ssin6);
if (!strcmp("local", buf)) {
ss->ss_family = AF_LOCAL;
}
else if (buf[0] == '[' && buf[strlen(buf)-1] == ']') {
buf[strlen(buf)-... | 0 | C | NVD-CWE-noinfo | null | null | null | vulnerable |
sshsk_open(const char *path)
{
struct sshsk_provider *ret = NULL;
uint32_t version;
if (path == NULL || *path == '\0') {
error("No FIDO SecurityKeyProvider specified");
return NULL;
}
if ((ret = calloc(1, sizeof(*ret))) == NULL) {
error_f("calloc failed");
return NULL;
}
if ((ret->path = strdup(path)) =... | 0 | C | CWE-428 | Unquoted Search Path or Element | The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path. | https://cwe.mitre.org/data/definitions/428.html | vulnerable |
wsemul_sun_output_control(struct wsemul_sun_emuldata *edp,
struct wsemul_inputstate *instate)
{
int oargs;
int rc;
switch (instate->inchar) {
case '0': case '1': case '2': case '3': case '4': /* argument digit */
case '5': case '6': case '7': case '8': case '9':
/*
* If we receive more arguments than we ... | 0 | C | CWE-862 | Missing Authorization | The product does not perform an authorization check when an actor attempts to access a resource or perform an action. | https://cwe.mitre.org/data/definitions/862.html | vulnerable |
wsemul_vt100_output_csi(struct wsemul_vt100_emuldata *edp,
struct wsemul_inputstate *instate)
{
u_int newstate = VT100_EMUL_STATE_CSI;
int oargs;
int rc = 0;
switch (instate->inchar) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
/* argument digit */
... | 0 | C | CWE-862 | Missing Authorization | The product does not perform an authorization check when an actor attempts to access a resource or perform an action. | https://cwe.mitre.org/data/definitions/862.html | vulnerable |
wsemul_vt100_output_dcs(struct wsemul_vt100_emuldata *edp,
struct wsemul_inputstate *instate)
{
u_int newstate = VT100_EMUL_STATE_DCS;
switch (instate->inchar) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
/* argument digit */
if (edp->nargs > VT100_E... | 0 | C | CWE-862 | Missing Authorization | The product does not perform an authorization check when an actor attempts to access a resource or perform an action. | https://cwe.mitre.org/data/definitions/862.html | vulnerable |
static pj_status_t transport_destroy (pjmedia_transport *tp)
{
struct tp_adapter *adapter = (struct tp_adapter*)tp;
/* Close the slave transport */
if (adapter->del_base) {
pjmedia_transport_close(adapter->slave_tp);
}
/* Self destruct.. */
pj_pool_release(adapter->pool);
return ... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static pj_status_t transport_destroy(pjmedia_transport *tp)
{
struct transport_loop *loop = (struct transport_loop*) tp;
/* Sanity check */
PJ_ASSERT_RETURN(tp, PJ_EINVAL);
pj_pool_release(loop->pool);
return PJ_SUCCESS;
} | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static pj_status_t transport_destroy (pjmedia_transport *tp)
{
transport_srtp *srtp = (transport_srtp *) tp;
pj_status_t status;
unsigned i;
PJ_ASSERT_RETURN(tp, PJ_EINVAL);
/* Close all keying. Note that any keying should not be destroyed before
* SRTP transport is destroyed as re-INVITE ma... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static void clock_cb(const pj_timestamp *ts, void *user_data)
{
dtls_srtp_channel *ds_ch = (dtls_srtp_channel*)user_data;
dtls_srtp *ds = ds_ch->dtls_srtp;
unsigned idx = ds_ch->channel;
PJ_UNUSED_ARG(ts);
pj_lock_acquire(ds->ossl_lock);
if (!ds->ossl_ssl[idx]) {
pj_lock_release(ds->o... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static pj_status_t dtls_create(transport_srtp *srtp,
pjmedia_transport **p_keying)
{
dtls_srtp *ds;
pj_pool_t *pool;
pj_status_t status;
pool = pj_pool_create(srtp->pool->factory, "dtls%p",
2000, 256, NULL);
ds = PJ_POOL_ZALLOC_T(pool, dtls_srtp... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static pj_status_t ssl_match_fingerprint(dtls_srtp *ds, unsigned idx)
{
X509 *rem_cert;
pj_bool_t is_sha256;
char buf[128];
pj_size_t buf_len = sizeof(buf);
pj_status_t status;
/* Check hash algo, currently we only support SHA-256 & SHA-1 */
if (!pj_strnicmp2(&ds->rem_fingerprint, "SHA-256 ... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static pj_status_t ssl_on_recv_packet(dtls_srtp *ds, unsigned idx,
const void *data, pj_size_t len)
{
char tmp[128];
pj_size_t nwritten;
pj_lock_acquire(ds->ossl_lock);
if (!ds->ossl_rbio[idx]) {
pj_lock_release(ds->ossl_lock);
return PJ_EGONE;
... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static pj_status_t dtls_destroy(pjmedia_transport *tp)
{
dtls_srtp *ds = (dtls_srtp *)tp;
#if DTLS_DEBUG
PJ_LOG(2,(ds->base.name, "dtls_destroy()"));
#endif
dtls_destroy_channel(ds, RTP_CHANNEL);
dtls_destroy_channel(ds, RTCP_CHANNEL);
if (ds->ossl_lock) {
pj_lock_destroy(ds->ossl_lock);
... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static void ssl_destroy(dtls_srtp *ds, unsigned idx)
{
pj_lock_acquire(ds->ossl_lock);
/* Destroy SSL instance */
if (ds->ossl_ssl[idx]) {
/**
* Avoid calling SSL_shutdown() if handshake wasn't completed.
* OpenSSL 1.0.2f complains if SSL_shutdown() is called during an
* ... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static pj_status_t transport_destroy(pjmedia_transport *tp)
{
struct transport_udp *udp = (struct transport_udp*) tp;
/* Sanity check */
PJ_ASSERT_RETURN(tp, PJ_EINVAL);
/* Must not close while application is using this */
//PJ_ASSERT_RETURN(!udp->attached, PJ_EINVALIDOP);
if (udp->rtp_k... | 0 | C | CWE-416 | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. | https://cwe.mitre.org/data/definitions/416.html | vulnerable |
static RzList /*<RzDebugMap *>*/ *__io_maps(RzDebug *dbg) {
RzList *list = rz_list_new();
char *str = dbg->iob.system(dbg->iob.io, "dm");
if (!str) {
rz_list_free(list);
return NULL;
}
char *ostr = str;
ut64 map_start, map_end;
char perm[32];
char name[512];
for (;;) {
char *nl = strchr(str, '\n');
if ... | 0 | C | CWE-120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | https://cwe.mitre.org/data/definitions/120.html | vulnerable |
static RzList /*<RzDebugMap *>*/ *__io_maps(RzDebug *dbg) {
RzList *list = rz_list_new();
char *str = dbg->iob.system(dbg->iob.io, "dm");
if (!str) {
rz_list_free(list);
return NULL;
}
char *ostr = str;
ut64 map_start, map_end;
char perm[32];
char name[512];
for (;;) {
char *nl = strchr(str, '\n');
if ... | 0 | C | CWE-121 | Stack-based Buffer Overflow | A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function). | https://cwe.mitre.org/data/definitions/121.html | vulnerable |
int delete_sdp_line( struct sip_msg * msg, char * s)
{
char * start,*end;
if( !s )
return 1;
start = s;
end = s;
while(*start != '\n')
start--;
start++;
while(*end != '\n')
end++;
end++;
/* delete the entry */
if( del_lump(msg, start - msg->buf, end - start,0) == NULL )
{
return -1;
}
return... | 0 | C | NVD-CWE-noinfo | null | null | null | vulnerable |
int delete_sdp_line( struct sip_msg * msg, char * s, struct sdp_stream_cell *stream)
{
char * start,*end;
if( !s )
return 1;
start = s;
end = s;
while(*start != '\n' && start > stream->body.s)
start--;
start++;
while(*end != '\n' && end < (stream->body.s+stream->body.len) )
end++;
end++;
/* delete ... | 0 | C | NVD-CWE-noinfo | null | null | null | vulnerable |
char* parse_content_length( char* buffer, char* end, int* length)
{
int number;
char *p;
int size;
p = buffer;
/* search the beginning of the number */
while ( p<end && (*p==' ' || *p=='\t' || (*p=='\r' && *(p+1)=='\n') ||
(*p=='\n' && (*(p+1)==' '||*(p+1)=='\t')) ))
p++;
if (p==end)
goto error;
/* parse... | 0 | C | CWE-190 | Integer Overflow or Wraparound | The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | https://cwe.mitre.org/data/definitions/190.html | vulnerable |
print_perm_line (int idx,
GPtrArray *items,
int cols)
{
g_autoptr(GString) res = g_string_new (NULL);
int i;
g_string_append_printf (res, " [%d] %s", idx, (char *) items->pdata[0]);
for (i = 1; i < items->len; i++)
{
char *p;
int len;
p... | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
load_kernel_module_list (void)
{
GHashTable *modules = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
g_autofree char *modules_data = NULL;
g_autoptr(GError) error = NULL;
char *start, *end;
if (!g_file_get_contents ("/proc/modules", &modules_data, NULL, &error))
{
g_info ("Failed... | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
flatpak_context_set_persistent (FlatpakContext *context,
const char *path)
{
g_hash_table_insert (context->persistent, g_strdup (path), GINT_TO_POINTER (1));
} | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
option_persist_cb (const gchar *option_name,
const gchar *value,
gpointer data,
GError **error)
{
FlatpakContext *context = data;
flatpak_context_set_persistent (context, value);
return TRUE;
} | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
context_parse_args (FlatpakContext *context,
...)
{
g_autoptr(GError) local_error = NULL;
g_autoptr(GOptionContext) oc = NULL;
g_autoptr(GOptionGroup) group = NULL;
g_autoptr(GPtrArray) args = g_ptr_array_new_with_free_func (g_free);
g_auto(GStrv) argv = NULL;
const char *arg;
va_list ... | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
struct mosquitto *context__init(mosq_sock_t sock)
{
struct mosquitto *context;
char address[1024];
context = mosquitto__calloc(1, sizeof(struct mosquitto));
if(!context) return NULL;
#ifdef WITH_EPOLL
context->ident = id_client;
#else
context->pollfd_index = -1;
#endif
mosquitto__set_state(context, mosq_cs_new... | 0 | C | CWE-401 | Missing Release of Memory after Effective Lifetime | The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | https://cwe.mitre.org/data/definitions/401.html | vulnerable |
void context__cleanup(struct mosquitto *context, bool force_free)
{
struct mosquitto__packet *packet;
if(!context) return;
if(force_free){
context->clean_start = true;
}
#ifdef WITH_BRIDGE
if(context->bridge){
bridge__cleanup(context);
}
#endif
alias__free_all(context);
mosquitto__free(context->auth_me... | 0 | C | CWE-401 | Missing Release of Memory after Effective Lifetime | The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | https://cwe.mitre.org/data/definitions/401.html | vulnerable |
int db__message_store_find(struct mosquitto *context, uint16_t mid, struct mosquitto_msg_store **stored)
{
struct mosquitto_client_msg *tail;
if(!context) return MOSQ_ERR_INVAL;
*stored = NULL;
DL_FOREACH(context->msgs_in.inflight, tail){
if(tail->store->source_mid == mid){
*stored = tail->store;
return M... | 0 | C | CWE-401 | Missing Release of Memory after Effective Lifetime | The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | https://cwe.mitre.org/data/definitions/401.html | vulnerable |
match_expr(struct search_node_list *head, struct eventlog *evlog, bool last_match)
{
struct search_node *sn;
bool res = false, matched = last_match;
int rc;
debug_decl(match_expr, SUDO_DEBUG_UTIL);
STAILQ_FOREACH(sn, head, entries) {
switch (sn->type) {
case ST_EXPR:
res = match_expr(&sn->u.... | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
match_expr(struct search_node_list *head, struct eventlog *evlog, bool last_match)
{
struct search_node *sn;
bool res = false, matched = last_match;
int rc;
debug_decl(match_expr, SUDO_DEBUG_UTIL);
STAILQ_FOREACH(sn, head, entries) {
switch (sn->type) {
case ST_EXPR:
res = match_expr(&sn->u.... | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
list_session(char *log_dir, regex_t *re, const char *user, const char *tty)
{
char idbuf[7], *idstr, *cp;
struct eventlog *evlog = NULL;
const char *timestr;
int ret = -1;
debug_decl(list_session, SUDO_DEBUG_UTIL);
if ((evlog = iolog_parse_loginfo(-1, log_dir)) == NULL)
goto done;
if (evl... | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
list_session(char *log_dir, regex_t *re, const char *user, const char *tty)
{
char idbuf[7], *idstr, *cp;
struct eventlog *evlog = NULL;
const char *timestr;
int ret = -1;
debug_decl(list_session, SUDO_DEBUG_UTIL);
if ((evlog = iolog_parse_loginfo(-1, log_dir)) == NULL)
goto done;
if (evl... | 0 | C | CWE-116 | Improper Encoding or Escaping of Output | The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. | https://cwe.mitre.org/data/definitions/116.html | vulnerable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.