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
ecall_restore
int ecall_restore(const char *input, uint64_t input_len, char **output, uint64_t *output_len) { if (!asylo::primitives::TrustedPrimitives::IsOutsideEnclave(input, input_len) || !asylo::primitives::TrustedPrimitives::IsOutsideEnclave...
int ecall_restore(const char *input, uint64_t input_len, char **output, uint64_t *output_len) { if (!asylo::primitives::TrustedPrimitives::IsOutsideEnclave(input, input_len) || !asylo::primitives::TrustedPrimitives::IsOutsideEnclave...
{ "deleted": [ { "line_no": 6, "char_start": 322, "char_end": 365, "line": " output_len, sizeof(uint64_t))) {\n" } ], "added": [ { "line_no": 6, "char_start": 322, "char_end": 365, "line": " output_len, sizeof(uint64_t)) ||\n" }, ...
{ "deleted": [], "added": [ { "char_start": 361, "char_end": 509, "chars": " ||\n !asylo::primitives::TrustedPrimitives::IsOutsideEnclave(output,\n *output_len)" } ] }
github.com/google/asylo/commit/382da2b8b09cbf928668a2445efb778f76bd9c8a
asylo/platform/primitives/sgx/ecalls.cc
cwe-787
handle_PORT
static void handle_PORT(ctrl_t *ctrl, char *str) { int a, b, c, d, e, f; char addr[INET_ADDRSTRLEN]; struct sockaddr_in sin; if (ctrl->data_sd > 0) { uev_io_stop(&ctrl->data_watcher); close(ctrl->data_sd); ctrl->data_sd = -1; } /* Convert PORT command's argument to IP address + port */ sscanf(str, "%d,%d...
static void handle_PORT(ctrl_t *ctrl, char *str) { int a, b, c, d, e, f; char addr[INET_ADDRSTRLEN]; struct sockaddr_in sin; if (ctrl->data_sd > 0) { uev_io_stop(&ctrl->data_watcher); close(ctrl->data_sd); ctrl->data_sd = -1; } /* Convert PORT command's argument to IP address + port */ sscanf(str, "%d,%d...
{ "deleted": [ { "line_no": 15, "char_start": 360, "char_end": 403, "line": "\tsprintf(addr, \"%d.%d.%d.%d\", a, b, c, d);\n" } ], "added": [ { "line_no": 15, "char_start": 360, "char_end": 418, "line": "\tsnprintf(addr, sizeof(addr), \"%d.%d.%d.%d\", a,...
{ "deleted": [], "added": [ { "char_start": 362, "char_end": 363, "chars": "n" }, { "char_start": 374, "char_end": 388, "chars": ", sizeof(addr)" } ] }
github.com/troglobit/uftpd/commit/0fb2c031ce0ace07cc19cd2cb2143c4b5a63c9dd
src/ftpcmd.c
cwe-787
rom_copy
int rom_copy(uint8_t *dest, hwaddr addr, size_t size) { hwaddr end = addr + size; uint8_t *s, *d = dest; size_t l = 0; Rom *rom; QTAILQ_FOREACH(rom, &roms, next) { if (rom->fw_file) { continue; } if (rom->mr) { continue; } if (rom->add...
int rom_copy(uint8_t *dest, hwaddr addr, size_t size) { hwaddr end = addr + size; uint8_t *s, *d = dest; size_t l = 0; Rom *rom; QTAILQ_FOREACH(rom, &roms, next) { if (rom->fw_file) { continue; } if (rom->mr) { continue; } if (rom->add...
{ "deleted": [ { "line_no": 18, "char_start": 379, "char_end": 410, "line": " if (rom->addr > end) {\n" } ], "added": [ { "line_no": 18, "char_start": 379, "char_end": 430, "line": " if (rom->addr > end || rom->addr < addr) {\n" } ] }
{ "deleted": [], "added": [ { "char_start": 406, "char_end": 426, "chars": " || rom->addr < addr" } ] }
github.com/qemu/qemu/commit/4f1c6cb2f9afafda05eab150fd2bd284edce6676
hw/core/loader.c
cwe-787
NeXTDecode
NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) { static const char module[] = "NeXTDecode"; unsigned char *bp, *op; tmsize_t cc; uint8* row; tmsize_t scanline, n; (void) s; /* * Each scanline is assumed to start off as all * white (we assume a PhotometricInterpretation * of ``min-is-black''). ...
NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) { static const char module[] = "NeXTDecode"; unsigned char *bp, *op; tmsize_t cc; uint8* row; tmsize_t scanline, n; (void) s; /* * Each scanline is assumed to start off as all * white (we assume a PhotometricInterpretation * of ``min-is-black''). ...
{ "deleted": [ { "line_no": 77, "char_start": 1882, "char_end": 1926, "line": "\t\t\t\twhile (n-- > 0 && npixels < imagewidth)\n" } ], "added": [ { "line_no": 61, "char_start": 1450, "char_end": 1486, "line": " tmsize_t op_offset = 0;\n" }...
{ "deleted": [], "added": [ { "char_start": 1450, "char_end": 1486, "chars": " tmsize_t op_offset = 0;\n" }, { "char_start": 1960, "char_end": 1984, "chars": " && op_offset < scanline" }, { "char_start": 2053, "char_end": 2290, "ch...
github.com/vadz/libtiff/commit/b18012dae552f85dcc5c57d3bf4e997a15b1cc1c
libtiff/tif_next.c
cwe-787
TiledInputFile::rawTileData
TiledInputFile::rawTileData (int &dx, int &dy, int &lx, int &ly, const char *&pixelData, int &pixelDataSize) { try { Lock lock (*_data->_streamData); if (!isValidTile (dx, dy, lx, ly)) throw IEX_NAMESPACE::ArgExc ("Tried to read a tile ou...
TiledInputFile::rawTileData (int &dx, int &dy, int &lx, int &ly, const char *&pixelData, int &pixelDataSize) { try { Lock lock (*_data->_streamData); if (!isValidTile (dx, dy, lx, ly)) throw IEX_NAMESPACE::ArgExc ("Tried to read a tile ou...
{ "deleted": [], "added": [ { "line_no": 38, "char_start": 1183, "char_end": 1196, "line": " else\n" }, { "line_no": 39, "char_start": 1196, "char_end": 1206, "line": " {\n" }, { "line_no": 40, "char_start": 1206, "c...
{ "deleted": [], "added": [ { "char_start": 1191, "char_end": 1384, "chars": "else\n {\n if(!isValidTile (dx, dy, lx, ly) )\n {\n throw IEX_NAMESPACE::IoExc (\"rawTileData read an invalid tile\");\n }\n }\n " } ] }
github.com/AcademySoftwareFoundation/openexr/commit/6bb36714528a9563dd3b92720c5063a1284b86f8
OpenEXR/IlmImf/ImfTiledInputFile.cpp
cwe-787
tcos_decipher
static int tcos_decipher(sc_card_t *card, const u8 * crgram, size_t crgram_len, u8 * out, size_t outlen) { sc_context_t *ctx; sc_apdu_t apdu; u8 rbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; tcos_data *data; int tcos3, r; assert(card != NULL && crgram != NULL && out != NULL); ctx = card->ctx...
static int tcos_decipher(sc_card_t *card, const u8 * crgram, size_t crgram_len, u8 * out, size_t outlen) { sc_context_t *ctx; sc_apdu_t apdu; u8 rbuf[SC_MAX_APDU_BUFFER_SIZE]; u8 sbuf[SC_MAX_APDU_BUFFER_SIZE]; tcos_data *data; int tcos3, r; assert(card != NULL && crgram != NULL && out != NULL); ctx = card->ctx...
{ "deleted": [], "added": [ { "line_no": 28, "char_start": 852, "char_end": 887, "line": "\tif (sizeof sbuf - 1 < crgram_len)\n" }, { "line_no": 29, "char_start": 887, "char_end": 924, "line": "\t\treturn SC_ERROR_INVALID_ARGUMENTS;\n" } ] }
{ "deleted": [], "added": [ { "char_start": 853, "char_end": 925, "chars": "if (sizeof sbuf - 1 < crgram_len)\n\t\treturn SC_ERROR_INVALID_ARGUMENTS;\n\t" } ] }
github.com/OpenSC/OpenSC/commit/9d294de90d1cc66956389856e60b6944b27b4817
src/libopensc/card-tcos.c
cwe-787
decode_zbuf
static int decode_zbuf(AVBPrint *bp, const uint8_t *data, const uint8_t *data_end) { z_stream zstream; unsigned char *buf; unsigned buf_size; int ret; zstream.zalloc = ff_png_zalloc; zstream.zfree = ff_png_zfree; zstream.opaque = NULL; if (inflateInit(&zstream) !...
static int decode_zbuf(AVBPrint *bp, const uint8_t *data, const uint8_t *data_end) { z_stream zstream; unsigned char *buf; unsigned buf_size; int ret; zstream.zalloc = ff_png_zalloc; zstream.zfree = ff_png_zfree; zstream.opaque = NULL; if (inflateInit(&zstream) !...
{ "deleted": [ { "line_no": 19, "char_start": 514, "char_end": 568, "line": " av_bprint_get_buffer(bp, 1, &buf, &buf_size);\n" }, { "line_no": 20, "char_start": 568, "char_end": 593, "line": " if (!buf_size) {\n" }, { "line_no": 2...
{ "deleted": [ { "char_start": 547, "char_end": 548, "chars": "1" }, { "char_start": 580, "char_end": 581, "chars": "!" } ], "added": [ { "char_start": 547, "char_end": 548, "chars": "2" }, { "char_start": 588, "char_end...
github.com/FFmpeg/FFmpeg/commit/e371f031b942d73e02c090170975561fabd5c264
libavcodec/pngdec.c
cwe-787
MultiPartInputFile::Data::chunkOffsetReconstruction
MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, const vector<InputPartData*>& parts) { // // Reconstruct broken chunk offset tables. Stop once we received any exception. // Int64 position = is.tellg(); // // check we understand all the part...
MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, const vector<InputPartData*>& parts) { // // Reconstruct broken chunk offset tables. Stop once we received any exception. // Int64 position = is.tellg(); // // check we understand all the part...
{ "deleted": [ { "line_no": 103, "char_start": 3326, "char_end": 3401, "line": " if(partNumber<0 || partNumber> static_cast<int>(parts.size()))\n" } ], "added": [ { "line_no": 103, "char_start": 3326, "char_end": 3402, "line": " if(...
{ "deleted": [], "added": [ { "char_start": 3368, "char_end": 3369, "chars": "=" } ] }
github.com/AcademySoftwareFoundation/openexr/commit/8b5370c688a7362673c3a5256d93695617a4cd9a
OpenEXR/IlmImf/ImfMultiPartInputFile.cpp
cwe-787
make_canonical
make_canonical(struct ly_ctx *ctx, int type, const char **value, void *data1, void *data2) { const uint16_t buf_len = 511; char buf[buf_len + 1]; struct lys_type_bit **bits = NULL; struct lyxp_expr *exp; const char *module_name, *cur_expr, *end; int i, j, count; int64_t num; uint64_t unu...
make_canonical(struct ly_ctx *ctx, int type, const char **value, void *data1, void *data2) { const uint16_t buf_len = 511; char buf[buf_len + 1]; struct lys_type_bit **bits = NULL; struct lyxp_expr *exp; const char *module_name, *cur_expr, *end; int i, j, count; int64_t num; uint64_t unu...
{ "deleted": [], "added": [ { "line_no": 40, "char_start": 1335, "char_end": 1440, "line": " LY_CHECK_ERR_RETURN(strlen(module_name) + 1 + strlen(*value) > buf_len, LOGBUF(*value), -1);\n" }, { "line_no": 43, "char_start": 1513, "char_end": 1592, ...
{ "deleted": [], "added": [ { "char_start": 1347, "char_end": 1452, "chars": "LY_CHECK_ERR_RETURN(strlen(module_name) + 1 + strlen(*value) > buf_len, LOGBUF(*value), -1);\n " }, { "char_start": 1512, "char_end": 1591, "chars": "\n LY_CHECK_ERR_RE...
github.com/CESNET/libyang/commit/6980afae2ff9fcd6d67508b0a3f694d75fd059d6
src/parser.c
cwe-787
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { EXRContext *s = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *picture = data; uint8_t *ptr; int i, y, ret, ymax; int planes; int out_line_size; int nb_bl...
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { EXRContext *s = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *picture = data; uint8_t *ptr; int i, y, ret, ymax; int planes; int out_line_size; int nb_bl...
{ "deleted": [ { "line_no": 146, "char_start": 4801, "char_end": 4841, "line": " for (y = 0; y < s->ymin; y++) {\n" } ], "added": [ { "line_no": 146, "char_start": 4801, "char_end": 4854, "line": " for (y = 0; y < FFMIN(s->ymin, s->h); y++)...
{ "deleted": [], "added": [ { "char_start": 4825, "char_end": 4831, "chars": "FFMIN(" }, { "char_start": 4838, "char_end": 4845, "chars": ", s->h)" } ] }
github.com/FFmpeg/FFmpeg/commit/3e5959b3457f7f1856d997261e6ac672bba49e8b
libavcodec/exr.c
cwe-787
add_password
static void add_password(AUTH_HDR *request, unsigned char type, CONST char *password, char *secret) { MD5_CTX md5_secret, my_md5; unsigned char misc[AUTH_VECTOR_LEN]; int i; int length = strlen(password); unsigned char hashed[256 + AUTH_PASS_LEN]; /* can't be longer than this */ unsigned char *vector; attribute_...
static void add_password(AUTH_HDR *request, unsigned char type, CONST char *password, char *secret) { MD5_CTX md5_secret, my_md5; unsigned char misc[AUTH_VECTOR_LEN]; int i; int length = strlen(password); unsigned char hashed[256 + AUTH_PASS_LEN]; /* can't be longer than this */ unsigned char *vector; attribute_...
{ "deleted": [ { "line_no": 23, "char_start": 698, "char_end": 743, "line": "\tmemcpy(hashed, password, strlen(password));\n" } ], "added": [ { "line_no": 23, "char_start": 698, "char_end": 733, "line": "\tmemcpy(hashed, password, length);\n" } ] }
{ "deleted": [ { "char_start": 724, "char_end": 727, "chars": "str" }, { "char_start": 730, "char_end": 740, "chars": "(password)" } ], "added": [ { "char_start": 727, "char_end": 730, "chars": "gth" } ] }
github.com/FreeRADIUS/pam_radius/commit/01173ec2426627dbb1e0d96c06c3ffa0b14d36d0
src/pam_radius_auth.c
cwe-787
unicode_unfold_key
unicode_unfold_key(OnigCodePoint code) { static const struct ByUnfoldKey wordlist[] = { {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, ...
unicode_unfold_key(OnigCodePoint code) { static const struct ByUnfoldKey wordlist[] = { {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, ...
{ "deleted": [ { "line_no": 2780, "char_start": 39629, "char_end": 39658, "line": " if (code == gcode)\n" } ], "added": [ { "line_no": 2780, "char_start": 39629, "char_end": 39686, "line": " if (code == gcode && wordlist[key].index >= 0...
{ "deleted": [], "added": [ { "char_start": 39656, "char_end": 39684, "chars": " && wordlist[key].index >= 0" } ] }
github.com/kkos/oniguruma/commit/166a6c3999bf06b4de0ab4ce6b088a468cc4029f
src/unicode_unfold_key.c
cwe-787
PHP_FUNCTION
PHP_FUNCTION(imagegammacorrect) { zval *IM; gdImagePtr im; int i; double input, output; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) { return; } ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); if (gdImageTrueColor(im)) { int x, y, c; for (...
PHP_FUNCTION(imagegammacorrect) { zval *IM; gdImagePtr im; int i; double input, output; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) { return; } if ( input <= 0.0 || output <= 0.0 ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positi...
{ "deleted": [], "added": [ { "line_no": 12, "char_start": 204, "char_end": 244, "line": "\tif ( input <= 0.0 || output <= 0.0 ) {\n" }, { "line_no": 13, "char_start": 244, "char_end": 326, "line": "\t\tphp_error_docref(NULL TSRMLS_CC, E_WARNING, \"Gamma v...
{ "deleted": [], "added": [ { "char_start": 205, "char_end": 347, "chars": "if ( input <= 0.0 || output <= 0.0 ) {\n\t\tphp_error_docref(NULL TSRMLS_CC, E_WARNING, \"Gamma values should be positive\");\n\t\tRETURN_FALSE;\n\t}\n\n\t" } ] }
github.com/php/php-src/commit/1bd103df00f49cf4d4ade2cfe3f456ac058a4eae
ext/gd/gd.c
cwe-787
rfbProcessFileTransferReadBuffer
char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length) { char *buffer=NULL; int n=0; FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, NULL); /* rfbLog("rfbProcessFileTransferReadBuffer(%dlen)\n", length); */ if (length>0) { buffer=malloc((uint64_t)length+1); ...
char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length) { char *buffer=NULL; int n=0; FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, NULL); /* We later alloc length+1, which might wrap around on 32-bit systems if length equals 0XFFFFFFFF, i.e. SIZE_MAX for 32-bit systems...
{ "deleted": [ { "line_no": 8, "char_start": 177, "char_end": 242, "line": " rfbLog(\"rfbProcessFileTransferReadBuffer(%dlen)\\n\", length);\n" }, { "line_no": 11, "char_start": 269, "char_end": 312, "line": " buffer=malloc((uint64_t)length+1);\n" ...
{ "deleted": [ { "char_start": 184, "char_end": 185, "chars": "L" }, { "char_start": 221, "char_end": 224, "chars": "(%d" }, { "char_start": 227, "char_end": 229, "chars": ")\\" }, { "char_start": 246, "char_end": 248, ...
github.com/LibVNC/libvncserver/commit/15bb719c03cc70f14c36a843dcb16ed69b405707
libvncserver/rfbserver.c
cwe-787
track_header
static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *buf, int size) { int i, j, ret; int64_t off; int val_1; int num_video; AVIOContext pb0, *pb = &pb0; ffio_init_context(pb, buf, size, 0, NULL, NULL, NULL, NULL); ffio_read_varlen(pb); // track_header_len avi...
static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *buf, int size) { int i, j, ret; int64_t off; int val_1; int num_video; AVIOContext pb0, *pb = &pb0; ffio_init_context(pb, buf, size, 0, NULL, NULL, NULL, NULL); ffio_read_varlen(pb); // track_header_len avi...
{ "deleted": [ { "line_no": 104, "char_start": 2925, "char_end": 2954, "line": " int xd_size = 0;\n" }, { "line_no": 118, "char_start": 3441, "char_end": 3473, "line": " xd_size += len;\n" }, { "line_no": 121, "c...
{ "deleted": [ { "char_start": 2951, "char_end": 2952, "chars": "0" }, { "char_start": 3539, "char_end": 3544, "chars": "64 + " }, { "char_start": 3551, "char_end": 3567, "chars": " + xd_size / 255" }, { "char_start": 3826, ...
github.com/FFmpeg/FFmpeg/commit/27a99e2c7d450fef15594671eef4465c8a166bd7
libavformat/vividas.c
cwe-787
yaffsfs_istat
yaffsfs_istat(TSK_FS_INFO *fs, TSK_FS_ISTAT_FLAG_ENUM flags, FILE * hFile, TSK_INUM_T inum, TSK_DADDR_T numblock, int32_t sec_skew) { TSK_FS_META *fs_meta; TSK_FS_FILE *fs_file; YAFFSFS_INFO *yfs = (YAFFSFS_INFO *)fs; char ls[12]; YAFFSFS_PRINT_ADDR print; char timeBuf[32]; YaffsCach...
yaffsfs_istat(TSK_FS_INFO *fs, TSK_FS_ISTAT_FLAG_ENUM flags, FILE * hFile, TSK_INUM_T inum, TSK_DADDR_T numblock, int32_t sec_skew) { TSK_FS_META *fs_meta; TSK_FS_FILE *fs_file; YAFFSFS_INFO *yfs = (YAFFSFS_INFO *)fs; char ls[12]; YAFFSFS_PRINT_ADDR print; char timeBuf[128]; YaffsCac...
{ "deleted": [ { "line_no": 9, "char_start": 285, "char_end": 307, "line": " char timeBuf[32];\n" } ], "added": [ { "line_no": 9, "char_start": 285, "char_end": 308, "line": " char timeBuf[128];\n" } ] }
{ "deleted": [ { "char_start": 302, "char_end": 303, "chars": "3" } ], "added": [ { "char_start": 302, "char_end": 303, "chars": "1" }, { "char_start": 304, "char_end": 305, "chars": "8" } ] }
github.com/sleuthkit/sleuthkit/commit/459ae818fc8dae717549810150de4d191ce158f1
tsk/fs/yaffs.cpp
cwe-787
InsertRow
static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { ExceptionInfo *exception; int bit; ssize_t x; register PixelPacket *q; IndexPacket index; register IndexPacket *indexes; exception=(&image->exception); switch (bpp) { case 1: /* Convert bitma...
static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { ExceptionInfo *exception; int bit; ssize_t x; register PixelPacket *q; IndexPacket index; register IndexPacket *indexes; exception=(&image->exception); switch (bpp) { case 1: /* Convert bitma...
{ "deleted": [ { "line_no": 62, "char_start": 1585, "char_end": 1643, "line": " for (x=0; x < ((ssize_t) image->columns-1); x+=2)\n" } ], "added": [ { "line_no": 62, "char_start": 1585, "char_end": 1643, "line": " for (x=0; x < ((ssize_t) i...
{ "deleted": [ { "char_start": 1640, "char_end": 1641, "chars": "2" } ], "added": [ { "char_start": 1640, "char_end": 1641, "chars": "4" } ] }
github.com/ImageMagick/ImageMagick/commit/b6ae2f9e0ab13343c0281732d479757a8e8979c7
coders/wpg.c
cwe-787
rds_rdma_extra_size
int rds_rdma_extra_size(struct rds_rdma_args *args) { struct rds_iovec vec; struct rds_iovec __user *local_vec; int tot_pages = 0; unsigned int nr_pages; unsigned int i; local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr; /* figure out the number of pages in the vector */ for (i = 0; ...
int rds_rdma_extra_size(struct rds_rdma_args *args) { struct rds_iovec vec; struct rds_iovec __user *local_vec; int tot_pages = 0; unsigned int nr_pages; unsigned int i; local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr; if (args->nr_local == 0) return -EINVAL; /* figure out the n...
{ "deleted": [], "added": [ { "line_no": 11, "char_start": 255, "char_end": 281, "line": "\tif (args->nr_local == 0)\n" }, { "line_no": 12, "char_start": 281, "char_end": 299, "line": "\t\treturn -EINVAL;\n" }, { "line_no": 13, "char_st...
{ "deleted": [], "added": [ { "char_start": 256, "char_end": 301, "chars": "if (args->nr_local == 0)\n\t\treturn -EINVAL;\n\n\t" } ] }
github.com/torvalds/linux/commit/c095508770aebf1b9218e77026e48345d719b17c
net/rds/rdma.c
cwe-787
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; AVFrame *frame = data; uint32_t *palette; int bits_per_plane, bpp, etype, esize, npal, pos_after_pal; int i, x, y, plane, tm...
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; AVFrame *frame = data; uint32_t *palette; int bits_per_plane, bpp, etype, esize, npal, pos_after_pal; int i, x, y, plane, tm...
{ "deleted": [ { "line_no": 46, "char_start": 1512, "char_end": 1578, "line": " if (s->width != avctx->width && s->height != avctx->height) {\n" } ], "added": [ { "line_no": 46, "char_start": 1512, "char_end": 1578, "line": " if (s->width != avctx-...
{ "deleted": [ { "char_start": 1545, "char_end": 1547, "chars": "&&" } ], "added": [ { "char_start": 1545, "char_end": 1547, "chars": "||" } ] }
github.com/FFmpeg/FFmpeg/commit/8c2ea3030af7b40a3c4275696fb5c76cdb80950a
libavcodec/pictordec.c
cwe-787
concat_opt_exact_str
concat_opt_exact_str(OptStr* to, UChar* s, UChar* end, OnigEncoding enc) { int i, j, len; UChar *p; for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) { len = enclen(enc, p); if (i + len > OPT_EXACT_MAXLEN) break; for (j = 0; j < len && p < end; j++) to->s[i++] = *p++; } to->len =...
concat_opt_exact_str(OptStr* to, UChar* s, UChar* end, OnigEncoding enc) { int i, j, len; UChar *p; for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) { len = enclen(enc, p); if (i + len >= OPT_EXACT_MAXLEN) break; for (j = 0; j < len && p < end; j++) to->s[i++] = *p++; } to->len ...
{ "deleted": [ { "line_no": 8, "char_start": 195, "char_end": 238, "line": " if (i + len > OPT_EXACT_MAXLEN) break;\n" } ], "added": [ { "line_no": 8, "char_start": 195, "char_end": 239, "line": " if (i + len >= OPT_EXACT_MAXLEN) break;\n" } ...
{ "deleted": [], "added": [ { "char_start": 212, "char_end": 213, "chars": "=" } ] }
github.com/kkos/oniguruma/commit/cbe9f8bd9cfc6c3c87a60fbae58fa1a85db59df0
src/regcomp.c
cwe-787