Buggy Versions | Human Patch | Original GP-AE Patch | Anti-delete Control Statement |
Anti-delete Set-Before-If |
Anti-delete CFG exit node |
Anti-append Early Exit |
Anti-delete Single-statement CFG |
Delete if-branch | Delete while-loop | Delete temp-condition | Delete-exit | Delete return | Delete goto | Delete error code | Insert early return | Insert early exit | Insert goto | Delete only statement within if |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
php-bug-307931-307934 | Add a line: SEPARATE_ZVAL(elem); |
Delete if-statement below, human fix is in different function: call_result = call_user_function_ex(NULL, &us->object, &func_name, &retval, 0, NULL, 0, NULL TSRMLS_CC); |
1 | ||||||||||
php-bug-309986-310009 | Add if and else condition: < zval_ptr_dtor(&object); |
Delete a branch: if (PZVAL_IS_REF(object)) |
1 | ||||||||||
php-bug-309111-309159 | Add check: if (pp - s) { |
Add check: if (pp - s) { |
|||||||||||
php-bug-310011-310050 | Add one method call: zval_copy_ctor(tmp); |
Delete: zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); |
|||||||||||
php-bug-307562-307561 | Replace one method call with different method call: < htmlNodeDumpFormatOutput(buf, docp, node, 0, format); > xmlNodeDump(buf, docp, node, 0, format); |
Search ends, no repair | |||||||||||
php-bug-308525-308529 | Move statement from inside method to before method call: > JSON_G(error_code) = PHP_JSON_ERROR_NONE; < JSON_G(error_code) = PHP_JSON_ERROR_NONE; |
Delete JSON_G(error_code) = PHP_JSON_ERROR_NONE; |
1 | ||||||||||
php-bug-307302-307307 | Multiple files change. Refer to http://svn.php.net/viewvc?view=revision&revision=307307 | Delete loop: while (1) { __z = return_value; |
1 | ||||||||||
php-bug-307688-307689 | Patch turn existing statements into loops. Refer to http://svn.php.net/viewvc?view=revision&revision=307689 | Delete the if check that check whether timezone is valid: if (php_date_global_timezone_db) { tmp___1 = (timelib_tzdb const *)php_date_global_timezone_db; |
1 | ||||||||||
php-bug-307914-307915 | Change error message: spprintf(error, 0, "Cannot create phar '%s', file extension (or combination) not recognised or the directory does not exist", fname); |
Delete phar_globals.request_done = 1; |
|||||||||||
php-bug-308262-308315 | Add a condition: 1261c1261,1263 ---
> |
Delete expr_ptr = new_expr; |
|||||||||||
php-bug-308475-308477 | Many file changes. Refer to http://svn.php.net/viewvc?view=revision&revision=308477 | Delete persistent_id = NULL; |
|||||||||||
php-bug-308523-308525 | adding condition check for overflow in two files: if(precision>FORMAT_CONV_MAX_PRECISION) {
|
Delete s = ap_php_conv_10(i_num, (*fmt) == 'u', & |
|||||||||||
php-bug-309487-309491 | Multiple files change. Refer to http://svn.php.net/viewvc?view=revision&revision=309491 | Add goto _L; |
1 | ||||||||||
php-bug-309516-309535 | Replace set with method call in multiple places: > memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
2864,2865d2864
> memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time)); 2912,2913d2911 < dateobj->time->relative.weekday = 0;
|
Delete whole branch by deleting the statement: tmp=zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", & |
1 | ||||||||||
php-bug-309892-309910 | Delete if-block: if (len > s1_len - offset) {
|
Delete if (len >(long )s1_len - offset) { len = (long )s1_len - offset; |
1 | ||||||||||
php-bug-309984-309986 | Missing initialization and increment condition in loop. Refer to http://svn.php.net/viewvc?view=revision&revision=309986 | Delete if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zH", & |
1 | ||||||||||
php-bug-310673-310681 | Missing while loop. Refer to http://svn.php.net/viewvc?view=revision&revision=310681 | Delete: MAKE_STD_ZVAL(context-> |
|||||||||||
php-bug-311164-311141 | Add another condition: < c.flags = CONST_PERSISTENT | CONST_CS; --- |
Delete: if (!(c->flags & CONST_CS)) { /* keep in mind that c->name_len already contains the '\0' */ lowercase_name = estrndup(c-> |
1 | ||||||||||
php-bug-311323-311300 | Modify parameter value: < STD_PHP_INI_ENTRY("pcre.backtrack_limit", "1000000", PHP_INI_ALL, OnUpdateLong, backtrack_limit, zend_pcre_globals, pcre_globals) --- |
Delete the branch: tmp = zend_parse_parameters(ht, "ZZZ|lZ", & regex, & replace, & subject, & limit, & zcount); if (tmp == (int __attribute__((__visibility__("default"))) )-1) { return; } |
1 | ||||||||||
libtiff-bug-5b02179-3dfb33b | Modify method call: <TIFFGetFieldDefaulted(in, TIFFTAG_RESOLUTIONUNIT, &res_unit); > TIFFGetField(in, TIFFTAG_RESOLUTIONUNIT, &res_unit); |
Delete the error branch: if (computeInputPixelOffsets(crop, image, &offsets)) { TIFFError ("getCropOffsets", "Unable to compute crop margins"); return (-1); } |
1 | ||||||||||
libtiff-bug-d13be72c-ccadf48a | Wrong Constant: td->td_nstrips > 1 ~should be~ td->td_nstrips > 2 |
Delete the whole branch: if (isTiled(tif)) { tif->tif_tilesize = TIFFTileSize(tif); if (!tif->tif_tilesize) { TIFFErrorExt(tif->tif_clientdata, module, "%s: cannot handle zero tile size", tif->tif_name); return (0); } |
1 | ||||||||||
libtiff-bug-d39db2b-4cd598c | Wrong return value: < return (status); > return (0); |
Delete return (status); |
1 | ||||||||||
libtiff-bug-01209c9-aaf9eb3 | Missing support for SGILOG encoding. Refer to http://git.ghostscript.com/?p=user/chrisl/libtiff.git;a=commit;h=aaf9eb3 | Delete exit(-1); |
1 | ||||||||||
libtiff-bug-10a4985-5362170 | Lots of changes: Added label done: in multiple places with return values. Refer to http://git.ghostscript.com/?p=user/chrisl/libtiff.git;a=commit;h=5362170 | Delete a loop: for (; optind < argc-1 ; optind++) { char *imageCursor = argv[optind]; in = openSrcImage (&imageCursor); if (in == NULL) return (-3); if (diroff != 0 && !TIFFSetSubDirectory(in, diroff)) { TIFFError(TIFFFileName(in), "Error, setting subdirectory at %#x", diroff); (void) TIFFClose(out); return (1); } |
1 | ||||||||||
libtiff-bug-0661f81-ac6a583 | Removal of check regarding rawcc data: 326,327d325 346c341
> |
Delete if (!(tif->tif_flags&TIFF_BIGTIFF)) { uint32 m; uint32 nextdir; m = (uint32)(tif->tif_diroff); if (tif->tif_flags & TIFF_SWAB) TIFFSwabLong(&m); if (tif->tif_header.classic.tiff_diroff == 0) { /* * First directory, overwrite offset in header. */ tif->tif_header.classic.tiff_diroff = (uint32) tif->tif_diroff; (void) TIFFSeekFile(tif,4, SEEK_SET); if (!WriteOK(tif, &m, 4)) { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing TIFF header"); return (0); } |
1 | ||||||||||
libtiff-bug-0860361d-1ba75257 | Modify check condition: < /* Check for overflow. */
> if (dir->tdir_offset + cc > tif->tif_size) |
Delete all goto bad conditions: /* Check for overflow. */ __repair_del_1009__181: { if (!dir->tdir_count || !w || (tsize_t)dir->tdir_count / w != cc) goto bad; if (!isMapped(tif)) { if (!SeekOK(tif, dir->tdir_offset)) goto bad; if (!ReadOK(tif, cp, cc)) goto bad; } |
1 | 1 | |||||||||
libtiff-bug-0fb6cf7-b4158fa | Implementation of new features.Refer to http://git.ghostscript.com/?p=user/chrisl/libtiff.git;a=commit;h=b4158fa | Delete: if (! tmp___9) { |
1 | ||||||||||
libtiff-bug-3af26048-72391804 | Wrong operand order: if (!dir->tdir_count || !w || (tsize_t)dir->tdir_count / w != cc) ~should be~ if (!dir->tdir_count || !w || cc / w != (tsize_t)dir->tdir_count) |
Delete whole if statement: cc = (tsize_t )(dir->tdir_count * (uint32 )w); if (! dir->tdir_count) { goto bad; } else { if (! w) { goto bad; } else { if ((int )dir->tdir_count / w != cc) { goto bad; } else { } } } |
1 | ||||||||||
libtiff-bug-4a24508-cc79c2b | remove condition of multiple if: 276c276 --- 289d288 < tif->tif_fields = NULL; 347c346 < if (tif->tif_fields && tif->tif_nfields > 0) { --- |
Delete setting of foundfield by changing: < return tif->tif_foundfield = (ret ? *ret : NULL); > return (ret ? *ret : NULL); |
|||||||||||
libtiff-bug-5e6542ee-e779b6cd | Missing a flag:
< tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP|TIFF_POSTENCODE); > tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP|TIFF_POSTENCODE|TIFF_BUF4WRITE); |
Delete all content of a method except for return 1: intTIFFFlushData1(TIFF* tif){ repair_delete:{if (tif->tif_rawcc > 0) { if (!isFillOrder(tif, tif->tif_dir.td_fillorder) && (tif->tif_flags & TIFF_NOBITREV) == 0) TIFFReverseBits((uint8*)tif->tif_rawdata, tif->tif_rawcc); if (!TIFFAppendToStrip(tif, isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip, tif->tif_rawdata, tif->tif_rawcc)) return (0); tif->tif_rawcc = 0; tif->tif_rawcp = tif->tif_rawdata; } return (1);} |
1 | 1 | |||||||||
libtiff-bug-6f9f4d7-73757f3 | Need to modify multiple lines. Refer to http://git.ghostscript.com/?p=user/chrisl/libtiff.git;a=commit;h=73757f3 | Delete setting of foundfield by changing: < return tif->tif_foundfield = (ret ? *ret : NULL); > return (ret ? *ret : NULL); |
|||||||||||
libtiff-bug-829d8c4-036d7bb | Missing the check and set when a variable is < 1: if (test > image->width - 1) < crop->regionlist[i].x2 = image->width - 1; if (test < 1 ) crop->regionlist[i].x2 = 0; |
Delete the branch tmp___0 = writeCroppedImage(in, *out, image, dump, crop->combined_width, crop->combined_length, crop_buff, (int )*page, (int )total_pages); if (tmp___0) { TIFFError("writeRegions", "Unable to write new image"); return (-1); } else |
1 | ||||||||||
libtiff-bug-8f6338a-4c5a9ec | Add new functionality for bpp: > case '4': /* it's a PBM file */ |
Delete exit(-2); in static void BadPPM(char *file ){ { fprintf((FILE */* __restrict */)stderr, (char const */* __restrict */)"%s: Not a PPM file.\n", file); __repair_del_588__43: /* CIL Label */ { exit(-2) }} |
1 | ||||||||||
libtiff-bug-90d136e4-4c66680f | Changing implementation from sprintf to snprintf. Lots of changes. Refer to http://git.ghostscript.com/?p=user/chrisl/libtiff.git;a=commit;h=4c66680f | Delete return (ret); | 1 | ||||||||||
libtiff-bug-ed4969a-8a184dc | Wrong type for diroff:uint32 diroff[1]; ~should be~ toff_t diroff[1]; | Delete the if() return 2 block: in = TIFFOpen(argv[optind], "r"); if( in == NULL ) return 2; |
1 | ||||||||||
libtiff-bug-ee2ce5b7-b5691a5a | Add goto success | Delete return (ret); | 1 | ||||||||||
python-bug-69783-69784 | if (y < 1000) { |
Delete if (! p) { #line 925 tmp___0 = 1; } else { #line 925 if (! *p) { #line 925 tmp___0 = 1; } else { #line 925 tmp___0 = 0; } } |
|||||||||||
gzip-bug-3fe0caeada6aa3-39a362ae9d9b00 | need to modify multiple lines: 338c338 --- 341c341 --- 344a345,346 |
Delete c[i] += y; |
|||||||||||
wireshark-bug-37172-37171 | < #define DEBUG_DUMPCAP --- |
Delete fprintf((FILE */* __restrict */)stderr, (char const */* __restrict */)"%s", msg); |
1 | ||||||||||
wireshark-bug-37172-37173 | < #define DEBUG_DUMPCAP --- |
Delete fprintf((FILE */* __restrict */)stderr, (char const */* __restrict */)"%s", msg); |
1 | ||||||||||
wireshark-bug-37284-37285 | < #define DEBUG_DUMPCAP --- |
Delete fprintf((FILE */* __restrict */)stderr, (char const */* __restrict */)"%s", msg); |
1 | ||||||||||
lighttpd-bug-1806-1807 | Add multiple cases. Refer to http://people.csail.mit.edu/zichaoqi/PatchAnalysis/lighttpd/lighttpd-bug-1806-1807/ | Delete if (!con->conditional_is_valid[dc->comp]) { if (con->conf.log_condition_handling) { TRACE("cond[%d] is valid: %d", dc->comp, con->conditional_is_valid[dc->comp]); } return COND_RESULT_UNSET; } |
1 | ||||||||||
lighttpd-bug-2330-2331 | Add multiple lines. Refer to http://people.csail.mit.edu/zichaoqi/PatchAnalysis/lighttpd/lighttpd-bug-2330-2331/ | Delete srv_encodings |= 1 << 4; |
|||||||||||
lighttpd-bug-2661-2662 | Add: if (str->used == 0) return; |
Delete entire for-loop: for (unsigned int i = 0; i < str->used - 1; i++) { if (str->ptr[i] >= ' ' && str->ptr[i] <= '~') { /* printable chars */ buffer_append_string_len(dest, &str->ptr[i], 1); } else switch (str->ptr[i]) { case '"': BUFFER_APPEND_STRING_CONST(dest, "\\\""); break; case '\\': BUFFER_APPEND_STRING_CONST(dest, "\\\\"); break; case '\b': BUFFER_APPEND_STRING_CONST(dest, "\\b"); break; case '\n': BUFFER_APPEND_STRING_CONST(dest, "\\n"); break; case '\r': BUFFER_APPEND_STRING_CONST(dest, "\\r"); break; case '\t': BUFFER_APPEND_STRING_CONST(dest, "\\t"); break; case '\v': BUFFER_APPEND_STRING_CONST(dest, "\\v"); break; default: { /* non printable char => \xHH */ char hh[5] = {'\\','x',0,0,0}; char h = str->ptr[i] / 16; hh[2] = (h > 9) ? (h - 10 + 'A') : (h + '0'); h = str->ptr[i] % 16; hh[3] = (h > 9) ? (h - 10 + 'A') : (h + '0'); buffer_append_string_len(dest, &hh[0], 4); } break; } } |
1 | ||||||||||
Total | 14 | 3 | 2 | 2 | 4 | 1 | 7 | 0 | 0 | 1 | 2 |