func_name
stringlengths
2
53
func_src_before
stringlengths
63
114k
func_src_after
stringlengths
86
114k
line_changes
dict
char_changes
dict
commit_link
stringlengths
66
117
file_name
stringlengths
5
72
vul_type
stringclasses
9 values
sctp_sf_ootb
sctp_disposition_t sctp_sf_ootb(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sk_buff *skb = chunk->skb; sctp_chunkhdr_t *ch; sctp_errhdr_t *err; __u8...
sctp_disposition_t sctp_sf_ootb(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sk_buff *skb = chunk->skb; sctp_chunkhdr_t *ch; sctp_errhdr_t *err; __u8...
{ "deleted": [ { "line_no": 56, "char_start": 1500, "char_end": 1548, "line": "\t\t/* Report violation if chunk len overflows */\n" }, { "line_no": 57, "char_start": 1548, "char_end": 1604, "line": "\t\tch_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));\n...
{ "deleted": [ { "char_start": 1498, "char_end": 1723, "chars": "\n\n\t\t/* Report violation if chunk len overflows */\n\t\tch_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));\n\t\tif (ch_end > skb_tail_pointer(skb))\n\t\t\treturn sctp_sf_violation_chunklen(net, ep, asoc, type, arg,\n\t\t\t\t\...
github.com/torvalds/linux/commit/bf911e985d6bbaa328c20c3e05f4eb03de11fdd6
net/sctp/sm_statefuns.c
cwe-125
asylo::primitives::TrustedPrimitives::UntrustedCall
PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector, MessageWriter *input, MessageReader *output) { int ret; UntrustedCacheMalloc *untrusted_cache = UntrustedCacheMalloc::Instance(); SgxPar...
PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector, MessageWriter *input, MessageReader *output) { int ret; UntrustedCacheMalloc *untrusted_cache = UntrustedCacheMalloc::Instance(); SgxPar...
{ "deleted": [], "added": [ { "line_no": 29, "char_start": 1137, "char_end": 1200, "line": " if (!TrustedPrimitives::IsOutsideEnclave(sgx_params->output,\n" }, { "line_no": 30, "char_start": 1200, "char_end": 1271, "line": " ...
{ "deleted": [], "added": [ { "char_start": 1143, "char_end": 1395, "chars": "!TrustedPrimitives::IsOutsideEnclave(sgx_params->output,\n sgx_params->output_size)) {\n TrustedPrimitives::BestEffortAbort(\n \"UntrustedCall: sgx_param output sho...
github.com/google/asylo/commit/83036fd841d33baa7e039f842d131aa7881fdcc2
asylo/platform/primitives/sgx/trusted_sgx.cc
cwe-125
string_scan_range
static int string_scan_range(RList *list, const ut8 *buf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (!buf...
static int string_scan_range(RList *list, const ut8 *buf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (!buf...
{ "deleted": [ { "line_no": 123, "char_start": 2779, "char_end": 2786, "line": "\t\t\t\t\t{\n" }, { "line_no": 124, "char_start": 2786, "char_end": 2829, "line": "\t\t\t\t\t\tconst ut8 *p = buf + str_start - 2;\n" }, { "line_no": 131, "c...
{ "deleted": [ { "char_start": 2810, "char_end": 2811, "chars": " " }, { "char_start": 2995, "char_end": 2996, "chars": " " } ], "added": [ { "char_start": 2784, "char_end": 2803, "chars": "if (str_start > 1) " }, { "char_star...
github.com/radare/radare2/commit/d31c4d3cbdbe01ea3ded16a584de94149ecd31d9
libr/bin/bin.c
cwe-125
ReadMATImage
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; PixelPacket *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; unsign...
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; PixelPacket *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; unsign...
{ "deleted": [], "added": [ { "line_no": 336, "char_start": 12091, "char_end": 12142, "line": " quantum_info=DestroyQuantumInfo(quantum_info);\n" } ] }
{ "deleted": [], "added": [ { "char_start": 12091, "char_end": 12142, "chars": " quantum_info=DestroyQuantumInfo(quantum_info);\n" } ] }
github.com/ImageMagick/ImageMagick/commit/b173a352397877775c51c9a0e9d59eb6ce24c455
coders/mat.c
cwe-125
bitmap_cache_new
rdpBitmapCache* bitmap_cache_new(rdpSettings* settings) { int i; rdpBitmapCache* bitmapCache; bitmapCache = (rdpBitmapCache*)calloc(1, sizeof(rdpBitmapCache)); if (!bitmapCache) return NULL; bitmapCache->settings = settings; bitmapCache->update = ((freerdp*)settings->instance)->update; bitmapCache->context =...
rdpBitmapCache* bitmap_cache_new(rdpSettings* settings) { int i; rdpBitmapCache* bitmapCache; bitmapCache = (rdpBitmapCache*)calloc(1, sizeof(rdpBitmapCache)); if (!bitmapCache) return NULL; bitmapCache->settings = settings; bitmapCache->update = ((freerdp*)settings->instance)->update; bitmapCache->context =...
{ "deleted": [ { "line_no": 13, "char_start": 351, "char_end": 409, "line": "\tbitmapCache->maxCells = settings->BitmapCacheV2NumCells;\n" }, { "line_no": 14, "char_start": 409, "char_end": 503, "line": "\tbitmapCache->cells = (BITMAP_V2_CELL*)calloc(bitmapC...
{ "deleted": [ { "char_start": 365, "char_end": 369, "chars": "maxC" }, { "char_start": 375, "char_end": 408, "chars": " settings->BitmapCacheV2NumCells;" }, { "char_start": 410, "char_end": 428, "chars": "bitmapCache->cells" }, { ...
github.com/FreeRDP/FreeRDP/commit/58dc36b3c883fd460199cedb6d30e58eba58298c
libfreerdp/cache/bitmap.c
cwe-125
ImagingPcxDecode
ImagingPcxDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8 n; UINT8* ptr; if ((state->xsize * state->bits + 7) / 8 > state->bytes) { state->errcode = IMAGING_CODEC_OVERRUN; return -1; } ptr = buf; for (;;) { if (bytes < 1) return ptr - b...
ImagingPcxDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8 n; UINT8* ptr; if ((state->xsize * state->bits + 7) / 8 > state->bytes) { state->errcode = IMAGING_CODEC_OVERRUN; return -1; } ptr = buf; for (;;) { if (bytes < 1) return ptr - b...
{ "deleted": [ { "line_no": 6, "char_start": 116, "char_end": 179, "line": " if (strcmp(im->mode, \"1\") == 0 && state->xsize > state->bytes * 8) {\n" }, { "line_no": 7, "char_start": 179, "char_end": 227, "line": " state->errcode = IMAGING_CODEC_O...
{ "deleted": [], "added": [] }
github.com/python-pillow/Pillow/commit/6a83e4324738bb0452fbe8074a995b1c73f08de7#diff-9478f2787e3ae9668a15123b165c23ac
src/libImaging/PcxDecode.c
cwe-125
glyph_cache_put
BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph) { rdpGlyph* prevGlyph; if (id > 9) { WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id); return FALSE; } if (index > glyphCache->glyphCache[id].number) { WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " in...
BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph) { rdpGlyph* prevGlyph; if (id > 9) { WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id); return FALSE; } if (index >= glyphCache->glyphCache[id].number) { WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " i...
{ "deleted": [ { "line_no": 11, "char_start": 211, "char_end": 259, "line": "\tif (index > glyphCache->glyphCache[id].number)\n" } ], "added": [ { "line_no": 11, "char_start": 211, "char_end": 260, "line": "\tif (index >= glyphCache->glyphCache[id].numbe...
{ "deleted": [], "added": [ { "char_start": 223, "char_end": 224, "chars": "=" } ] }
github.com/FreeRDP/FreeRDP/commit/c0fd449ec0870b050d350d6d844b1ea6dad4bc7d
libfreerdp/cache/glyph.c
cwe-125
read_Header
read_Header(struct archive_read *a, struct _7z_header_info *h, int check_header_id) { struct _7zip *zip = (struct _7zip *)a->format->data; const unsigned char *p; struct _7z_folder *folders; struct _7z_stream_info *si = &(zip->si); struct _7zip_entry *entries; uint32_t folderIndex, indexInFolder; unsigned i;...
read_Header(struct archive_read *a, struct _7z_header_info *h, int check_header_id) { struct _7zip *zip = (struct _7zip *)a->format->data; const unsigned char *p; struct _7z_folder *folders; struct _7z_stream_info *si = &(zip->si); struct _7zip_entry *entries; uint32_t folderIndex, indexInFolder; unsigned i;...
{ "deleted": [], "added": [ { "line_no": 90, "char_start": 1753, "char_end": 1789, "line": "\t\t\tif (h->emptyStreamBools != NULL)\n" }, { "line_no": 91, "char_start": 1789, "char_end": 1806, "line": "\t\t\t\treturn (-1);\n" }, { "line_no": 1...
{ "deleted": [ { "char_start": 1808, "char_end": 1808, "chars": "" }, { "char_start": 4268, "char_end": 4268, "chars": "" } ], "added": [ { "char_start": 1756, "char_end": 1809, "chars": "if (h->emptyStreamBools != NULL)\n\t\t\t\treturn (-1...
github.com/libarchive/libarchive/commit/7f17c791dcfd8c0416e2cd2485b19410e47ef126
libarchive/archive_read_support_format_7zip.c
cwe-125
ReadRLEImage
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define SkipLinesOp 0x01 #define SetColorOp 0x02 #define SkipPixelsOp 0x03 #define ByteDataOp 0x05 #define RunDataOp 0x06 #define EOFOp 0x07 char magick[12]; Image *image; int opcode, operand, status; ...
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define SkipLinesOp 0x01 #define SetColorOp 0x02 #define SkipPixelsOp 0x03 #define ByteDataOp 0x05 #define RunDataOp 0x06 #define EOFOp 0x07 char magick[12]; Image *image; int opcode, operand, status; ...
{ "deleted": [ { "line_no": 185, "char_start": 4971, "char_end": 5052, "line": " if ((number_pixels*number_planes) != (size_t) (number_pixels*number_planes))\n" }, { "line_no": 187, "char_start": 5125, "char_end": 5202, "line": " pixel_info_length=imag...
{ "deleted": [ { "char_start": 5174, "char_end": 5184, "chars": "MagickMax(" }, { "char_start": 5197, "char_end": 5200, "chars": ",4)" } ], "added": [ { "char_start": 647, "char_end": 673, "chars": "number_planes_filled,\n " }, {...
github.com/ImageMagick/ImageMagick/commit/2ad6d33493750a28a5a655d319a8e0b16c392de1
coders/rle.c
cwe-125
HPHP::JSON_parser
bool JSON_parser(Variant &z, const char *p, int length, bool const assoc, int depth, int64_t options) { // No GC safepoints during JSON parsing, please. Code is not re-entrant. NoHandleSurpriseScope no_surprise(SafepointFlags); json_parser *json = s_json_parser.get(); /* the parser state */ //...
bool JSON_parser(Variant &z, const char *p, int length, bool const assoc, int depth, int64_t options) { // No GC safepoints during JSON parsing, please. Code is not re-entrant. NoHandleSurpriseScope no_surprise(SafepointFlags); json_parser *json = s_json_parser.get(); /* the parser state */ //...
{ "deleted": [], "added": [ { "line_no": 11, "char_start": 548, "char_end": 568, "line": " if (depth <= 0) {\n" }, { "line_no": 12, "char_start": 568, "char_end": 627, "line": " json->error_code = json_error_codes::JSON_ERROR_DEPTH;\n" }, { ...
{ "deleted": [], "added": [ { "char_start": 550, "char_end": 651, "chars": "if (depth <= 0) {\n json->error_code = json_error_codes::JSON_ERROR_DEPTH;\n return false;\n }\n " } ] }
github.com/facebook/hhvm/commit/dabd48caf74995e605f1700344f1ff4a5d83441d
hphp/runtime/ext/json/JSON_parser.cpp
cwe-125
jpc_pi_nextrpcl
static int jpc_pi_nextrpcl(register jpc_pi_t *pi) { int rlvlno; jpc_pirlvl_t *pirlvl; jpc_pchg_t *pchg; int prchind; int prcvind; int *prclyrno; int compno; jpc_picomp_t *picomp; int xstep; int ystep; uint_fast32_t r; uint_fast32_t rpx; uint_fast32_t rpy; uint_fast32_t trx0; uint_fast32_t try0; pchg = ...
static int jpc_pi_nextrpcl(register jpc_pi_t *pi) { int rlvlno; jpc_pirlvl_t *pirlvl; jpc_pchg_t *pchg; int prchind; int prcvind; int *prclyrno; int compno; jpc_picomp_t *picomp; int xstep; int ystep; uint_fast32_t r; uint_fast32_t rpx; uint_fast32_t rpy; uint_fast32_t trx0; uint_fast32_t try0; pchg = ...
{ "deleted": [ { "line_no": 30, "char_start": 656, "char_end": 710, "line": "\t\t\t\tif (pirlvl->prcwidthexpn + pi->picomp->numrlvls >\n" }, { "line_no": 32, "char_start": 746, "char_end": 799, "line": "\t\t\t\t pirlvl->prcheightexpn + pi->picomp->numrlvls ...
{ "deleted": [ { "char_start": 689, "char_end": 693, "chars": "->pi" }, { "char_start": 776, "char_end": 780, "chars": "pi->" } ], "added": [] }
github.com/mdadams/jasper/commit/f25486c3d4aa472fec79150f2c41ed4333395d3d
src/libjasper/jpc/jpc_t2cod.c
cwe-125
match_at
match_at(regex_t* reg, const UChar* str, const UChar* end, #ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE const UChar* right_range, #endif const UChar* sstart, UChar* sprev, OnigMatchArg* msa) { static UChar FinishCode[] = { OP_FINISH }; int i, n, num_mem, best_len, pop_level; LengthType tlen, tlen...
match_at(regex_t* reg, const UChar* str, const UChar* end, #ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE const UChar* right_range, #endif const UChar* sstart, UChar* sprev, OnigMatchArg* msa) { static UChar FinishCode[] = { OP_FINISH }; int i, n, num_mem, best_len, pop_level; LengthType tlen, tlen...
{ "deleted": [ { "line_no": 190, "char_start": 6067, "char_end": 6100, "line": " if (*p != *s++) goto fail;\n" }, { "line_no": 191, "char_start": 6100, "char_end": 6122, "line": " DATA_ENSURE(0);\n" }, { "line_no": 192, "char_st...
{ "deleted": [ { "char_start": 5985, "char_end": 5991, "chars": "#if 0\n" }, { "char_start": 6056, "char_end": 6129, "chars": "++;\n#endif\n if (*p != *s++) goto fail;\n DATA_ENSURE(0);\n p" } ], "added": [] }
github.com/kkos/oniguruma/commit/690313a061f7a4fa614ec5cc8368b4f2284e059b
src/regexec.c
cwe-125
ReadPSDImage
static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType has_merged_image, skip_layers; MagickOffsetType offset; MagickSizeType length; MagickBooleanType status; PSDInfo psd_info; register ssize_t i; ssize_t...
static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType has_merged_image, skip_layers; MagickOffsetType offset; MagickSizeType length; MagickBooleanType status; PSDInfo psd_info; register ssize_t i; ssize_t...
{ "deleted": [], "added": [ { "line_no": 162, "char_start": 5509, "char_end": 5577, "line": " if ((image->depth == 1) && (image->storage_class != PseudoClass))\n" }, { "line_no": 163, "char_start": 5577, "char_end": 5645, "line": " ThrowReaderException...
{ "deleted": [], "added": [ { "char_start": 5511, "char_end": 5647, "chars": "if ((image->depth == 1) && (image->storage_class != PseudoClass))\n ThrowReaderException(CorruptImageError, \"ImproperImageHeader\");\n " } ] }
github.com/ImageMagick/ImageMagick/commit/198fffab4daf8aea88badd9c629350e5b26ec32f
coders/psd.c
cwe-125
decode_bundle
decode_bundle(bool load, const struct nx_action_bundle *nab, const struct vl_mff_map *vl_mff_map, uint64_t *tlv_bitmap, struct ofpbuf *ofpacts) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); struct ofpact_bundle *bundle; uint32_t slave_type; size_t slaves_si...
decode_bundle(bool load, const struct nx_action_bundle *nab, const struct vl_mff_map *vl_mff_map, uint64_t *tlv_bitmap, struct ofpbuf *ofpacts) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); struct ofpact_bundle *bundle; uint32_t slave_type; size_t slaves_si...
{ "deleted": [ { "line_no": 67, "char_start": 2651, "char_end": 2657, "line": " }\n" }, { "line_no": 68, "char_start": 2657, "char_end": 2658, "line": "\n" }, { "line_no": 69, "char_start": 2658, "char_end": 2703, "line": "...
{ "deleted": [ { "char_start": 2656, "char_end": 2657, "chars": "\n" } ], "added": [ { "char_start": 2656, "char_end": 2663, "chars": " else {" }, { "char_start": 2664, "char_end": 2668, "chars": " " }, { "char_start": 2721...
github.com/openvswitch/ovs/commit/9237a63c47bd314b807cda0bd2216264e82edbe8
lib/ofp-actions.c
cwe-125
SpliceImage
MagickExport Image *SpliceImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { #define SpliceImageTag "Splice/Image" CacheView *image_view, *splice_view; Image *splice_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo splic...
MagickExport Image *SpliceImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { #define SpliceImageTag "Splice/Image" CacheView *image_view, *splice_view; Image *splice_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo splic...
{ "deleted": [ { "line_no": 130, "char_start": 3435, "char_end": 3511, "line": " p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);\n" }, { "line_no": 138, "char_start": 3734, "char_end": 3776, "line": " for (x=0; x < splice_geomet...
{ "deleted": [ { "char_start": 3752, "char_end": 3756, "chars": "spli" }, { "char_start": 3757, "char_end": 3761, "chars": "e_ge" }, { "char_start": 3763, "char_end": 3769, "chars": "etry.x" }, { "char_start": 7046, "char_en...
github.com/ImageMagick/ImageMagick/commit/7b1cf5784b5bcd85aa9293ecf56769f68c037231
MagickCore/transform.c
cwe-125
wrap_lines_smart
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
{ "deleted": [ { "line_no": 100, "char_start": 3756, "char_end": 3819, "line": " if (DIFF(l1_new, l2_new) < DIFF(l1, l2)) {\n" } ], "added": [ { "line_no": 100, "char_start": 3756, "char_end": 3844, "line": " if (DIF...
{ "deleted": [], "added": [ { "char_start": 3815, "char_end": 3840, "chars": " && w > text_info->glyphs" }, { "char_start": 3843, "char_end": 3935, "chars": "\n if (w->linebreak)\n text_info->n_lines--;" } ] }
github.com/libass/libass/commit/b72b283b936a600c730e00875d7d067bded3fc26
libass/ass_render.c
cwe-125
repodata_schema2id
repodata_schema2id(Repodata *data, Id *schema, int create) { int h, len, i; Id *sp, cid; Id *schematahash; if (!*schema) return 0; /* XXX: allow empty schema? */ if ((schematahash = data->schematahash) == 0) { data->schematahash = schematahash = solv_calloc(256, sizeof(Id)); for (i = 1; i...
repodata_schema2id(Repodata *data, Id *schema, int create) { int h, len, i; Id *sp, cid; Id *schematahash; if (!*schema) return 0; /* XXX: allow empty schema? */ if ((schematahash = data->schematahash) == 0) { data->schematahash = schematahash = solv_calloc(256, sizeof(Id)); for (i = 1; i...
{ "deleted": [ { "line_no": 31, "char_start": 838, "char_end": 923, "line": " if (!memcmp(data->schemadata + data->schemata[cid], schema, len * sizeof(Id)))\n" }, { "line_no": 35, "char_start": 1038, "char_end": 1125, "line": " if (!memcmp(data->...
{ "deleted": [], "added": [ { "char_start": 848, "char_end": 907, "chars": "(data->schemata[cid] + len <= data->schemadatalen) &&\n\t\t\t " }, { "char_start": 1109, "char_end": 1167, "chars": "(data->schemata[cid] + len <= data->schemadatalen) &&\n\t\t\t\t" } ]...
github.com/openSUSE/libsolv/commit/fdb9c9c03508990e4583046b590c30d958f272da
src/repodata.c
cwe-125
ComplexImages
MagickExport Image *ComplexImages(const Image *images,const ComplexOperator op, ExceptionInfo *exception) { #define ComplexImageTag "Complex/Image" CacheView *Ai_view, *Ar_view, *Bi_view, *Br_view, *Ci_view, *Cr_view; const char *artifact; const Image *Ai_image, *Ar_image...
MagickExport Image *ComplexImages(const Image *images,const ComplexOperator op, ExceptionInfo *exception) { #define ComplexImageTag "Complex/Image" CacheView *Ai_view, *Ar_view, *Bi_view, *Br_view, *Ci_view, *Cr_view; const char *artifact; const Image *Ai_image, *Ar_image...
{ "deleted": [ { "line_no": 137, "char_start": 3900, "char_end": 3963, "line": " for (i=0; i < (ssize_t) GetPixelChannels(Cr_image); i++)\n" } ], "added": [ { "line_no": 38, "char_start": 511, "char_end": 520, "line": " size_t\n" }, { ...
{ "deleted": [ { "char_start": 521, "char_end": 521, "chars": "" }, { "char_start": 3930, "char_end": 3931, "chars": "G" }, { "char_start": 3932, "char_end": 3939, "chars": "tPixelC" }, { "char_start": 3946, "char_end": 3956...
github.com/ImageMagick/ImageMagick/commit/d5089971bd792311aaab5cb73460326d7ef7f32d
MagickCore/fourier.c
cwe-125
ttm_put_pages
static void ttm_put_pages(struct page **pages, unsigned npages, int flags, enum ttm_caching_state cstate) { struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate); #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate); #endif unsigned long irq_flags; unsigne...
static void ttm_put_pages(struct page **pages, unsigned npages, int flags, enum ttm_caching_state cstate) { struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate); #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate); #endif unsigned long irq_flags; unsigne...
{ "deleted": [ { "line_no": 29, "char_start": 736, "char_end": 766, "line": "\t\t\t\t\tif (p++ != pages[i + j])\n" }, { "line_no": 64, "char_start": 1344, "char_end": 1373, "line": "\t\t\t\tif (p++ != pages[i + j])\n" } ], "added": [ { "lin...
{ "deleted": [ { "char_start": 745, "char_end": 746, "chars": "p" }, { "char_start": 1352, "char_end": 1353, "chars": "p" } ], "added": [ { "char_start": 747, "char_end": 748, "chars": "p" }, { "char_start": 1354, "char_...
github.com/torvalds/linux/commit/453393369dc9806d2455151e329c599684762428
drivers/gpu/drm/ttm/ttm_page_alloc.c
cwe-125
matchCurrentInput
matchCurrentInput( const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) return 0; return 1; }
matchCurrentInput( const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; ((k < passIC + 2 + passInstructions[passIC + 1]) && (kk < input->length)); k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) re...
{ "deleted": [ { "line_no": 5, "char_start": 124, "char_end": 198, "line": "\tfor (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++)\n" } ], "added": [ { "line_no": 5, "char_start": 124, "char_end": 146, "line": "\tfor (k = passIC + 2;\...
{ "deleted": [ { "char_start": 145, "char_end": 146, "chars": " " }, { "char_start": 192, "char_end": 193, "chars": " " } ], "added": [ { "char_start": 145, "char_end": 151, "chars": "\n\t\t\t((" }, { "char_start": 196, ...
github.com/liblouis/liblouis/commit/5e4089659bb49b3095fa541fa6387b4c40d7396e
liblouis/lou_translateString.c
cwe-125
ims_pcu_get_cdc_union_desc
static const struct usb_cdc_union_desc * ims_pcu_get_cdc_union_desc(struct usb_interface *intf) { const void *buf = intf->altsetting->extra; size_t buflen = intf->altsetting->extralen; struct usb_cdc_union_desc *union_desc; if (!buf) { dev_err(&intf->dev, "Missing descriptor data\n"); return NULL; } if (!bu...
static const struct usb_cdc_union_desc * ims_pcu_get_cdc_union_desc(struct usb_interface *intf) { const void *buf = intf->altsetting->extra; size_t buflen = intf->altsetting->extralen; struct usb_cdc_union_desc *union_desc; if (!buf) { dev_err(&intf->dev, "Missing descriptor data\n"); return NULL; } if (!bu...
{ "deleted": [ { "line_no": 18, "char_start": 398, "char_end": 420, "line": "\twhile (buflen > 0) {\n" }, { "line_no": 24, "char_start": 640, "char_end": 662, "line": "\t\t\treturn union_desc;\n" } ], "added": [ { "line_no": 18, "char...
{ "deleted": [ { "char_start": 415, "char_end": 416, "chars": "0" } ], "added": [ { "char_start": 414, "char_end": 415, "chars": "=" }, { "char_start": 416, "char_end": 435, "chars": "sizeof(*union_desc)" }, { "char_start": 48...
github.com/torvalds/linux/commit/ea04efee7635c9120d015dcdeeeb6988130cb67a
drivers/input/misc/ims-pcu.c
cwe-125
tensorflow::QuantizeAndDequantizeV2Op::Compute
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); const int depth = (axis_ == -1) ? 1 : input.dim_size(axis_); Tensor input_min_tensor; Tensor input_max_tensor; Tensor* output = nullptr; OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &output)); ...
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); OP_REQUIRES( ctx, (axis_ == -1 || axis_ < input.shape().dims()), errors::InvalidArgument("Shape must be at least rank ", axis_ + 1, " but is rank ", input.shape().dims())); co...
{ "deleted": [], "added": [ { "line_no": 3, "char_start": 89, "char_end": 106, "line": " OP_REQUIRES(\n" }, { "line_no": 4, "char_start": 106, "char_end": 166, "line": " ctx, (axis_ == -1 || axis_ < input.shape().dims()),\n" }, { "l...
{ "deleted": [], "added": [ { "char_start": 93, "char_end": 318, "chars": "OP_REQUIRES(\n ctx, (axis_ == -1 || axis_ < input.shape().dims()),\n errors::InvalidArgument(\"Shape must be at least rank \", axis_ + 1,\n \" but is rank \", input.shape().d...
github.com/tensorflow/tensorflow/commit/eccb7ec454e6617738554a255d77f08e60ee0808
tensorflow/core/kernels/quantize_and_dequantize_op.cc
cwe-125
_bson_iter_next_internal
_bson_iter_next_internal (bson_iter_t *iter, /* INOUT */ uint32_t next_keylen, /* IN */ const char **key, /* OUT */ uint32_t *bson_type, /* OUT */ bool *unsupported) /* OUT */ { const uint8_t *data; ...
_bson_iter_next_internal (bson_iter_t *iter, /* INOUT */ uint32_t next_keylen, /* IN */ const char **key, /* OUT */ uint32_t *bson_type, /* OUT */ bool *unsupported) /* OUT */ { const uint8_t *data; ...
{ "deleted": [ { "line_no": 112, "char_start": 2519, "char_end": 2547, "line": " if (l >= (len - o)) {\n" } ], "added": [ { "line_no": 112, "char_start": 2519, "char_end": 2551, "line": " if (l >= (len - o - 4)) {\n" } ] }
{ "deleted": [], "added": [ { "char_start": 2542, "char_end": 2546, "chars": " - 4" } ] }
github.com/mongodb/mongo-c-driver/commit/0d9a4d98bfdf4acd2c0138d4aaeb4e2e0934bd84
src/libbson/src/bson/bson-iter.c
cwe-125
enc_untrusted_inet_pton
int enc_untrusted_inet_pton(int af, const char *src, void *dst) { if (!src || !dst) { return 0; } MessageWriter input; input.Push<int>(TokLinuxAfFamily(af)); input.PushByReference(Extent{ src, std::min(strlen(src) + 1, static_cast<size_t>(INET6_ADDRSTRLEN))}); MessageReader output; const auto ...
int enc_untrusted_inet_pton(int af, const char *src, void *dst) { if (!src || !dst) { return 0; } MessageWriter input; input.Push<int>(TokLinuxAfFamily(af)); input.PushByReference(Extent{ src, std::min(strlen(src) + 1, static_cast<size_t>(INET6_ADDRSTRLEN))}); MessageReader output; const auto ...
{ "deleted": [], "added": [ { "line_no": 26, "char_start": 747, "char_end": 810, "line": " if (klinux_addr_buffer.size() != sizeof(klinux_in_addr)) {\n" }, { "line_no": 27, "char_start": 810, "char_end": 873, "line": " ::asylo::primitives::TrustedP...
{ "deleted": [], "added": [ { "char_start": 751, "char_end": 945, "chars": "if (klinux_addr_buffer.size() != sizeof(klinux_in_addr)) {\n ::asylo::primitives::TrustedPrimitives::BestEffortAbort(\n \"enc_untrusted_inet_pton: unexpected output size\");\n }\n " }, { ...
github.com/google/asylo/commit/8fed5e334131abaf9c5e17307642fbf6ce4a57ec
asylo/platform/host_call/trusted/host_calls.cc
cwe-125
tensorflow::GraphConstructor::MakeEdge
Status GraphConstructor::MakeEdge(Node* src, int output_index, Node* dst, int input_index) { DataType src_out = src->output_type(output_index); DataType dst_in = dst->input_type(input_index); if (!TypesCompatible(dst_in, src_out)) { return errors::InvalidArgument( "In...
Status GraphConstructor::MakeEdge(Node* src, int output_index, Node* dst, int input_index) { if (output_index >= src->num_outputs()) { return errors::InvalidArgument( "Output ", output_index, " of node ", src->name(), " does not exist. Node only has ", src->num_ou...
{ "deleted": [], "added": [ { "line_no": 3, "char_start": 127, "char_end": 171, "line": " if (output_index >= src->num_outputs()) {\n" }, { "line_no": 4, "char_start": 171, "char_end": 207, "line": " return errors::InvalidArgument(\n" }, { ...
{ "deleted": [], "added": [ { "char_start": 129, "char_end": 564, "chars": "if (output_index >= src->num_outputs()) {\n return errors::InvalidArgument(\n \"Output \", output_index, \" of node \", src->name(),\n \" does not exist. Node only has \", src->num_outputs(), \" output...
github.com/tensorflow/tensorflow/commit/0cc38aaa4064fd9e79101994ce9872c6d91f816b
tensorflow/core/common_runtime/graph_constructor.cc
cwe-125
DecompressRTF
BYTE *DecompressRTF(variableLength *p, int *size) { BYTE *dst; // destination for uncompressed bytes BYTE *src; unsigned int in; unsigned int out; variableLength comp_Prebuf; ULONG compressedSize, uncompressedSize, magic; comp_Prebuf.size = strlen(RTF_PREBUF); comp_Prebuf.data = calloc(comp_Prebuf.size...
BYTE *DecompressRTF(variableLength *p, int *size) { BYTE *dst; // destination for uncompressed bytes BYTE *src; unsigned int in; unsigned int out; variableLength comp_Prebuf; ULONG compressedSize, uncompressedSize, magic; comp_Prebuf.size = strlen(RTF_PREBUF); comp_Prebuf.data = calloc(comp_Prebuf.size...
{ "deleted": [ { "line_no": 55, "char_start": 1641, "char_end": 1699, "line": " while (out < (comp_Prebuf.size + uncompressedSize)) {\n" } ], "added": [ { "line_no": 55, "char_start": 1641, "char_end": 1719, "line": " while ((out < (comp_Prebuf.siz...
{ "deleted": [], "added": [ { "char_start": 1652, "char_end": 1653, "chars": "(" }, { "char_start": 1692, "char_end": 1711, "chars": "ize)) && (in < p->s" } ] }
github.com/Yeraze/ytnef/commit/22f8346c8d4f0020a40d9f258fdb3bfc097359cc
lib/ytnef.c
cwe-125
ReadSGIImage
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status; MagickSizeType number_pixels; MemoryInfo *pixel_info; register Quantum *q; register ssize_t i, x; register unsigned char *p; SGIInfo iris_...
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status; MagickSizeType number_pixels; MemoryInfo *pixel_info; register Quantum *q; register ssize_t i, x; register unsigned char *p; SGIInfo iris_...
{ "deleted": [ { "line_no": 102, "char_start": 2912, "char_end": 2962, "line": " image->depth=(size_t) MagickMin((size_t) 8*\n" }, { "line_no": 103, "char_start": 2962, "char_end": 3023, "line": " iris_info.bytes_per_pixel,MAGICKCORE_QUANTUM_DEPT...
{ "deleted": [ { "char_start": 2961, "char_end": 2970, "chars": "\n " } ], "added": [ { "char_start": 2987, "char_end": 2996, "chars": "\n " }, { "char_start": 3176, "char_end": 3284, "chars": "\n if (EOFBlob(image) != Magi...
github.com/ImageMagick/ImageMagick/commit/7afcf9f71043df15508e46f079387bd4689a738d
coders/sgi.c
cwe-125
dnxhd_decode_header
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, const uint8_t *buf, int buf_size, int first_field) { int i, cid, ret; int old_bit_depth = ctx->bit_depth, bitdepth; uint64_t header_prefix; if (buf_size < 0x280) { av_l...
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, const uint8_t *buf, int buf_size, int first_field) { int i, cid, ret; int old_bit_depth = ctx->bit_depth, bitdepth; uint64_t header_prefix; if (buf_size < 0x280) { av_l...
{ "deleted": [ { "line_no": 126, "char_start": 4820, "char_end": 4855, "line": " if (ctx->mb_height > 68 ||\n" }, { "line_no": 127, "char_start": 4855, "char_end": 4940, "line": " (ctx->mb_height << frame->interlaced_frame) > (ctx->height +...
{ "deleted": [ { "char_start": 4851, "char_end": 4936, "chars": " ||\n (ctx->mb_height << frame->interlaced_frame) > (ctx->height + 15) >> 4" }, { "char_start": 5098, "char_end": 5098, "chars": "" } ], "added": [ { "char_start": 4855, ...
github.com/FFmpeg/FFmpeg/commit/296debd213bd6dce7647cedd34eb64e5b94cdc92
libavcodec/dnxhddec.c
cwe-125
WriteHDRImage
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
{ "deleted": [ { "line_no": 69, "char_start": 1901, "char_end": 1984, "line": " count=FormatLocaleString(header,MagickPathExtent,\"GAMMA=%g\\n\",image->gamma);\n" }, { "line_no": 87, "char_start": 2886, "char_end": 2952, "line": " pixels=(unsigned char...
{ "deleted": [], "added": [ { "char_start": 1969, "char_end": 1978, "chars": "\n " }, { "char_start": 2957, "char_end": 2961, "chars": "+128" }, { "char_start": 3095, "char_end": 3172, "chars": ");\n (void) ResetMagickMemory(pixels,0,...
github.com/ImageMagick/ImageMagick/commit/14e606db148d6ebcaae20f1e1d6d71903ca4a556
coders/hdr.c
cwe-125
voutf
static void voutf(struct GlobalConfig *config, const char *prefix, const char *fmt, va_list ap) { size_t width = (79 - strlen(prefix)); if(!config->mute) { size_t len; char *ptr; char *print_buffer; print_buffer = curlx_mvaprintf(fmt, ap); i...
static void voutf(struct GlobalConfig *config, const char *prefix, const char *fmt, va_list ap) { size_t width = (79 - strlen(prefix)); if(!config->mute) { size_t len; char *ptr; char *print_buffer; print_buffer = curlx_mvaprintf(fmt, ap); i...
{ "deleted": [ { "line_no": 35, "char_start": 890, "char_end": 910, "line": " len -= cut;\n" } ], "added": [ { "line_no": 35, "char_start": 890, "char_end": 914, "line": " len -= cut + 1;\n" } ] }
{ "deleted": [], "added": [ { "char_start": 908, "char_end": 912, "chars": " + 1" } ] }
github.com/curl/curl/commit/d530e92f59ae9bb2d47066c3c460b25d2ffeb211
src/tool_msgs.c
cwe-125
pure_strcmp
int pure_strcmp(const char * const s1, const char * const s2) { return pure_memcmp(s1, s2, strlen(s1) + 1U); }
int pure_strcmp(const char * const s1, const char * const s2) { const size_t s1_len = strlen(s1); const size_t s2_len = strlen(s2); if (s1_len != s2_len) { return -1; } return pure_memcmp(s1, s2, s1_len); }
{ "deleted": [ { "line_no": 3, "char_start": 64, "char_end": 113, "line": " return pure_memcmp(s1, s2, strlen(s1) + 1U);\n" } ], "added": [ { "line_no": 3, "char_start": 64, "char_end": 102, "line": " const size_t s1_len = strlen(s1);\n" }, ...
{ "deleted": [ { "char_start": 96, "char_end": 98, "chars": "tr" }, { "char_start": 101, "char_end": 110, "chars": "(s1) + 1U" } ], "added": [ { "char_start": 68, "char_end": 198, "chars": "const size_t s1_len = strlen(s1);\n const size_...
github.com/jedisct1/pure-ftpd/commit/36c6d268cb190282a2c17106acfd31863121b58e
src/utils.c
cwe-125
read_quant_matrix_ext
static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb) { int i, j, v; if (get_bits1(gb)) { /* intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->idsp.idct_permutation[ff_zigzag_direct[i]]; s->intra_matrix[j] ...
static int read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb) { int i, j, v; if (get_bits1(gb)) { if (get_bits_left(gb) < 64*8) return AVERROR_INVALIDDATA; /* intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->id...
{ "deleted": [ { "line_no": 1, "char_start": 0, "char_end": 72, "line": "static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb)\n" } ], "added": [ { "line_no": 1, "char_start": 0, "char_end": 71, "line": "static int read_quant_matrix_ext...
{ "deleted": [ { "char_start": 7, "char_end": 9, "chars": "vo" }, { "char_start": 10, "char_end": 11, "chars": "d" } ], "added": [ { "char_start": 8, "char_end": 10, "chars": "nt" }, { "char_start": 115, "char_end": 193,...
github.com/FFmpeg/FFmpeg/commit/5aba5b89d0b1d73164d3b81764828bb8b20ff32a
libavcodec/mpeg4videodec.c
cwe-125
Cipher::blowfishECB
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction) { QCA::Initializer init; QByteArray temp = cipherText; //do padding ourselves if (direction) { while ((temp.length() % 8) != 0) temp.append('\0'); } else { temp = b64ToByte(temp); while ((temp....
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction) { QCA::Initializer init; QByteArray temp = cipherText; //do padding ourselves if (direction) { while ((temp.length() % 8) != 0) temp.append('\0'); } else { // ECB Blowfish encodes in blocks of 12 chars...
{ "deleted": [ { "line_no": 25, "char_start": 689, "char_end": 708, "line": " if (direction)\n" } ], "added": [ { "line_no": 14, "char_start": 358, "char_end": 397, "line": " if ((temp.length() % 12) != 0)\n" }, { "line_no": 15, ...
{ "deleted": [], "added": [ { "char_start": 275, "char_end": 437, "chars": "// ECB Blowfish encodes in blocks of 12 chars, so anything else is malformed input\n if ((temp.length() % 12) != 0)\n return cipherText;\n\n " }, { "char_start": 869, "char_...
github.com/quassel/quassel/commit/8b5ecd226f9208af3074b33d3b7cf5e14f55b138
src/core/cipher.cpp
cwe-125
java_switch_op
static int java_switch_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_byte = data[0]; ut64 offset = addr - java_get_method_start (); ut8 pos = (offset+1)%4 ? 1 + 4 - (offset+1)%4 : 1; if (op_byte == 0xaa) { // handle a table switch condition if (pos + 8 > len) { return op->size; ...
static int java_switch_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_byte = data[0]; ut64 offset = addr - java_get_method_start (); ut8 pos = (offset+1)%4 ? 1 + 4 - (offset+1)%4 : 1; if (op_byte == 0xaa) { // handle a table switch condition if (pos + 8 + 8 > len) { return op->si...
{ "deleted": [ { "line_no": 8, "char_start": 277, "char_end": 300, "line": "\t\tif (pos + 8 > len) {\n" }, { "line_no": 11, "char_start": 324, "char_end": 370, "line": "\t\tint min_val = (ut32)(UINT (data, pos + 4)),\n" }, { "line_no": 12, ...
{ "deleted": [ { "char_start": 368, "char_end": 369, "chars": "," }, { "char_start": 372, "char_end": 373, "chars": "\t" } ], "added": [ { "char_start": 291, "char_end": 295, "chars": "+ 8 " }, { "char_start": 330, "char...
github.com/radare/radare2/commit/224e6bc13fa353dd3b7f7a2334588f1c4229e58d
libr/anal/p/anal_java.c
cwe-125
ntlm_read_NegotiateMessage
SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buffer) { wStream* s; size_t length; NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) retu...
SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buffer) { wStream* s; size_t length; NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) retu...
{ "deleted": [], "added": [ { "line_no": 25, "char_start": 592, "char_end": 631, "line": "\tif (Stream_GetRemainingLength(s) < 4)\n" }, { "line_no": 26, "char_start": 631, "char_end": 634, "line": "\t{\n" }, { "line_no": 27, "char_start...
{ "deleted": [], "added": [ { "char_start": 593, "char_end": 693, "chars": "if (Stream_GetRemainingLength(s) < 4)\n\t{\n\t\tStream_Free(s, FALSE);\n\t\treturn SEC_E_INVALID_TOKEN;\n\t}\n\t" } ] }
github.com/FreeRDP/FreeRDP/commit/8fa38359634a9910b91719818ab02f23c320dbae
winpr/libwinpr/sspi/NTLM/ntlm_message.c
cwe-125
enc_untrusted_inet_ntop
const char *enc_untrusted_inet_ntop(int af, const void *src, char *dst, socklen_t size) { if (!src || !dst) { errno = EFAULT; return nullptr; } size_t src_size = 0; if (af == AF_INET) { src_size = sizeof(struct in_addr); } else if (af == AF_INET6) { src_size...
const char *enc_untrusted_inet_ntop(int af, const void *src, char *dst, socklen_t size) { if (!src || !dst) { errno = EFAULT; return nullptr; } size_t src_size = 0; if (af == AF_INET) { src_size = sizeof(struct in_addr); } else if (af == AF_INET6) { src_size...
{ "deleted": [ { "line_no": 34, "char_start": 953, "char_end": 982, "line": " memcpy(dst, result.data(),\n" }, { "line_no": 35, "char_start": 982, "char_end": 1027, "line": " std::min(static_cast<size_t>(size),\n" }, { "line_no": 36, ...
{ "deleted": [ { "char_start": 988, "char_end": 991, "chars": " " }, { "char_start": 1026, "char_end": 1027, "chars": "\n" }, { "char_start": 1028, "char_end": 1029, "chars": " " } ], "added": [ { "char_start": 962, "c...
github.com/google/asylo/commit/6ff3b77ffe110a33a2f93848a6333f33616f02c4
asylo/platform/host_call/trusted/host_calls.cc
cwe-125
ndpi_search_oracle
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int16_t dport = 0, sport = 0; NDPI_LOG_DBG(ndpi_struct, "search ORACLE\n"); if(packet->tcp != NULL) { sport = ntohs(packet->tcp->source), dport = ...
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int16_t dport = 0, sport = 0; NDPI_LOG_DBG(ndpi_struct, "search ORACLE\n"); if(packet->tcp != NULL) { sport = ntohs(packet->tcp->source), dport = ...
{ "deleted": [ { "line_no": 13, "char_start": 489, "char_end": 590, "line": "\t&& (((packet->payload[0] == 0x07) && (packet->payload[1] == 0xff) && (packet->payload[2] == 0x00))\n" } ], "added": [ { "line_no": 13, "char_start": 489, "char_end": 625, "li...
{ "deleted": [], "added": [ { "char_start": 512, "char_end": 547, "chars": "_packet_len >= 3 && packet->payload" } ] }
github.com/ntop/nDPI/commit/b69177be2fbe01c2442239a61832c44e40136c05
src/lib/protocols/oracle.c
cwe-125
rtc_irq_eoi_tracking_reset
static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic) { ioapic->rtc_status.pending_eoi = 0; bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPUS); }
static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic) { ioapic->rtc_status.pending_eoi = 0; bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID); }
{ "deleted": [ { "line_no": 4, "char_start": 105, "char_end": 167, "line": "\tbitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPUS);\n" } ], "added": [ { "line_no": 4, "char_start": 105, "char_end": 169, "line": "\tbitmap_zero(ioapic->rtc_status.de...
{ "deleted": [ { "char_start": 163, "char_end": 164, "chars": "S" } ], "added": [ { "char_start": 163, "char_end": 166, "chars": "_ID" } ] }
github.com/torvalds/linux/commit/81cdb259fb6d8c1c4ecfeea389ff5a73c07f5755
arch/x86/kvm/ioapic.c
cwe-125
concat_hash_string
static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet, char *buf, u_int8_t client_hash) { u_int16_t offset = 22, buf_out_len = 0; if(offset+sizeof(u_int32_t) >= packet->payload_packet_len) goto invalid_payload; u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]); offset += 4;...
static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet, char *buf, u_int8_t client_hash) { u_int16_t offset = 22, buf_out_len = 0; if(offset+sizeof(u_int32_t) >= packet->payload_packet_len) goto invalid_payload; u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]); offset += 4;...
{ "deleted": [], "added": [ { "line_no": 18, "char_start": 615, "char_end": 676, "line": " if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n" }, { "line_no": 19, "char_start": 676, "char_end": 702, "line": " goto invalid_payload;\n" }, ...
{ "deleted": [], "added": [ { "char_start": 617, "char_end": 704, "chars": "if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n goto invalid_payload;\n " }, { "char_start": 823, "char_end": 910, "chars": "\n if(offset+sizeof(u_int32_t) >= packet->payload...
github.com/ntop/nDPI/commit/3bbb0cd3296023f6f922c71d21a1c374d2b0a435
src/lib/protocols/ssh.c
cwe-125
DecodePSDPixels
static ssize_t DecodePSDPixels(const size_t number_compact_pixels, const unsigned char *compact_pixels,const ssize_t depth, const size_t number_pixels,unsigned char *pixels) { #define CheckNumberCompactPixels \ if (packets == 0) \ return(i); \ packets-- #define CheckNumberPixels(count) \ if (((ssize_t) i...
static ssize_t DecodePSDPixels(const size_t number_compact_pixels, const unsigned char *compact_pixels,const ssize_t depth, const size_t number_pixels,unsigned char *pixels) { #define CheckNumberCompactPixels \ if (packets == 0) \ return(i); \ packets-- #define CheckNumberPixels(count) \ if (((ssize_t) i...
{ "deleted": [ { "line_no": 124, "char_start": 3556, "char_end": 3588, "line": " CheckNumberCompactPixels;\n" } ], "added": [ { "line_no": 86, "char_start": 2325, "char_end": 2357, "line": " CheckNumberCompactPixels;\n" } ] }
{ "deleted": [ { "char_start": 3555, "char_end": 3587, "chars": "\n CheckNumberCompactPixels;" } ], "added": [ { "char_start": 2331, "char_end": 2363, "chars": "CheckNumberCompactPixels;\n " } ] }
github.com/ImageMagick/ImageMagick/commit/30eec879c8b446b0ea9a3bb0da1a441cc8482bc4
coders/psd.c
cwe-125
_6502_op
static int _6502_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { char addrbuf[64]; const int buffsize = sizeof (addrbuf) - 1; memset (op, '\0', sizeof (RAnalOp)); op->size = snes_op_get_size (1, 1, &snes_op[data[0]]); //snes-arch is similiar to nes/6502 op->addr = addr; op->type = R_ANAL_OP_T...
static int _6502_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { char addrbuf[64]; const int buffsize = sizeof (addrbuf) - 1; memset (op, '\0', sizeof (RAnalOp)); op->size = snes_op_get_size (1, 1, &snes_op[data[0]]); //snes-arch is similiar to nes/6502 op->addr = addr; op->type = R_ANAL_OP_T...
{ "deleted": [ { "line_no": 397, "char_start": 10823, "char_end": 10845, "line": "\t\tif (data[1] <= 127)\n" }, { "line_no": 398, "char_start": 10845, "char_end": 10886, "line": "\t\t\top->jump = addr + data[1] + op->size;\n" }, { "line_no": 39...
{ "deleted": [], "added": [ { "char_start": 10829, "char_end": 10847, "chars": "len > 1) {\n\t\t\tif (" }, { "char_start": 10862, "char_end": 10864, "chars": " {" }, { "char_start": 10865, "char_end": 10866, "chars": "\t" }, { "...
github.com/radare/radare2/commit/bbb4af56003c1afdad67af0c4339267ca38b1017
libr/anal/p/anal_6502.c
cwe-125
string_scan_range
static int string_scan_range(RList *list, RBinFile *bf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (from >...
static int string_scan_range(RList *list, RBinFile *bf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (from >...
{ "deleted": [ { "line_no": 15, "char_start": 418, "char_end": 453, "line": "\tut8 *buf = calloc (to - from, 1);\n" }, { "line_no": 19, "char_start": 490, "char_end": 538, "line": "\tr_buf_read_at (bf->buf, from, buf, to - from);\n" }, { "line_...
{ "deleted": [ { "char_start": 438, "char_end": 447, "chars": "to - from" }, { "char_start": 526, "char_end": 535, "chars": "to - from" } ], "added": [ { "char_start": 419, "char_end": 441, "chars": "int len = to - from;\n\t" }, { ...
github.com/radare/radare2/commit/3fcf41ed96ffa25b38029449520c8d0a198745f3
libr/bin/file.c
cwe-125
cx24116_send_diseqc_msg
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx24116: %s(", __func__); for (i = 0 ; i < d->msg_len ;) { printk(KERN_INFO "0x%02x", d->ms...
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Validate length */ if (d->msg_len > sizeof(d->msg)) return -EINVAL; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx2411...
{ "deleted": [ { "line_no": 18, "char_start": 429, "char_end": 452, "line": "\t/* Validate length */\n" }, { "line_no": 19, "char_start": 452, "char_end": 512, "line": "\tif (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS))\n" }, { "line_...
{ "deleted": [ { "char_start": 427, "char_end": 529, "chars": "\n\n\t/* Validate length */\n\tif (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS))\n\t\treturn -EINVAL;" } ], "added": [ { "char_start": 167, "char_end": 257, "chars": "Validate length */\n\tif (d...
github.com/torvalds/linux/commit/1fa2337a315a2448c5434f41e00d56b01a22283c
drivers/media/dvb-frontends/cx24116.c
cwe-125
MAPIPrint
void MAPIPrint(MAPIProps *p) { int j, i, index, h, x; DDWORD *ddword_ptr; DDWORD ddword_tmp; dtr thedate; MAPIProperty *mapi; variableLength *mapidata; variableLength vlTemp; int found; for (j = 0; j < p->count; j++) { mapi = &(p->properties[j]); printf(" #%i: Type: [", j); switch (PROP...
void MAPIPrint(MAPIProps *p) { int j, i, index, h, x; DDWORD *ddword_ptr; DDWORD ddword_tmp; dtr thedate; MAPIProperty *mapi; variableLength *mapidata; variableLength vlTemp; int found; for (j = 0; j < p->count; j++) { mapi = &(p->properties[j]); printf(" #%i: Type: [", j); switch (PROP...
{ "deleted": [ { "line_no": 95, "char_start": 2731, "char_end": 2795, "line": " printf(\" Value: %li\\n\", *((long*)mapidata->data));\n" } ], "added": [ { "line_no": 95, "char_start": 2731, "char_end": 2793, "line": " printf(\" Va...
{ "deleted": [ { "char_start": 2761, "char_end": 2762, "chars": "l" }, { "char_start": 2771, "char_end": 2773, "chars": "lo" }, { "char_start": 2774, "char_end": 2775, "chars": "g" } ], "added": [ { "char_start": 2770, "...
github.com/Yeraze/ytnef/commit/f98f5d4adc1c4bd4033638f6167c1bb95d642f89
lib/ytnef.c
cwe-125
readContigTilesIntoBuffer
static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, uint32 imagelength, uint32 imagewidth, uint32 tw, uint32 tl, tsample_t spp, uint16 bps) { int status ...
static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, uint32 imagelength, uint32 imagewidth, uint32 tw, uint32 tl, tsample_t spp, uint16 bps) { int status ...
{ "deleted": [ { "line_no": 60, "char_start": 1763, "char_end": 1803, "line": " tilebuf = _TIFFmalloc(tile_buffsize);\n" } ], "added": [ { "line_no": 60, "char_start": 1763, "char_end": 1829, "line": " /* Add 3 padding bytes for extractContigSamplesShi...
{ "deleted": [], "added": [ { "char_start": 1765, "char_end": 1991, "chars": "/* Add 3 padding bytes for extractContigSamplesShifted32bits */\n if( tile_buffsize > 0xFFFFFFFFU - 3 )\n {\n TIFFError(\"readContigTilesIntoBuffer\", \"Integer overflow when calculating buffer size.\");\n ...
github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53
tools/tiffcrop.c
cwe-125
TNEFParse
int TNEFParse(TNEFStruct *TNEF) { WORD key; DWORD type; DWORD size; DWORD signature; BYTE *data; WORD checksum, header_checksum; int i; if (TNEF->IO.ReadProc == NULL) { printf("ERROR: Setup incorrectly: No ReadProc\n"); return YTNEF_INCORRECT_SETUP; } if (TNEF->IO.InitProc != NULL) { D...
int TNEFParse(TNEFStruct *TNEF) { WORD key; DWORD type; DWORD size; DWORD signature; BYTE *data; WORD checksum, header_checksum; int i; if (TNEF->IO.ReadProc == NULL) { printf("ERROR: Setup incorrectly: No ReadProc\n"); return YTNEF_INCORRECT_SETUP; } if (TNEF->IO.InitProc != NULL) { D...
{ "deleted": [], "added": [ { "line_no": 56, "char_start": 1563, "char_end": 1583, "line": " if(size == 0) {\n" }, { "line_no": 57, "char_start": 1583, "char_end": 1630, "line": " printf(\"ERROR: Field with size of 0\\n\");\n" }, { "l...
{ "deleted": [], "added": [ { "char_start": 1567, "char_end": 1679, "chars": "if(size == 0) {\n printf(\"ERROR: Field with size of 0\\n\");\n return YTNEF_ERROR_READING_DATA;\n }\n " } ] }
github.com/Yeraze/ytnef/commit/3cb0f914d6427073f262e1b2b5fd973e3043cdf7
lib/ytnef.c
cwe-125
ssl_parse_server_key_exchange
static int ssl_parse_server_key_exchange( mbedtls_ssl_context *ssl ) { int ret; const mbedtls_ssl_ciphersuite_t *ciphersuite_info = ssl->transform_negotiate->ciphersuite_info; unsigned char *p = NULL, *end = NULL; MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse server key exchange" ) ); #if defined(MBED...
static int ssl_parse_server_key_exchange( mbedtls_ssl_context *ssl ) { int ret; const mbedtls_ssl_ciphersuite_t *ciphersuite_info = ssl->transform_negotiate->ciphersuite_info; unsigned char *p = NULL, *end = NULL; MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse server key exchange" ) ); #if defined(MBED...
{ "deleted": [ { "line_no": 229, "char_start": 9573, "char_end": 9606, "line": " if( end != p + sig_len )\n" } ], "added": [ { "line_no": 229, "char_start": 9573, "char_end": 9606, "line": " if( p != end - sig_len )\n" } ] }
{ "deleted": [ { "char_start": 9585, "char_end": 9588, "chars": "end" }, { "char_start": 9592, "char_end": 9593, "chars": "p" }, { "char_start": 9594, "char_end": 9595, "chars": "+" } ], "added": [ { "char_start": 9585, ...
github.com/ARMmbed/mbedtls/commit/027f84c69f4ef30c0693832a6c396ef19e563ca1
library/ssl_cli.c
cwe-125
HPHP::exif_scan_JPEG_header
static int exif_scan_JPEG_header(image_info_type *ImageInfo) { int section, sn; int marker = 0, last_marker = M_PSEUDO, comment_correction=1; int ll, lh; unsigned char *Data; size_t fpos, size, got, itemlen; jpeg_sof_info sof_info; for(section=0;;section++) { // get marker byte, swallowing possible ...
static int exif_scan_JPEG_header(image_info_type *ImageInfo) { int section, sn; int marker = 0, last_marker = M_PSEUDO, comment_correction=1; int ll, lh; unsigned char *Data; size_t fpos, size, got, itemlen; jpeg_sof_info sof_info; for(section=0;;section++) { // get marker byte, swallowing possible ...
{ "deleted": [], "added": [ { "line_no": 137, "char_start": 4277, "char_end": 4310, "line": " if ((itemlen - 2) < 6) {\n" }, { "line_no": 138, "char_start": 4310, "char_end": 4330, "line": " return 0;\n" }, { "line_no": 139, ...
{ "deleted": [], "added": [ { "char_start": 4285, "char_end": 4349, "chars": "if ((itemlen - 2) < 6) {\n return 0;\n }\n\n " } ] }
github.com/facebook/hhvm/commit/f9680d21beaa9eb39d166e8810e29fbafa51ad15
hphp/runtime/ext/gd/ext_gd.cpp
cwe-125
forward_search_range
forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s, UChar* range, UChar** low, UChar** high, UChar** low_prev) { UChar *p, *pprev = (UChar* )NULL; #ifdef ONIG_DEBUG_SEARCH fprintf(stderr, "forward_search_range: str: %d, end: %d, s: %d, range: %d\n", (int )str, (int )end, (int...
forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s, UChar* range, UChar** low, UChar** high, UChar** low_prev) { UChar *p, *pprev = (UChar* )NULL; #ifdef ONIG_DEBUG_SEARCH fprintf(stderr, "forward_search_range: str: %d, end: %d, s: %d, range: %d\n", (int )str, (int )end, (int...
{ "deleted": [], "added": [ { "line_no": 18, "char_start": 493, "char_end": 494, "line": "\n" }, { "line_no": 19, "char_start": 494, "char_end": 535, "line": " if (q >= end) return 0; /* fail */\n" } ] }
{ "deleted": [], "added": [ { "char_start": 493, "char_end": 535, "chars": "\n if (q >= end) return 0; /* fail */\n" } ] }
github.com/kkos/oniguruma/commit/9690d3ab1f9bcd2db8cbe1fe3ee4a5da606b8814
src/regexec.c
cwe-125
mpeg4_decode_studio_block
static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scan...
static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scan...
{ "deleted": [], "added": [ { "line_no": 86, "char_start": 2920, "char_end": 2946, "line": " if (idx > 63)\n" }, { "line_no": 87, "char_start": 2946, "char_end": 2990, "line": " return AVERROR_INVALIDDATA;\n" }, { "l...
{ "deleted": [ { "char_start": 2954, "char_end": 2954, "chars": "" }, { "char_start": 3215, "char_end": 3215, "chars": "" } ], "added": [ { "char_start": 2932, "char_end": 3002, "chars": "if (idx > 63)\n return AVERROR_INVALI...
github.com/FFmpeg/FFmpeg/commit/d227ed5d598340e719eff7156b1aa0a4469e9a6a
libavcodec/mpeg4videodec.c
cwe-125
S_grok_bslash_N
S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode ** node_p, UV * code_point_p, int * cp_count, I32 * flagp, const bool strict, const U32 depth ) { /* This routine teases apart the various meanings of \N and retu...
S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode ** node_p, UV * code_point_p, int * cp_count, I32 * flagp, const bool strict, const U32 depth ) { /* This routine teases apart the various meanings of \N and retu...
{ "deleted": [ { "line_no": 142, "char_start": 6253, "char_end": 6293, "line": " endbrace = strchr(RExC_parse, '}');\n" } ], "added": [ { "line_no": 142, "char_start": 6253, "char_end": 6325, "line": " endbrace = (char *) memchr(RExC_parse, '}', RE...
{ "deleted": [ { "char_start": 6268, "char_end": 6270, "chars": "st" } ], "added": [ { "char_start": 6268, "char_end": 6272, "chars": "(cha" }, { "char_start": 6273, "char_end": 6280, "chars": " *) mem" }, { "char_start": 6299...
github.com/Perl/perl5/commit/43b2f4ef399e2fd7240b4eeb0658686ad95f8e62
regcomp.c
cwe-125
enc_untrusted_read
ssize_t enc_untrusted_read(int fd, void *buf, size_t count) { return static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall( asylo::system_call::kSYS_read, fd, buf, count)); }
ssize_t enc_untrusted_read(int fd, void *buf, size_t count) { ssize_t ret = static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall( asylo::system_call::kSYS_read, fd, buf, count)); if (ret != -1 && ret > count) { ::asylo::primitives::TrustedPrimitives::BestEffortAbort( "enc_untrusted_read: read ...
{ "deleted": [ { "line_no": 2, "char_start": 62, "char_end": 129, "line": " return static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall(\n" } ], "added": [ { "line_no": 2, "char_start": 62, "char_end": 136, "line": " ssize_t ret = static_cast<ssize...
{ "deleted": [ { "char_start": 67, "char_end": 70, "chars": "urn" } ], "added": [ { "char_start": 64, "char_end": 68, "chars": "ssiz" }, { "char_start": 69, "char_end": 70, "chars": "_" }, { "char_start": 71, "char_end":...
github.com/google/asylo/commit/b1d120a2c7d7446d2cc58d517e20a1b184b82200
asylo/platform/host_call/trusted/host_calls.cc
cwe-125
WavpackVerifySingleBlock
int WavpackVerifySingleBlock (unsigned char *buffer, int verify_checksum) { WavpackHeader *wphdr = (WavpackHeader *) buffer; uint32_t checksum_passed = 0, bcount, meta_bc; unsigned char *dp, meta_id, c1, c2; if (strncmp (wphdr->ckID, "wvpk", 4) || wphdr->ckSize + 8 < sizeof (WavpackHeader)) ret...
int WavpackVerifySingleBlock (unsigned char *buffer, int verify_checksum) { WavpackHeader *wphdr = (WavpackHeader *) buffer; uint32_t checksum_passed = 0, bcount, meta_bc; unsigned char *dp, meta_id, c1, c2; if (strncmp (wphdr->ckID, "wvpk", 4) || wphdr->ckSize + 8 < sizeof (WavpackHeader)) ret...
{ "deleted": [ { "line_no": 60, "char_start": 1724, "char_end": 1869, "line": " if (*dp++ != (csum & 0xff) || *dp++ != ((csum >> 8) & 0xff) || *dp++ != ((csum >> 16) & 0xff) || *dp++ != ((csum >> 24) & 0xff))\n" }, { "line_no": 66, "char_start": 1973, ...
{ "deleted": [ { "char_start": 1747, "char_end": 1749, "chars": "++" }, { "char_start": 1770, "char_end": 1771, "chars": "*" }, { "char_start": 1773, "char_end": 1775, "chars": "++" }, { "char_start": 1803, "char_end": 1804,...
github.com/dbry/WavPack/commit/bba5389dc598a92bdf2b297c3ea34620b6679b5b
src/open_utils.c
cwe-125
ReadVIFFImage
static Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define VFF_MAPTY...
static Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define VFF_MAPTY...
{ "deleted": [ { "line_no": 370, "char_start": 12423, "char_end": 12486, "line": " pixels=(unsigned char *) AcquireQuantumMemory(max_packets,\n" }, { "line_no": 371, "char_start": 12486, "char_end": 12526, "line": " bytes_per_pixel*sizeof(*pixels));\...
{ "deleted": [ { "char_start": 12473, "char_end": 12474, "chars": "m" }, { "char_start": 12478, "char_end": 12481, "chars": "ack" }, { "char_start": 12482, "char_end": 12483, "chars": "t" } ], "added": [ { "char_start": 12473,...
github.com/ImageMagick/ImageMagick/commit/ca0c886abd6d3ef335eb74150cd23b89ebd17135
coders/viff.c
cwe-125
core_anal_bytes
static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int fmt) { int stacksize = r_config_get_i (core->config, "esil.stack.depth"); bool iotrap = r_config_get_i (core->config, "esil.iotrap"); bool romem = r_config_get_i (core->config, "esil.romem"); bool stats = r_config_get_i (core->config, "...
static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int fmt) { int stacksize = r_config_get_i (core->config, "esil.stack.depth"); bool iotrap = r_config_get_i (core->config, "esil.iotrap"); bool romem = r_config_get_i (core->config, "esil.romem"); bool stats = r_config_get_i (core->config, "...
{ "deleted": [ { "line_no": 243, "char_start": 7313, "char_end": 7345, "line": "\t\t\tfor (j = 0; j < size; j++) {\n" }, { "line_no": 244, "char_start": 7345, "char_end": 7387, "line": "\t\t\t\tr_cons_printf (\"%02x\", buf[j + idx]);\n" }, { "l...
{ "deleted": [ { "char_start": 7333, "char_end": 7334, "chars": "i" }, { "char_start": 7335, "char_end": 7336, "chars": "e" }, { "char_start": 7372, "char_end": 7384, "chars": "buf[j + idx]" } ], "added": [ { "char_start": 731...
github.com/radare/radare2/commit/a1bc65c3db593530775823d6d7506a457ed95267
libr/core/cmd_anal.c
cwe-125
update_read_bitmap_data
static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData) { WINPR_UNUSED(update); if (Stream_GetRemainingLength(s) < 18) return FALSE; Stream_Read_UINT16(s, bitmapData->destLeft); Stream_Read_UINT16(s, bitmapData->destTop); Stream_Read_UINT16(s, bitmapData->destRight); Stream_...
static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData) { WINPR_UNUSED(update); if (Stream_GetRemainingLength(s) < 18) return FALSE; Stream_Read_UINT16(s, bitmapData->destLeft); Stream_Read_UINT16(s, bitmapData->destTop); Stream_Read_UINT16(s, bitmapData->destRight); Stream_...
{ "deleted": [], "added": [ { "line_no": 21, "char_start": 699, "char_end": 740, "line": "\t\t\tif (Stream_GetRemainingLength(s) < 8)\n" }, { "line_no": 22, "char_start": 740, "char_end": 758, "line": "\t\t\t\treturn FALSE;\n" }, { "line_no":...
{ "deleted": [], "added": [ { "char_start": 702, "char_end": 762, "chars": "if (Stream_GetRemainingLength(s) < 8)\n\t\t\t\treturn FALSE;\n\n\t\t\t" } ] }
github.com/FreeRDP/FreeRDP/commit/f8890a645c221823ac133dbf991f8a65ae50d637
libfreerdp/core/update.c
cwe-125
autodetect_recv_bandwidth_measure_results
static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; if (autodetectRspPdu->headerLength != 0x0E) return FALSE; WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results ...
static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; if (autodetectRspPdu->headerLength != 0x0E) return FALSE; WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results ...
{ "deleted": [], "added": [ { "line_no": 10, "char_start": 327, "char_end": 366, "line": "\tif (Stream_GetRemainingLength(s) < 8)\n" }, { "line_no": 11, "char_start": 366, "char_end": 379, "line": "\t\treturn -1;\n" } ] }
{ "deleted": [], "added": [ { "char_start": 328, "char_end": 380, "chars": "if (Stream_GetRemainingLength(s) < 8)\n\t\treturn -1;\n\t" } ] }
github.com/FreeRDP/FreeRDP/commit/f5e73cc7c9cd973b516a618da877c87b80950b65
libfreerdp/core/autodetect.c
cwe-125
ssl_parse_server_psk_hint
static int ssl_parse_server_psk_hint( mbedtls_ssl_context *ssl, unsigned char **p, unsigned char *end ) { int ret = MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE; size_t len; ((void) ssl); /* * PSK parameters: * * opaque ...
static int ssl_parse_server_psk_hint( mbedtls_ssl_context *ssl, unsigned char **p, unsigned char *end ) { int ret = MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE; size_t len; ((void) ssl); /* * PSK parameters: * * opaque ...
{ "deleted": [ { "line_no": 23, "char_start": 646, "char_end": 673, "line": " if( (*p) + len > end )\n" } ], "added": [ { "line_no": 23, "char_start": 646, "char_end": 673, "line": " if( (*p) > end - len )\n" } ] }
{ "deleted": [ { "char_start": 659, "char_end": 660, "chars": "+" }, { "char_start": 661, "char_end": 662, "chars": "l" }, { "char_start": 665, "char_end": 666, "chars": ">" }, { "char_start": 669, "char_end": 670, "ch...
github.com/ARMmbed/mbedtls/commit/5224a7544c95552553e2e6be0b4a789956a6464e
library/ssl_cli.c
cwe-125
youngcollection
static void youngcollection (lua_State *L, global_State *g) { GCObject **psurvival; /* to point to first non-dead survival object */ lua_assert(g->gcstate == GCSpropagate); markold(g, g->survival, g->reallyold); markold(g, g->finobj, g->finobjrold); atomic(L); /* sweep nursery and get a pointer to its las...
static void youngcollection (lua_State *L, global_State *g) { GCObject **psurvival; /* to point to first non-dead survival object */ lua_assert(g->gcstate == GCSpropagate); markold(g, g->allgc, g->reallyold); markold(g, g->finobj, g->finobjrold); atomic(L); /* sweep nursery and get a pointer to its last l...
{ "deleted": [ { "line_no": 4, "char_start": 178, "char_end": 219, "line": " markold(g, g->survival, g->reallyold);\n" } ], "added": [ { "line_no": 4, "char_start": 178, "char_end": 216, "line": " markold(g, g->allgc, g->reallyold);\n" } ] }
{ "deleted": [ { "char_start": 194, "char_end": 200, "chars": "surviv" } ], "added": [ { "char_start": 196, "char_end": 199, "chars": "lgc" } ] }
github.com/lua/lua/commit/127e7a6c8942b362aa3c6627f44d660a4fb75312
lgc.c
cwe-125
ext4_fill_super
static int ext4_fill_super(struct super_block *sb, void *data, int silent) { char *orig_data = kstrdup(data, GFP_KERNEL); struct buffer_head *bh; struct ext4_super_block *es = NULL; struct ext4_sb_info *sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); ext4_fsblk_t block; ext4_fsblk_t sb_block = get_sb_block(&data); ext4...
static int ext4_fill_super(struct super_block *sb, void *data, int silent) { char *orig_data = kstrdup(data, GFP_KERNEL); struct buffer_head *bh; struct ext4_super_block *es = NULL; struct ext4_sb_info *sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); ext4_fsblk_t block; ext4_fsblk_t sb_block = get_sb_block(&data); ext4...
{ "deleted": [], "added": [ { "line_no": 522, "char_start": 16711, "char_end": 16748, "line": "\tif (ext4_has_feature_meta_bg(sb)) {\n" }, { "line_no": 523, "char_start": 16748, "char_end": 16802, "line": "\t\tif (le32_to_cpu(es->s_first_meta_bg) >= db_cou...
{ "deleted": [], "added": [ { "char_start": 16712, "char_end": 16999, "chars": "if (ext4_has_feature_meta_bg(sb)) {\n\t\tif (le32_to_cpu(es->s_first_meta_bg) >= db_count) {\n\t\t\text4_msg(sb, KERN_WARNING,\n\t\t\t\t \"first meta block group too large: %u \"\n\t\t\t\t \"(group descriptor block...
github.com/torvalds/linux/commit/3a4b77cd47bb837b8557595ec7425f281f2ca1fe
fs/ext4/super.c
cwe-125
mxf_parse_structural_metadata
static int mxf_parse_structural_metadata(MXFContext *mxf) { MXFPackage *material_package = NULL; int i, j, k, ret; av_log(mxf->fc, AV_LOG_TRACE, "metadata sets count %d\n", mxf->metadata_sets_count); /* TODO: handle multiple material packages (OP3x) */ for (i = 0; i < mxf->packages_count; i++) { ...
static int mxf_parse_structural_metadata(MXFContext *mxf) { MXFPackage *material_package = NULL; int i, j, k, ret; av_log(mxf->fc, AV_LOG_TRACE, "metadata sets count %d\n", mxf->metadata_sets_count); /* TODO: handle multiple material packages (OP3x) */ for (i = 0; i < mxf->packages_count; i++) { ...
{ "deleted": [ { "line_no": 104, "char_start": 5013, "char_end": 5117, "line": " av_log(mxf, AV_LOG_TRACE, \"could not resolve essence container data strong ref\\n\");\n" } ], "added": [ { "line_no": 104, "char_start": 5013, "char_end": 5121...
{ "deleted": [], "added": [ { "char_start": 5043, "char_end": 5047, "chars": "->fc" } ] }
github.com/FFmpeg/FFmpeg/commit/bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75
libavformat/mxfdec.c
cwe-125
parse_hid_report_descriptor
static void parse_hid_report_descriptor(struct gtco *device, char * report, int length) { struct device *ddev = &device->intf->dev; int x, i = 0; /* Tag primitive vars */ __u8 prefix; __u8 size; __u8 tag; __u8 type; __u8 data = 0; __u16 data16 = 0; __u32 data32 = 0; /* For parsing logi...
static void parse_hid_report_descriptor(struct gtco *device, char * report, int length) { struct device *ddev = &device->intf->dev; int x, i = 0; /* Tag primitive vars */ __u8 prefix; __u8 size; __u8 tag; __u8 type; __u8 data = 0; __u16 data16 = 0; __u32 data32 = 0; /* For parsing logi...
{ "deleted": [ { "line_no": 35, "char_start": 704, "char_end": 726, "line": "\t\tprefix = report[i];\n" }, { "line_no": 36, "char_start": 726, "char_end": 727, "line": "\n" }, { "line_no": 37, "char_start": 727, "char_end": 752, ...
{ "deleted": [ { "char_start": 723, "char_end": 755, "chars": "];\n\n\t\t/* Skip over prefix */\n\t\ti" }, { "char_start": 987, "char_end": 988, "chars": "3" }, { "char_start": 989, "char_end": 1002, "chars": "\n\t\t\tsize = 4;" } ], "a...
github.com/torvalds/linux/commit/a50829479f58416a013a4ccca791336af3c584c7
drivers/input/tablet/gtco.c
cwe-125
fpm_log_write
int fpm_log_write(char *log_format) /* {{{ */ { char *s, *b; char buffer[FPM_LOG_BUFFER+1]; int token, test; size_t len, len2; struct fpm_scoreboard_proc_s proc, *proc_p; struct fpm_scoreboard_s *scoreboard; char tmp[129]; char format[129]; time_t now_epoch; #ifdef HAVE_TIMES clock_t tms_total; #endif if (!...
int fpm_log_write(char *log_format) /* {{{ */ { char *s, *b; char buffer[FPM_LOG_BUFFER+1]; int token, test; size_t len, len2; struct fpm_scoreboard_proc_s proc, *proc_p; struct fpm_scoreboard_s *scoreboard; char tmp[129]; char format[129]; time_t now_epoch; #ifdef HAVE_TIMES clock_t tms_total; #endif if (!...
{ "deleted": [], "added": [ { "line_no": 352, "char_start": 9435, "char_end": 9467, "line": "\t\t\tif (len >= FPM_LOG_BUFFER) {\n" }, { "line_no": 353, "char_start": 9467, "char_end": 9581, "line": "\t\t\t\tzlog(ZLOG_NOTICE, \"the log buffer is full (%d). ...
{ "deleted": [], "added": [ { "char_start": 9438, "char_end": 9626, "chars": "if (len >= FPM_LOG_BUFFER) {\n\t\t\t\tzlog(ZLOG_NOTICE, \"the log buffer is full (%d). The access log request has been truncated.\", FPM_LOG_BUFFER);\n\t\t\t\tlen = FPM_LOG_BUFFER;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t" ...
github.com/php/php-src/commit/2721a0148649e07ed74468f097a28899741eb58f
sapi/fpm/fpm/fpm_log.c
cwe-125
load_tile
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfdat...
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfdat...
{ "deleted": [ { "line_no": 24, "char_start": 339, "char_end": 418, "line": " xcfdata=(XCFPixelInfo *) AcquireQuantumMemory(data_length,sizeof(*xcfdata));\n" } ], "added": [ { "line_no": 24, "char_start": 339, "char_end": 410, "line": " xcfdata=(XCFPix...
{ "deleted": [], "added": [ { "char_start": 387, "char_end": 397, "chars": "MagickMax(" }, { "char_start": 408, "char_end": 451, "chars": ",\n tile_image->columns*tile_image->rows)" } ] }
github.com/ImageMagick/ImageMagick/commit/a2e1064f288a353bc5fef7f79ccb7683759e775c
coders/xcf.c
cwe-125
hid_input_field
static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; unsigned offset = field->report_offset; unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; __...
static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; unsigned offset = field->report_offset; unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; __...
{ "deleted": [], "added": [ { "line_no": 26, "char_start": 740, "char_end": 782, "line": "\t\t value[n] - min < field->maxusage &&\n" }, { "line_no": 39, "char_start": 1088, "char_end": 1134, "line": "\t\t\t&& field->value[n] - min < field->maxusage\n" ...
{ "deleted": [ { "char_start": 803, "char_end": 803, "chars": "" }, { "char_start": 1225, "char_end": 1225, "chars": "" } ], "added": [ { "char_start": 746, "char_end": 788, "chars": "value[n] - min < field->maxusage &&\n\t\t " }, ...
github.com/torvalds/linux/commit/50220dead1650609206efe91f0cc116132d59b3f
drivers/hid/hid-core.c
cwe-125
gmc_mmx
static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) { const int w = 8; const int ix = ox >> (16 + shift); const int iy = oy >> (16 ...
static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) { const int w = 8; const int ix = ox >> (16 + shift); const int iy = oy >> (16 ...
{ "deleted": [ { "line_no": 28, "char_start": 1008, "char_end": 1060, "line": " int need_emu = (unsigned) ix >= width - w ||\n" }, { "line_no": 29, "char_start": 1060, "char_end": 1110, "line": " (unsigned) iy >= height - h;\n" ...
{ "deleted": [], "added": [ { "char_start": 1059, "char_end": 1072, "chars": " width < w ||" }, { "char_start": 1121, "char_end": 1156, "chars": " || height< h\n " } ] }
github.com/FFmpeg/FFmpeg/commit/58cf31cee7a456057f337b3102a03206d833d5e8
libavcodec/x86/mpegvideodsp.c
cwe-125
decode_pointer_field
static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field) { #ifndef PB_ENABLE_MALLOC PB_UNUSED(wire_type); PB_UNUSED(field); PB_RETURN_ERROR(stream, "no malloc support"); #else switch (PB_HTYPE(field->type)) { case PB_HTYPE_REQUIRED:...
static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field) { #ifndef PB_ENABLE_MALLOC PB_UNUSED(wire_type); PB_UNUSED(field); PB_RETURN_ERROR(stream, "no malloc support"); #else switch (PB_HTYPE(field->type)) { case PB_HTYPE_REQUIRED:...
{ "deleted": [ { "line_no": 110, "char_start": 4206, "char_end": 4233, "line": " (*size)++;\n" }, { "line_no": 111, "char_start": 4233, "char_end": 4318, "line": " if (!allocate_field(stream, field->pField, field->data_size, *si...
{ "deleted": [ { "char_start": 4222, "char_end": 4249, "chars": "(*size)++;\n " }, { "char_start": 4447, "char_end": 4448, "chars": "-" }, { "char_start": 4449, "char_end": 4450, "chars": "1" } ], "added": [ { "...
github.com/nanopb/nanopb/commit/45582f1f97f49e2abfdba1463d1e1027682d9856
pb_decode.c
cwe-125
ImagingFliDecode
ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8* ptr; int framesize; int c, chunks, advance; int l, lines; int i, j, x = 0, y, ymax; /* If not even the chunk size is present, we'd better leave */ if (bytes < 4) return 0; /* We don't decode ...
ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8* ptr; int framesize; int c, chunks, advance; int l, lines; int i, j, x = 0, y, ymax; /* If not even the chunk size is present, we'd better leave */ if (bytes < 4) return 0; /* We don't decode ...
{ "deleted": [ { "line_no": 15, "char_start": 364, "char_end": 434, "line": " input buffer (on the other hand, the Python part of the driver\n" }, { "line_no": 16, "char_start": 434, "char_end": 480, "line": " makes sure this is always the case) ...
{ "deleted": [ { "char_start": 384, "char_end": 477, "chars": "(on the other hand, the Python part of the driver\n makes sure this is always the case) " } ], "added": [ { "char_start": 574, "char_end": 668, "chars": "\n if (bytes < 8) {\n state->errc...
github.com/python-pillow/Pillow/commit/a09acd0decd8a87ccce939d5ff65dab59e7d365b
src/libImaging/FliDecode.c
cwe-125
saa7164_bus_get
int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf, int peekonly) { struct tmComResBusInfo *bus = &dev->bus; u32 bytes_to_read, write_distance, curr_grp, curr_gwp, new_grp, buf_size, space_rem; struct tmComResInfo msg_tmp; int ret = SAA_ERR_BAD_PARAMETER; saa7164_bus_verify(dev); ...
int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf, int peekonly) { struct tmComResBusInfo *bus = &dev->bus; u32 bytes_to_read, write_distance, curr_grp, curr_gwp, new_grp, buf_size, space_rem; struct tmComResInfo msg_tmp; int ret = SAA_ERR_BAD_PARAMETER; saa7164_bus_verify(dev); ...
{ "deleted": [ { "line_no": 82, "char_start": 2348, "char_end": 2387, "line": "\t\tmemcpy(msg, &msg_tmp, sizeof(*msg));\n" }, { "line_no": 127, "char_start": 3732, "char_end": 3767, "line": "\t\t\t/* msg wraps around the ring */\n" }, { "line_n...
{ "deleted": [ { "char_start": 2348, "char_end": 2387, "chars": "\t\tmemcpy(msg, &msg_tmp, sizeof(*msg));\n" }, { "char_start": 3732, "char_end": 3921, "chars": "\t\t\t/* msg wraps around the ring */\n\t\t\tmemcpy_fromio(msg, bus->m_pdwGetRing + curr_grp, space_rem);\n\...
github.com/stoth68000/media-tree/commit/354dd3924a2e43806774953de536257548b5002c
drivers/media/pci/saa7164/saa7164-bus.c
cwe-125
parallel_process_irp_create
static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; UINT32 PathLength; Stream_Seek(irp->input, 28); /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */ Stream_Read_UINT32(irp->input, Pat...
static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; WCHAR* ptr; UINT32 PathLength; if (!Stream_SafeSeek(irp->input, 28)) return ERROR_INVALID_DATA; /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), Crea...
{ "deleted": [ { "line_no": 6, "char_start": 132, "char_end": 162, "line": "\tStream_Seek(irp->input, 28);\n" }, { "line_no": 10, "char_start": 330, "char_end": 423, "line": "\tstatus = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(irp->input), PathL...
{ "deleted": [ { "char_start": 331, "char_end": 332, "chars": "s" }, { "char_start": 333, "char_end": 345, "chars": "atus = Conve" }, { "char_start": 346, "char_end": 367, "chars": "tFromUnicode(CP_UTF8," }, { "char_start": 368, ...
github.com/FreeRDP/FreeRDP/commit/795842f4096501fcefc1a7f535ccc8132feb31d7
channels/parallel/client/parallel_main.c
cwe-125
tflite::GetOptionalInputTensor
const TfLiteTensor* GetOptionalInputTensor(const TfLiteContext* context, const TfLiteNode* node, int index) { const bool use_tensor = index < node->inputs->size && node->inputs->data[index] != kTfLiteOptionalTensor; if (use_tensor) { return Ge...
const TfLiteTensor* GetOptionalInputTensor(const TfLiteContext* context, const TfLiteNode* node, int index) { return GetInput(context, node, index); }
{ "deleted": [ { "line_no": 3, "char_start": 153, "char_end": 209, "line": " const bool use_tensor = index < node->inputs->size &&\n" }, { "line_no": 4, "char_start": 209, "char_end": 287, "line": " node->inputs->data[index] != kTfL...
{ "deleted": [ { "char_start": 155, "char_end": 311, "chars": "const bool use_tensor = index < node->inputs->size &&\n node->inputs->data[index] != kTfLiteOptionalTensor;\n if (use_tensor) {\n " }, { "char_start": 321, "char_end": 328, "char...
github.com/tensorflow/tensorflow/commit/00302787b788c5ff04cb6f62aed5a74d936e86c0
tensorflow/lite/kernels/kernel_util.cc
cwe-125
ReadOneMNGImage
static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { char page_geometry[MaxTextExtent]; Image *image; MagickBooleanType logging; volatile int first_mng_object, object_id, term_chunk_found, skip_to_iend; volatile ssize_t ...
static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { char page_geometry[MaxTextExtent]; Image *image; MagickBooleanType logging; volatile int first_mng_object, object_id, term_chunk_found, skip_to_iend; volatile ssize_t ...
{ "deleted": [], "added": [ { "line_no": 885, "char_start": 27353, "char_end": 27408, "line": " if ((i < 0) || (i >= MNG_MAX_OBJECTS))\n" }, { "line_no": 886, "char_start": 27408, "char_end": 27436, "line": " continue;\n" ...
{ "deleted": [], "added": [ { "char_start": 27373, "char_end": 27456, "chars": "(i < 0) || (i >= MNG_MAX_OBJECTS))\n continue;\n if (" } ] }
github.com/ImageMagick/ImageMagick/commit/78d4c5db50fbab0b4beb69c46c6167f2c6513dec
coders/png.c
cwe-125
WriteTIFFImage
static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, Image *image) { const char *mode, *option; CompressionType compression; EndianType endian_type; MagickBooleanType debug, status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType q...
static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, Image *image) { const char *mode, *option; CompressionType compression; EndianType endian_type; MagickBooleanType debug, status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType q...
{ "deleted": [ { "line_no": 893, "char_start": 30340, "char_end": 30392, "line": " if (image->exception.severity > ErrorException)\n" }, { "line_no": 894, "char_start": 30392, "char_end": 30405, "line": " break;\n" }, { "line_no": 899, ...
{ "deleted": [ { "char_start": 30340, "char_end": 30405, "chars": " if (image->exception.severity > ErrorException)\n break;\n" }, { "char_start": 30553, "char_end": 30556, "chars": "(vo" }, { "char_start": 30557, "char_end": 30559, "ch...
github.com/ImageMagick/ImageMagick6/commit/3c53413eb544cc567309b4c86485eae43e956112
coders/tiff.c
cwe-125
adjust_scalar_min_max_vals
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
{ "deleted": [ { "line_no": 248, "char_start": 8087, "char_end": 8122, "line": "\t\tcoerce_reg_to_size(&src_reg, 4);\n" } ], "added": [ { "line_no": 13, "char_start": 409, "char_end": 436, "line": "\tif (insn_bitness == 32) {\n" }, { "line_...
{ "deleted": [ { "char_start": 8077, "char_end": 8112, "chars": "_reg, 4);\n\t\tcoerce_reg_to_size(&src" } ], "added": [ { "char_start": 410, "char_end": 658, "chars": "if (insn_bitness == 32) {\n\t\t/* Relevant for 32-bit RSH: Information can propagate towards\n\t\...
github.com/torvalds/linux/commit/b799207e1e1816b09e7a5920fbb2d5fcf6edd681
kernel/bpf/verifier.c
cwe-125
ip_cmsg_recv_checksum
static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb, int tlen, int offset) { __wsum csum = skb->csum; if (skb->ip_summed != CHECKSUM_COMPLETE) return; if (offset != 0) csum = csum_sub(csum, csum_partial(skb_transport_header(skb) + tlen, offset, 0)); put_cmsg(msg, SOL...
static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb, int tlen, int offset) { __wsum csum = skb->csum; if (skb->ip_summed != CHECKSUM_COMPLETE) return; if (offset != 0) { int tend_off = skb_transport_offset(skb) + tlen; csum = csum_sub(csum, skb_checksum(skb, tend_off, offset, 0));...
{ "deleted": [ { "line_no": 9, "char_start": 185, "char_end": 203, "line": "\tif (offset != 0)\n" }, { "line_no": 10, "char_start": 203, "char_end": 227, "line": "\t\tcsum = csum_sub(csum,\n" }, { "line_no": 11, "char_start": 227, "...
{ "deleted": [ { "char_start": 205, "char_end": 209, "chars": "csum" }, { "char_start": 212, "char_end": 244, "chars": "csum_sub(csum,\n\t\t\t\tcsum_partial(" }, { "char_start": 258, "char_end": 259, "chars": "h" }, { "char_start"...
github.com/torvalds/linux/commit/ca4ef4574f1ee5252e2cd365f8f5d5bafd048f32
net/ipv4/ip_sockglue.c
cwe-125
HPHP::SimpleParser::TryParse
static bool TryParse(const char* inp, int length, TypedValue* buf, Variant& out, JSONContainerType container_type, bool is_tsimplejson) { SimpleParser parser(inp, length, buf, container_type, is_tsimplejson); bool ok = parser.parseValue(); parser.skipSpace(); ...
static bool TryParse(const char* inp, int length, TypedValue* buf, Variant& out, JSONContainerType container_type, bool is_tsimplejson) { SimpleParser parser(inp, length, buf, container_type, is_tsimplejson); bool ok = parser.parseValue(); if (!ok || (...
{ "deleted": [ { "line_no": 6, "char_start": 296, "char_end": 320, "line": " parser.skipSpace();\n" }, { "line_no": 7, "char_start": 320, "char_end": 363, "line": " if (!ok || parser.p != inp + length) {\n" } ], "added": [ { "line_no"...
{ "deleted": [ { "char_start": 318, "char_end": 334, "chars": ";\n if (!ok ||" } ], "added": [ { "char_start": 300, "char_end": 320, "chars": "if (!ok ||\n (" }, { "char_start": 338, "char_end": 339, "chars": "," }, { ...
github.com/facebook/hhvm/commit/bd586671a3c22eb2f07e55f11b3ce64e1f7961e7
hphp/runtime/ext/json/JSON_parser.cpp
cwe-125
_gdContributionsCalc
static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { double width_d; double scale_f_d = 1.0; const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res; if (scale_d ...
static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { double width_d; double scale_f_d = 1.0; const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res; if (scale_d ...
{ "deleted": [ { "line_no": 28, "char_start": 847, "char_end": 882, "line": "\t\tres->ContribRow[u].Left = iLeft;\n" }, { "line_no": 29, "char_start": 882, "char_end": 919, "line": "\t\tres->ContribRow[u].Right = iRight;\n" }, { "line_no": 30, ...
{ "deleted": [ { "char_start": 849, "char_end": 922, "chars": "res->ContribRow[u].Left = iLeft;\n\t\tres->ContribRow[u].Right = iRight;\n\n\t\t" } ], "added": [ { "char_start": 1050, "char_end": 1123, "chars": "\n\n\t\tres->ContribRow[u].Left = iLeft;\n\t\tres->Cont...
github.com/libgd/libgd/commit/4f65a3e4eedaffa1efcf9ee1eb08f0b504fbc31a
src/gd_interpolation.c
cwe-125
Get8BIMProperty
static MagickBooleanType Get8BIMProperty(const Image *image,const char *key, ExceptionInfo *exception) { char *attribute, format[MagickPathExtent], name[MagickPathExtent], *resource; const StringInfo *profile; const unsigned char *info; long start, stop; MagickBooleanType...
static MagickBooleanType Get8BIMProperty(const Image *image,const char *key, ExceptionInfo *exception) { char *attribute, format[MagickPathExtent], name[MagickPathExtent], *resource; const StringInfo *profile; const unsigned char *info; long start, stop; MagickBooleanType...
{ "deleted": [], "added": [ { "line_no": 90, "char_start": 2403, "char_end": 2453, "line": " if ((count < 0) || ((size_t) count > length))\n" }, { "line_no": 91, "char_start": 2453, "char_end": 2461, "line": " {\n" }, { "line_no": 92,...
{ "deleted": [], "added": [ { "char_start": 2412, "char_end": 2515, "chars": "count < 0) || ((size_t) count > length))\n {\n length=0; \n continue;\n }\n if ((" } ] }
github.com/ImageMagick/ImageMagick/commit/dd84447b63a71fa8c3f47071b09454efc667767b
MagickCore/property.c
cwe-125
parse_string
static const char *parse_string(cJSON *item,const char *str,const char **ep) { const char *ptr=str+1,*end_ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2; if (*str!='\"') {*ep=str;return 0;} /* not a string! */ while (*end_ptr!='\"' && *end_ptr && ++len) if (*end_ptr++ == '\\') end_ptr++; /* Skip escaped ...
static const char *parse_string(cJSON *item,const char *str,const char **ep) { const char *ptr=str+1,*end_ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2; if (*str!='\"') {*ep=str;return 0;} /* not a string! */ while (*end_ptr!='\"' && *end_ptr && ++len) { if (*end_ptr++ == '\\') { if (*end_pt...
{ "deleted": [ { "line_no": 5, "char_start": 222, "char_end": 224, "line": "\t\n" }, { "line_no": 6, "char_start": 224, "char_end": 331, "line": "\twhile (*end_ptr!='\\\"' && *end_ptr && ++len) if (*end_ptr++ == '\\\\') end_ptr++;\t/* Skip escaped quotes. */...
{ "deleted": [ { "char_start": 222, "char_end": 223, "chars": "\t" } ], "added": [ { "char_start": 267, "char_end": 275, "chars": "\n\t{\n\t " }, { "char_start": 299, "char_end": 301, "chars": "\n\t" }, { "char_start": 302, ...
github.com/DaveGamble/cJSON/commit/94df772485c92866ca417d92137747b2e3b0a917
cJSON.c
cwe-125
dbd_st_prepare
dbd_st_prepare( SV *sth, imp_sth_t *imp_sth, char *statement, SV *attribs) { int i; SV **svp; dTHX; #if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION #if MYSQL_VERSION_ID < CALL_PLACEHOLDER_VERSION char *str_ptr, *str_last_ptr; #if MYSQL_VERSION_ID < LIMIT_PLACEHOLDER_VERSION int limit_flag=0; #endif #en...
dbd_st_prepare( SV *sth, imp_sth_t *imp_sth, char *statement, SV *attribs) { int i; SV **svp; dTHX; #if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION #if MYSQL_VERSION_ID < CALL_PLACEHOLDER_VERSION char *str_ptr, *str_last_ptr; #if MYSQL_VERSION_ID < LIMIT_PLACEHOLDER_VERSION int limit_flag=0; #endif #en...
{ "deleted": [ { "line_no": 17, "char_start": 324, "char_end": 356, "line": " int col_type, prepare_retval;\n" }, { "line_no": 213, "char_start": 7021, "char_end": 7083, "line": " int has_statement_fields= imp_sth->stmt->fields != 0;\n" }, { ...
{ "deleted": [ { "char_start": 330, "char_end": 340, "chars": "col_type, " }, { "char_start": 7029, "char_end": 7091, "chars": "int has_statement_fields= imp_sth->stmt->fields != 0;\n " }, { "char_start": 7611, "char_end": 7679, "chars":...
github.com/perl5-dbi/DBD-mysql/commit/793b72b1a0baa5070adacaac0e12fd995a6fbabe
dbdimp.c
cwe-125
get_uncompressed_data
get_uncompressed_data(struct archive_read *a, const void **buff, size_t size, size_t minimum) { struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { /* Copy mode. */ /* * Note: '1' here is a performance optimization. ...
get_uncompressed_data(struct archive_read *a, const void **buff, size_t size, size_t minimum) { struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { /* Copy mode. */ *buff = __archive_read_ahead(a, minimum, &bytes_avail)...
{ "deleted": [ { "line_no": 10, "char_start": 264, "char_end": 269, "line": "\t\t/*\n" }, { "line_no": 11, "char_start": 269, "char_end": 320, "line": "\t\t * Note: '1' here is a performance optimization.\n" }, { "line_no": 12, "char_star...
{ "deleted": [ { "char_start": 266, "char_end": 499, "chars": "/*\n\t\t * Note: '1' here is a performance optimization.\n\t\t * Recall that the decompression layer returns a count of\n\t\t * available bytes; asking for more than that forces the\n\t\t * decompressor to combine reads by copying da...
github.com/libarchive/libarchive/commit/65a23f5dbee4497064e9bb467f81138a62b0dae1
libarchive/archive_read_support_format_7zip.c
cwe-125
security_fips_decrypt
BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp) { size_t olen; if (!winpr_Cipher_Update(rdp->fips_decrypt, data, length, data, &olen)) return FALSE; return TRUE; }
BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp) { size_t olen; if (!rdp || !rdp->fips_decrypt) return FALSE; if (!winpr_Cipher_Update(rdp->fips_decrypt, data, length, data, &olen)) return FALSE; return TRUE; }
{ "deleted": [], "added": [ { "line_no": 5, "char_start": 84, "char_end": 117, "line": "\tif (!rdp || !rdp->fips_decrypt)\n" }, { "line_no": 6, "char_start": 117, "char_end": 133, "line": "\t\treturn FALSE;\n" }, { "line_no": 7, "char_s...
{ "deleted": [], "added": [ { "char_start": 90, "char_end": 140, "chars": "rdp || !rdp->fips_decrypt)\n\t\treturn FALSE;\n\n\tif (!" } ] }
github.com/FreeRDP/FreeRDP/commit/d6cd14059b257318f176c0ba3ee0a348826a9ef8
libfreerdp/core/security.c
cwe-125
update_read_icon_info
static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) { BYTE* newBitMask; if (Stream_GetRemainingLength(s) < 8) return FALSE; Stream_Read_UINT16(s, iconInfo->cacheEntry); /* cacheEntry (2 bytes) */ Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ Stream_Read_UINT8(s, iconInfo->b...
static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) { BYTE* newBitMask; if (Stream_GetRemainingLength(s) < 8) return FALSE; Stream_Read_UINT16(s, iconInfo->cacheEntry); /* cacheEntry (2 bytes) */ Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ Stream_Read_UINT8(s, iconInfo->b...
{ "deleted": [ { "line_no": 44, "char_start": 1148, "char_end": 1230, "line": "\tif (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor)\n" }, { "line_no": 45, "char_start": 1230, "char_end": 1246, "line": "\t\treturn FALSE;\n" }...
{ "deleted": [ { "char_start": 1149, "char_end": 1248, "chars": "if (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor)\n\t\treturn FALSE;\n\n\t" }, { "char_start": 2368, "char_end": 2368, "chars": "" } ], "added": [ { "char_s...
github.com/FreeRDP/FreeRDP/commit/6b2bc41935e53b0034fe5948aeeab4f32e80f30f
libfreerdp/core/window.c
cwe-125
usbhid_parse
static int usbhid_parse(struct hid_device *hid) { struct usb_interface *intf = to_usb_interface(hid->dev.parent); struct usb_host_interface *interface = intf->cur_altsetting; struct usb_device *dev = interface_to_usbdev (intf); struct hid_descriptor *hdesc; u32 quirks = 0; unsigned int rsize = 0; char *rdesc; i...
static int usbhid_parse(struct hid_device *hid) { struct usb_interface *intf = to_usb_interface(hid->dev.parent); struct usb_host_interface *interface = intf->cur_altsetting; struct usb_device *dev = interface_to_usbdev (intf); struct hid_descriptor *hdesc; u32 quirks = 0; unsigned int rsize = 0; char *rdesc; i...
{ "deleted": [ { "line_no": 36, "char_start": 1218, "char_end": 1264, "line": "\tfor (n = 0; n < hdesc->bNumDescriptors; n++)\n" } ], "added": [ { "line_no": 11, "char_start": 331, "char_end": 353, "line": "\tint num_descriptors;\n" }, { "l...
{ "deleted": [ { "char_start": 1219, "char_end": 1220, "chars": "f" }, { "char_start": 1226, "char_end": 1227, "chars": "=" }, { "char_start": 1228, "char_end": 1230, "chars": "0;" }, { "char_start": 1231, "char_end": 1232, ...
github.com/torvalds/linux/commit/f043bfc98c193c284e2cd768fefabe18ac2fed9b
drivers/hid/usbhid/hid-core.c
cwe-125
HPHP::exif_process_APP12
static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length) { size_t l1, l2=0; if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2); if (...
static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length) { size_t l1, l2=0; if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2); if (...
{ "deleted": [ { "line_no": 8, "char_start": 339, "char_end": 393, "line": " l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);\n" } ], "added": [ { "line_no": 8, "char_start": 339, "char_end": 393, "line": " l2 = php_strnlen(buffer+2+l1+1, length...
{ "deleted": [ { "char_start": 388, "char_end": 389, "chars": "+" } ], "added": [ { "char_start": 388, "char_end": 389, "chars": "-" } ] }
github.com/facebook/hhvm/commit/f1cd34e63c2a0d9702be3d41462db7bfd0ae7da3
hphp/runtime/ext/gd/ext_gd.cpp
cwe-125
modbus_reply
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping) { int offset; int slave; int function; uint16_t address; uint8_t rsp[MAX_MESSAGE_LENGTH]; int rsp_length = 0; sft_t sft; if (ctx == NULL) { errno = EINVAL; ...
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping) { int offset; int slave; int function; uint16_t address; uint8_t rsp[MAX_MESSAGE_LENGTH]; int rsp_length = 0; sft_t sft; if (ctx == NULL) { errno = EINVAL; ...
{ "deleted": [ { "line_no": 140, "char_start": 6054, "char_end": 6106, "line": " if (nb < 1 || MODBUS_MAX_WRITE_BITS < nb) {\n" }, { "line_no": 171, "char_start": 7556, "char_end": 7613, "line": " if (nb < 1 || MODBUS_MAX_WRITE_REGISTERS < nb) ...
{ "deleted": [], "added": [ { "char_start": 6001, "char_end": 6040, "chars": "nb_bits = req[offset + 5];\n int " }, { "char_start": 6136, "char_end": 6156, "chars": " < nb || nb_bits * 8" }, { "char_start": 7557, "char_end": 7597, "cha...
github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc
src/modbus.c
cwe-125
store_versioninfo_gnu_verneed
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) {...
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) {...
{ "deleted": [ { "line_no": 85, "char_start": 2490, "char_end": 2517, "line": "\t\tvstart += entry->vn_aux;\n" } ], "added": [ { "line_no": 85, "char_start": 2490, "char_end": 2520, "line": "\t\tst32 vnaux = entry->vn_aux;\n" }, { "line_no"...
{ "deleted": [ { "char_start": 2492, "char_end": 2493, "chars": "v" }, { "char_start": 2496, "char_end": 2498, "chars": "rt" }, { "char_start": 2499, "char_end": 2500, "chars": "+" } ], "added": [ { "char_start": 2494, "...
github.com/radare/radare2/commit/c6d0076c924891ad9948a62d89d0bcdaf965f0cd
libr/bin/format/elf/elf.c
cwe-125
ReadWPGImage
static Image *ReadWPGImage(const ImageInfo *image_info, ExceptionInfo *exception) { typedef struct { size_t FileId; MagickOffsetType DataOffset; unsigned int ProductType; unsigned int FileType; unsigned char MajorVersion; unsigned char MinorVersion; unsigned int EncryptKey; unsigne...
static Image *ReadWPGImage(const ImageInfo *image_info, ExceptionInfo *exception) { typedef struct { size_t FileId; MagickOffsetType DataOffset; unsigned int ProductType; unsigned int FileType; unsigned char MajorVersion; unsigned char MinorVersion; unsigned int EncryptKey; unsigne...
{ "deleted": [ { "line_no": 485, "char_start": 16143, "char_end": 16191, "line": " ldblk,sizeof(*BImgBuff));\n" } ], "added": [ { "line_no": 485, "char_start": 16143, "char_end": 16193, "line": " ldblk+1,sizeof(*...
{ "deleted": [], "added": [ { "char_start": 16170, "char_end": 16172, "chars": "+1" } ] }
github.com/ImageMagick/ImageMagick/commit/bef1e4f637d8f665bc133a9c6d30df08d983bc3a
coders/wpg.c
cwe-125
gf_m2ts_process_pmt
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) { u32 info_length, pos, desc_len, evt_type, nb_es,i; u32 nb_sections; u32 data_size; u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,...
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) { u32 info_length, pos, desc_len, evt_type, nb_es,i; u32 nb_sections; u32 data_size; u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,...
{ "deleted": [ { "line_no": 413, "char_start": 14239, "char_end": 14243, "line": "\t\t}\n" }, { "line_no": 415, "char_start": 14244, "char_end": 14300, "line": "\t\tif (es->stream_type == GF_M2TS_VIDEO_HEVC) nb_hevc++;\n" }, { "line_no": 416, ...
{ "deleted": [ { "char_start": 14239, "char_end": 14240, "chars": "\t" }, { "char_start": 14241, "char_end": 14244, "chars": "}\n\n" } ], "added": [ { "char_start": 14240, "char_end": 14241, "chars": "\t" }, { "char_start": 14...
github.com/gpac/gpac/commit/2320eb73afba753b39b7147be91f7be7afc0eeb7
src/media_tools/mpegts.c
cwe-125
next_line
next_line(struct archive_read *a, const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl) { ssize_t len; int quit; quit = 0; if (*avail == 0) { *nl = 0; len = 0; } else len = get_line_size(*b, *avail, nl); /* * Read bytes more while it does not reach the end of line. */ while (*nl == 0 && l...
next_line(struct archive_read *a, const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl) { ssize_t len; int quit; quit = 0; if (*avail == 0) { *nl = 0; len = 0; } else len = get_line_size(*b, *avail, nl); /* * Read bytes more while it does not reach the end of line. */ while (*nl == 0 && l...
{ "deleted": [ { "line_no": 38, "char_start": 933, "char_end": 972, "line": "\t\tlen = get_line_size(*b, *avail, nl);\n" } ], "added": [ { "line_no": 38, "char_start": 933, "char_end": 984, "line": "\t\tlen = get_line_size(*b + len, *avail - len, nl);\n"...
{ "deleted": [], "added": [ { "char_start": 957, "char_end": 963, "chars": " + len" }, { "char_start": 971, "char_end": 977, "chars": " - len" } ] }
github.com/libarchive/libarchive/commit/eec077f52bfa2d3f7103b4b74d52572ba8a15aca
libarchive/archive_read_support_format_mtree.c
cwe-125
X86_insn_reg_intel
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_SIZE(insn_regs_intel) / 2; if (!intel_regs_sorted) { memcpy(insn_regs_intel_sorted, insn_regs_intel, sizeof(insn_regs_intel_sorted)); qsor...
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; unsigned int mid; if (!intel_regs_sorted) { memcpy(insn_regs_intel_sorted, insn_regs_intel, sizeof(insn_regs_intel_sorted))...
{ "deleted": [ { "line_no": 5, "char_start": 148, "char_end": 199, "line": "\tunsigned int mid = ARR_SIZE(insn_regs_intel) / 2;\n" }, { "line_no": 29, "char_start": 780, "char_end": 808, "line": "\t\tmid = (first + last) / 2;\n" } ], "added": [ {...
{ "deleted": [ { "char_start": 165, "char_end": 197, "chars": " = ARR_SIZE(insn_regs_intel) / 2" }, { "char_start": 779, "char_end": 807, "chars": "\n\t\tmid = (first + last) / 2;" } ], "added": [ { "char_start": 72, "char_end": 112, "chars...
github.com/aquynh/capstone/commit/87a25bb543c8e4c09b48d4b4a6c7db31ce58df06
arch/X86/X86Mapping.c
cwe-125
r_bin_java_line_number_table_attr_new
R_API RBinJavaAttrInfo *r_bin_java_line_number_table_attr_new(ut8 *buffer, ut64 sz, ut64 buf_offset) { ut32 i = 0; ut64 curpos, offset = 0; RBinJavaLineNumberAttribute *lnattr; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (buffer, sz, buf_offset); if (!attr) { return NULL; } offset += 6; attr->type = ...
R_API RBinJavaAttrInfo *r_bin_java_line_number_table_attr_new(ut8 *buffer, ut64 sz, ut64 buf_offset) { ut32 i = 0; ut64 curpos, offset = 0; RBinJavaLineNumberAttribute *lnattr; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (buffer, sz, buf_offset); if (!attr) { return NULL; } offset += 6; attr->type = ...
{ "deleted": [], "added": [ { "line_no": 29, "char_start": 996, "char_end": 1022, "line": "\t\tif (offset + 8 >= sz) {\n" }, { "line_no": 30, "char_start": 1022, "char_end": 1032, "line": "\t\t\tbreak;\n" }, { "line_no": 31, "char_start...
{ "deleted": [], "added": [ { "char_start": 998, "char_end": 1038, "chars": "if (offset + 8 >= sz) {\n\t\t\tbreak;\n\t\t}\n\t\t" } ] }
github.com/radare/radare2/commit/eb0fb72b3c5307ec8e33effb6bf947e38cfdffe8
shlr/java/class.c
cwe-125
decode_studio_vop_header
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; if (get_bits_left(gb) <= 32) return 0; s->partitioned_frame = 0; s->decode_mb = mpeg4_decode_studio_mb; decode_smpte_tc(ctx, gb); skip_bits(gb, 10); /* temporal_reference */ ...
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; if (get_bits_left(gb) <= 32) return 0; s->partitioned_frame = 0; s->interlaced_dct = 0; s->decode_mb = mpeg4_decode_studio_mb; decode_smpte_tc(ctx, gb); skip_bits(gb, 10); ...
{ "deleted": [], "added": [ { "line_no": 9, "char_start": 195, "char_end": 222, "line": " s->interlaced_dct = 0;\n" } ] }
{ "deleted": [], "added": [ { "char_start": 202, "char_end": 229, "chars": "interlaced_dct = 0;\n s->" } ] }
github.com/FFmpeg/FFmpeg/commit/1f686d023b95219db933394a7704ad9aa5f01cbb
libavcodec/mpeg4videodec.c
cwe-125
str_lower_case_match
str_lower_case_match(OnigEncoding enc, int case_fold_flag, const UChar* t, const UChar* tend, const UChar* p, const UChar* end) { int lowlen; UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; while (t < tend) { lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, en...
str_lower_case_match(OnigEncoding enc, int case_fold_flag, const UChar* t, const UChar* tend, const UChar* p, const UChar* end) { int lowlen; UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; while (t < tend) { lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, en...
{ "deleted": [], "added": [ { "line_no": 12, "char_start": 373, "char_end": 407, "line": " if (t >= tend) return 0;\n" } ] }
{ "deleted": [], "added": [ { "char_start": 383, "char_end": 417, "chars": "t >= tend) return 0;\n if (" } ] }
github.com/kkos/oniguruma/commit/d3e402928b6eb3327f8f7d59a9edfa622fec557b
src/regexec.c
cwe-125
HPHP::SimpleParser::handleBackslash
bool handleBackslash(signed char& out) { char ch = *p++; switch (ch) { case 0: return false; case '"': out = ch; return true; case '\\': out = ch; return true; case '/': out = ch; return true; case 'b': out = '\b'; return true; case 'f': out = '\f'; return true; case ...
bool handleBackslash(signed char& out) { char ch = *p++; switch (ch) { case 0: return false; case '"': out = ch; return true; case '\\': out = ch; return true; case '/': out = ch; return true; case 'b': out = '\b'; return true; case 'f': out = '\f'; return true; case ...
{ "deleted": [ { "line_no": 19, "char_start": 646, "char_end": 722, "line": " if (UNLIKELY(ch1 != '0' || ch2 != '0' || dch3 < 0 || dch4 < 0)) {\n" }, { "line_no": 20, "char_start": 722, "char_end": 748, "line": " return false;\n" }, ...
{ "deleted": [ { "char_start": 669, "char_end": 709, "chars": "ch1 != '0' || ch2 != '0' || dch3 < 0 || " }, { "char_start": 720, "char_end": 734, "chars": "{\n " }, { "char_start": 747, "char_end": 759, "chars": "\n }" }...
github.com/facebook/hhvm/commit/b3679121bb3c7017ff04b4c08402ffff5cf59b13
hphp/runtime/ext/json/JSON_parser.cpp
cwe-125
avr_op_analyze
static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) { OPCODE_DESC *opcode_desc; ut16 ins = (buf[1] << 8) | buf[0]; int fail; char *t; // initialize op struct memset (op, 0, sizeof (RAnalOp)); op->ptr = UT64_MAX; op->val = UT64_MAX; op->jump = UT64_M...
static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) { OPCODE_DESC *opcode_desc; if (len < 2) { return NULL; } ut16 ins = (buf[1] << 8) | buf[0]; int fail; char *t; // initialize op struct memset (op, 0, sizeof (RAnalOp)); op->ptr = UT64_MAX; op->...
{ "deleted": [], "added": [ { "line_no": 3, "char_start": 142, "char_end": 158, "line": "\tif (len < 2) {\n" }, { "line_no": 4, "char_start": 158, "char_end": 173, "line": "\t\treturn NULL;\n" }, { "line_no": 5, "char_start": 173, ...
{ "deleted": [], "added": [ { "char_start": 143, "char_end": 177, "chars": "if (len < 2) {\n\t\treturn NULL;\n\t}\n\t" } ] }
github.com/radare/radare2/commit/b35530fa0681b27eba084de5527037ebfb397422
libr/anal/p/anal_avr.c
cwe-125
uas_switch_interface
static int uas_switch_interface(struct usb_device *udev, struct usb_interface *intf) { int alt; alt = uas_find_uas_alt_setting(intf); if (alt < 0) return alt; return usb_set_interface(udev, intf->altsetting[0].desc.bInterfaceNumber, alt); }
static int uas_switch_interface(struct usb_device *udev, struct usb_interface *intf) { struct usb_host_interface *alt; alt = uas_find_uas_alt_setting(intf); if (!alt) return -ENODEV; return usb_set_interface(udev, alt->desc.bInterfaceNumber, alt->desc.bAlternateSetting); }
{ "deleted": [ { "line_no": 4, "char_start": 91, "char_end": 101, "line": "\tint alt;\n" }, { "line_no": 7, "char_start": 141, "char_end": 155, "line": "\tif (alt < 0)\n" }, { "line_no": 8, "char_start": 155, "char_end": 169, ...
{ "deleted": [ { "char_start": 149, "char_end": 153, "chars": " < 0" }, { "char_start": 164, "char_end": 167, "chars": "alt" }, { "char_start": 201, "char_end": 211, "chars": "\n\t\t\tintf->" }, { "char_start": 214, "char_en...
github.com/torvalds/linux/commit/786de92b3cb26012d3d0f00ee37adf14527f35c4
drivers/usb/storage/uas.c
cwe-125
sh_op
static int sh_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_MSB,op_LSB; int ret; if (!data) return 0; memset (op, '\0', sizeof (RAnalOp)); op->addr = addr; op->type = R_ANAL_OP_TYPE_UNK; op->jump = op->fail = -1; op->ptr = op->val = -1; op->size = 2; op_MSB = anal->big_endian?...
static int sh_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_MSB,op_LSB; int ret; if (!data || len < 2) { return 0; } memset (op, '\0', sizeof (RAnalOp)); op->addr = addr; op->type = R_ANAL_OP_TYPE_UNK; op->jump = op->fail = -1; op->ptr = op->val = -1; op->size = 2; op_MSB = a...
{ "deleted": [ { "line_no": 4, "char_start": 112, "char_end": 124, "line": "\tif (!data)\n" } ], "added": [ { "line_no": 4, "char_start": 112, "char_end": 137, "line": "\tif (!data || len < 2) {\n" }, { "line_no": 6, "char_start": 149...
{ "deleted": [], "added": [ { "char_start": 122, "char_end": 133, "chars": " || len < 2" }, { "char_start": 134, "char_end": 136, "chars": " {" }, { "char_start": 148, "char_end": 151, "chars": "\n\t}" } ] }
github.com/radare/radare2/commit/77c47cf873dd55b396da60baa2ca83bbd39e4add
libr/anal/p/anal_sh.c
cwe-125
ReadPSDChannelPixels
static MagickBooleanType ReadPSDChannelPixels(Image *image, const size_t channels,const size_t row,const ssize_t type, const unsigned char *pixels,ExceptionInfo *exception) { Quantum pixel; register const unsigned char *p; register Quantum *q; register ssize_t x; size_t packet_size...
static MagickBooleanType ReadPSDChannelPixels(Image *image, const size_t channels,const size_t row,const ssize_t type, const unsigned char *pixels,ExceptionInfo *exception) { Quantum pixel; register const unsigned char *p; register Quantum *q; register ssize_t x; size_t packet_size...
{ "deleted": [ { "line_no": 72, "char_start": 1913, "char_end": 1960, "line": " GetPixelIndex(image,q),q);\n" } ], "added": [ { "line_no": 72, "char_start": 1913, "char_end": 1986, "line": " ConstrainColormapIndex(im...
{ "deleted": [], "added": [ { "char_start": 1933, "char_end": 1962, "chars": "ConstrainColormapIndex(image," }, { "char_start": 1983, "char_end": 2017, "chars": "),\n exception" } ] }
github.com/ImageMagick/ImageMagick/commit/e14fd0a2801f73bdc123baf4fbab97dec55919eb
coders/psd.c
cwe-125
ape_decode_frame
static int ape_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; APEContext *s = avctx->priv_data; uint8_t *sample8; int16_t *sample16; int32_t *sample24; int i, ch, ...
static int ape_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; APEContext *s = avctx->priv_data; uint8_t *sample8; int16_t *sample16; int32_t *sample24; int i, ch, ...
{ "deleted": [ { "line_no": 67, "char_start": 2347, "char_end": 2392, "line": " if (!nblocks || nblocks > INT_MAX) {\n" }, { "line_no": 93, "char_start": 3163, "char_end": 3220, "line": " av_fast_malloc(&s->decoded_buffer, &s->decoded_size,\n" ...
{ "deleted": [ { "char_start": 3167, "char_end": 3186, "chars": "av_fast_malloc(&s->" }, { "char_start": 3200, "char_end": 3213, "chars": ", &s->decoded" }, { "char_start": 3218, "char_end": 3231, "chars": ",\n " }, { "c...
github.com/FFmpeg/FFmpeg/commit/ba4beaf6149f7241c8bd85fe853318c2f6837ad0
libavcodec/apedec.c
cwe-125