Git Product home page Git Product logo

fixmorph's Introduction

FixMorph

Docker Pulls DOI

FixMorph is a tool to automatically morph fixes (patches) from one program version to a different yet syntactically similar program version. To support users with different feature/stability requirements, many software systems (e.g. Linux Kernel) actively maintain multiple versions. When adding features and fixing bugs in the mainline version by introducing patches, the patches need to be backported to old stable versions. Patch backporting is a tedious and error-prone process for developers. FixMorph can help automate this process.

FixMorph is a morphing tool for C source codes. FixMorph is:

  • Scalable: FixMorph can backport bug-fixing patches in large/complex source bases such as the Linux Kernel
  • Compilable: The morphed patch is verified to be free of syntax errors
  • Extensible: FixMorph is designed so that it can be easily extended to support advanced transformations

Note: See the Experiment Guide to replicate the experiments for ISSTA'21.

Building

Dependencies

Build using Dockerfile

Building FixMorph is easy with the provided Dockerfile, which has all the build dependencies and libraries required. We provide two Dockerfiles

  • Dockerfile: This will build the environment necessary to run the stand-alone tool
  • experiments/ISSTA21/Dockerfile: This environment includes all necessary dependencies to reproduce the experiments

You can use the following command to build fixmorph image:

cd FixMorph
docker build -t rshariffdeen/fixmorph .
# start docker
docker run -it rshariffdeen/fixmorph /bin/bash              

The experiments/ISSTA21/Dockerfile depends on the fixmorph image. The instructions to build and execute experiments/ISSTA21/Dockerfile can be found here.

Example Usage

FixMorph requires a configuration file that specifies the source code path, where path_a and path_b represent the paths of the mainline version before and after introducing the patch, while path_c represents the path of the version to which the patch is backported. Following is an example configuration file in the provided test cases.

path_a:/fixmorph/tests/update/assignment/PA
path_b:/fixmorph/tests/update/assignment/PB
path_c:/fixmorph/tests/update/assignment/PC
config_command_a:skip
config_command_c:skip

Once a configuration file has been set up as above, the following command will run FixMorph to adapt the patch from the mainline version to the target version.

fixmorph --conf=/path/to/conf/file

The backported will be generated at ./tests/update/assignment/PC-patch directory. In this example, the original patch from mainline version PA-PB:

18c18
< min = rank;
---
> min = book_id;
21,22c21,22
<   if (list[j].rank < min) {
< min = list[j].rank;
---
>   if (list[j].book_id < min) {
> min = list[j].book_id;

The backported patch to target version PC is as follows:

18c18
< minimum = rank;
---
> minimum = author_id;
21,22c21,22
<   if (author_list[b].rank < minimum) {
< minimum = author_list[b].rank;
---
>   if (author_list[b].user_id < minimum) {
> minimum = author_list[b].user_id;

If you prefer changes to display in unified diff format, use the additional flag "--format=unified".

--- /opt/fixmorph/tests/update/assignment/PC/selection-sort.c	
+++ /opt/fixmorph/tests/update/assignment/PC-patch/selection-sort.c	
@@ -15,11 +15,11 @@
 while (a < length) {
    author_id = author_list[a].user_id;
    rank = author_list[a].rank;
-   minimum = rank;
+   minimum = author_id;
    position = a;
    for (b = a + 1; b < length; b++) {
-      if (author_list[b].rank < minimum) {
-         minimum = author_list[b].rank;
+      if (author_list[b].user_id < minimum) {
+         minimum = author_list[b].user_id;
    position = b;
    }
 }

Many such examples are included in the 'tests' directory, simply replace the configuration file path and run the same command as above.

Limitations

  • Current implementation is based on LLVM/Clang, and thus inherits the limitations of that framework.
  • Specific build configurations such as compiler directives / runtime configurations need to be provided as input to obtain the correct AST, an incomplete AST could result in an incomplete/incorrect transformation.
  • FixMorph cannot simultaneously edit changes to source locations with contradicting compiler directives (#ifdefs)

Bugs

FixMorph should be considered alpha-quality software. Bugs can be reported here:

https://github.com/rshariffdeen/FixMorph/issues

Documentation

Contributions

We welcome contributions to improve this work, see details

Developers

  • Ridwan Shariffdeen
  • Gao Xiang

Publication

Automated Patch Backporting in Linux (Experience Paper)
Ridwan Shariffdeen, Xiang Gao, Gregory J. Duck, Shin Hwei Tan, Julia Lawall, Abhik Roychoudhury
International Symposium on Software Testing and Analysis (ISSTA), 2021

Acknowledgements

This work was partially supported by the National Satellite of Excellence in Trustworthy Software Systems, funded by National Research Foundation (NRF) Singapore.

License

This project is licensed under the MIT License - see the LICENSE file for details

Citation

If you use Cerberus in your research work, we would highly appreciate it if you cited the following paper:

@inproceedings{fixmorph,
author = {Shariffdeen, Ridwan and Gao, Xiang and Duck, Gregory J. and Tan, Shin Hwei and Lawall, Julia and Roychoudhury, Abhik},
title = {Automated patch backporting in Linux (experience paper)},
year = {2021},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3460319.3464821},
doi = {10.1145/3460319.3464821},
booktitle = {Proceedings of the 30th ACM SIGSOFT International Symposium on Software Testing and Analysis},
pages = {633–645},
numpages = {13},
keywords = {Linux Kernel, Patch Backporting, Program Transformation},
location = {Virtual, Denmark},
series = {ISSTA 2021}
}

fixmorph's People

Contributors

elfring avatar julialawall avatar lin88xu avatar pedrobw avatar rshariffdeen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fixmorph's Issues

Dockerize Artifacts

Hi all,

It seems like FixMorph relies on a few compiled binaries which are currently being stored in this repository as artifacts.
I'd like to go through and Dockerize these dependencies so that they can be updated to support multiple architectures and fix existing CVEs.

The only problem I'm facing is that I don't know what the exact upstream sources for each binary are.
After a bit of research I was able to somewhat track down their upstreams, but had some confusion on the difference between the cvecgen and cvecgen-fail binaries.

Could someone from this project please help me identify exactly where each of these come from?

The artifacts in question are:

  • third-party/Deckard/cvecgen
  • third-party/Deckard/cvecgen-fail
  • third-party/bin/crochet-patch

`generator.generate_slice_for_vector` function only handles .c files.

Hello,

I recently ran into an error generating a patch for a repository where changes were made to both header and implementation files. It seems like the error is rooted in the implementation of the generate_slice_for_vector function in app/tools/generator.py, where it expects the vector path to contain a .c file:

def generate_slice_for_vector(vector_path, use_macro=False):
    # ...
    source_file, segment = vector_path.split(".c.")
    # ...

However, this breaks when FixMorph passes it a vectorfile that was constructed from a header file: /dirs/iotop-c-a/src/iotop.h.func_humanize_val.vec:

                        [ERROR] Crash during finding segment clones in target, after 0.100 minutes.
                        [ERROR] Transformation Failed
                        [ERROR] not enough values to unpack (expected 2, got 1)
                        [ERROR] Unexpected error during finding segment clones in target.
                        [ERROR] Runtime Error
                        [ERROR] Error. Exiting...

can't find SYDIT code for c

You mentioned in your paper that you have refactored SYDIT in c programming language, but I can't find the corresponding code, can you tell me :(, thank you very much

Unexpected error during evaluating code slices: 'double'

Hi all, I have yet another issue that I ran into when attempting to use the tool.

This issue occurred when attempting to work with the iotop-c project.

Here's the error output that I received from FixMorph:

                        [command]      crochet-diff -ast-dump-json
                                       /dirs/iotop-c-c/src/views.c 2> /
                                       FixMorph/output/test/errors_AST_
                                       dump > /dirs/iotop-
                                       c-c/src/views.c.AST
                        [debug]      return code:0
                        Delete DeclRefExpr(699)

                        Delete MemberExpr(698)

                        Delete MemberExpr(697)

                        Delete TypeLoc(696)

                        Delete CStyleCastExpr(695)

                        Delete DeclRefExpr(694)

                        Delete UnaryOperator(693)

                        Delete CompoundAssignOperator(692)

                        Delete CompoundStmt(682)

                        Delete WhileStmt(671)

                        Replace BinaryOperator(672) with ForStmt(671)

                                analysing for missing function calls
                                analysing for missing macros
                        [command]      cat /dirs/iotop-c-c-
                                       patch//src/views.c | grep
                                       '#ifdef' > /FixMorph/output/test
                                       /tmp/result
                        [command]      clang -E -dD -dM /dirs/iotop-
                                       c-c-patch//src/views.c >
                                       /FixMorph/output/test/tmp/macro-
                                       def
                                analysing for missing variables
                                analysing for missing data-types
                        [ERROR] Crash during evaluate code slices, after 0.009 minutes.
                        [ERROR] Transformation Failed
                        [ERROR] 'double'
                        [ERROR] Unexpected error during evaluate code slices.
                        [ERROR] Runtime Error
                        [ERROR] Error. Exiting...

Here is the patch being backported:

diff --git a/src/views.c b/src/views.c
index 78bc076..8acf39f 100644
--- a/src/views.c
+++ b/src/views.c
@@ -221,12 +221,15 @@ inline void humanize_val(double *value,char *str,int allow_accum) {
 		p=1;
 		*value/=(double)config.f.base;
 	} else {
-		while (*value>config.f.base*config.f.threshold) {
-			if (p+1<strlen(u)) {
-				*value/=(double)config.f.base;
-				p++;
-			} else
-				break;
+		for (; *value > config.f.base * config.f.threshold;) {
+		    double baseAsDouble = (double)config.f.base;
+			double newValue = *value / baseAsDouble;
+
+		    if (p + 1 < strlen(u)) {
+		        p++;
+		    } else {
+		        break;
+		    }
 		}
 	}

And here is the patch used to generate the downstream version:

diff --git a/src/iotop.h b/src/iotop.h
index 0048a59..ec95b26 100644
--- a/src/iotop.h
+++ b/src/iotop.h
@@ -261,7 +261,7 @@ inline void arr_sort(struct xxxid_stats_arr *pa,int (*cb)(const void *a,const vo
 
 inline void calc_total(struct xxxid_stats_arr *cs,double *read,double *write);
 inline void calc_a_total(struct act_stats *act,double *read,double *write,double time_s);
-inline void humanize_val(double *value,char *str,int allow_accum);
+inline void turn_into_human_value(double *value,char *str,int allow_accum);
 inline int iotop_sort_cb(const void *a,const void *b);
 inline int create_diff(struct xxxid_stats_arr *cs,struct xxxid_stats_arr *ps,double time_s,uint64_t ts_c,filter_callback_w cb,int width,int *cnt);
 inline int value2scale(double val,double mx);
diff --git a/src/view_batch.c b/src/view_batch.c
index 62dc3b8..408b8c0 100644
--- a/src/view_batch.c
+++ b/src/view_batch.c
@@ -30,10 +30,10 @@ static inline void view_batch(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
 	calc_total(cs,&total_read,&total_write);
 	calc_a_total(act,&total_a_read,&total_a_write,time_s);
 
-	humanize_val(&total_read,str_read,1);
-	humanize_val(&total_write,str_write,1);
-	humanize_val(&total_a_read,str_a_read,0);
-	humanize_val(&total_a_write,str_a_write,0);
+	turn_into_human_value(&total_read,str_read,1);
+	turn_into_human_value(&total_write,str_write,1);
+	turn_into_human_value(&total_a_read,str_a_read,0);
+	turn_into_human_value(&total_a_write,str_a_write,0);
 
 	printf(HEADER1_FORMAT,total_read,str_read,"",total_write,str_write,"");
 
@@ -77,8 +77,8 @@ static inline void view_batch(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
 		if (s->exited) // do not show exited processes in batch view
 			continue;
 
-		humanize_val(&read_val,read_str,1);
-		humanize_val(&write_val,write_str,1);
+		turn_into_human_value(&read_val,read_str,1);
+		turn_into_human_value(&write_val,write_str,1);
 
 		pw_name=u8strpadt(s->pw_name,10);
 
diff --git a/src/view_curses.c b/src/view_curses.c
index c2334e4..96df5b6 100644
--- a/src/view_curses.c
+++ b/src/view_curses.c
@@ -733,10 +733,10 @@ static inline void view_curses(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
 		hist_a_w[0]=total_a_write;
 	}
 
-	humanize_val(&total_read,str_read,1);
-	humanize_val(&total_write,str_write,1);
-	humanize_val(&total_a_read,str_a_read,0);
-	humanize_val(&total_a_write,str_a_write,0);
+	turn_into_human_value(&total_read,str_read,1);
+	turn_into_human_value(&total_write,str_write,1);
+	turn_into_human_value(&total_a_read,str_a_read,0);
+	turn_into_human_value(&total_a_write,str_a_write,0);
 
 	gr_width_h=gr_width;
 	if (maxy<10||maxx<(int)strlen(HEADER1_FORMAT)+2*(7-5+3-2+(!config.f.hidegraph?gr_width_h+1:0)-2)) {
@@ -1066,8 +1066,8 @@ static inline void view_curses(struct xxxid_stats_arr *cs,struct xxxid_stats_arr
 				write_val=s->write_val;
 			}
 
-			humanize_val(&read_val,read_str,1);
-			humanize_val(&write_val,write_str,1);
+			turn_into_human_value(&read_val,read_str,1);
+			turn_into_human_value(&write_val,write_str,1);
 
 			pwt=esc_low_ascii(s->pw_name);
 			pw_name=u8strpadt(pwt,9);
diff --git a/src/views.c b/src/views.c
index 78bc076..3927b73 100644
--- a/src/views.c
+++ b/src/views.c
@@ -213,7 +213,7 @@ inline int create_diff(struct xxxid_stats_arr *cs,struct xxxid_stats_arr *ps,dou
 	return cs->length;
 }
 
-inline void humanize_val(double *value,char *str,int allow_accum) {
+inline void turn_into_human_value(double *value,char *str,int allow_accum) {
 	const char *u="BKMGTPEZY";
 	size_t p=0;
 

Run error

run python3.7 driver.py --data=main-data.json --only-setup --bug-id=110,has error,use docker container from dockerhub

[DRIVER] Running experiment driver
[DRIVER] Reading configuration values
[DRIVER] Loading experiment data

Experiment-110
-----------------------------
        [META-DATA] Pa: d644cca50f366cd109845ae92e37c09ed79adf81
        [META-DATA] Pb: 5e99456c20f712dcc13d9f6ca4278937d5367355
        [META-DATA] Pc: b83f73aa760899a492752f8447ec4ef230e5c01d
        [META-DATA] Pe: 7b5115689bf9dafc5127b28ace4589f698d4adfa
        [META-DATA] Module-a: drivers/media/common/videobuf2/videobuf2-v4l2.o
        [META-DATA] Module-c: drivers/media/v4l2-core/videobuf2-v4l2.o
        [INFO] creating directories for experiment
Traceback (most recent call last):
  File "driver.py", line 384, in <module>
    run(sys.argv[1:])
  File "driver.py", line 341, in run
    setup_each(DIR_EXPERIMENT, index, commit_list)
  File "driver.py", line 106, in setup_each
    shutil.copytree(REPO_PATH, dir_path)
  File "/usr/lib/python3.7/shutil.py", line 368, in copytree
    raise Error(errors)
shutil.Error: [('/linux-stable/scripts/dtc/include-prefixes/arm64/arm/vexpress-v2m-rs1.dtsi', '/data/backport/linux/110/pa/scripts/dtc/include-prefixes/arm64/arm/vexpress-v2m-rs1.dtsi', "[Errno 2] No such file or directory: '/linux-stable/scripts/dtc/include-prefixes/arm64/arm/vexpress-v2m-rs1.dtsi'"), ('/linux-stable/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi', '/data/backport/linux/110/pa/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi', "[Errno 2] No such file or directory: '/linux-stable/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi'")]

Issue with Dockerfile

Hi all,

It seems like there is a problem with the default Dockerfile where Ubuntu cannot find the python3.7 package:

$  docker build -f Dockerfile .
[+] Building 3.6s (9/32)                                                                  docker:default
 => [internal] load build definition from Dockerfile                                                0.0s
 => => transferring dockerfile: 3.08kB                                                              0.0s
 => [internal] load .dockerignore                                                                   0.0s
 => => transferring context: 179B                                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:16.04                                     0.3s
 => [ 1/29] FROM docker.io/library/ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a41  0.0s
 => CACHED [ 2/29] RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y     aut  0.0s
 => CACHED [ 3/29] RUN add-apt-repository -y ppa:deadsnakes/ppa                                     0.0s
 => CACHED [ 4/29] RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add -          0.0s
 => CACHED [ 5/29] RUN apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9  0.0s
 => ERROR [ 6/29] RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y  --no-in  3.2s
------                                                                                                   
 > [ 6/29] RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y  --no-install-recommends --force-yes     clang-9     python3.7     python3-pip     python3-setuptools:                         
0.274 Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease                                            
0.274 Hit:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease                                    
0.274 Hit:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease                                  
0.274 Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
0.387 Get:5 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease [18.1 kB]
1.266 Get:6 https://apt.llvm.org/xenial llvm-toolchain-xenial-9 InRelease [4234 B]
1.506 Get:7 https://apt.llvm.org/xenial llvm-toolchain-xenial-9/main amd64 Packages [8828 B]
1.528 Fetched 31.1 kB in 1s (23.2 kB/s)
1.528 Reading package lists...
2.283 Reading package lists...
2.995 Building dependency tree...
3.114 Reading state information...
3.158 E: Unable to locate package python3.7
3.158 E: Couldn't find any package by glob 'python3.7'
3.158 E: Couldn't find any package by regex 'python3.7'
------
Dockerfile:32
--------------------
  31 |     RUN apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main"
  32 | >>> RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y  --no-install-recommends --force-yes \
  33 | >>>     clang-9 \
  34 | >>>     python3.7 \
  35 | >>>     python3-pip \
  36 | >>>     python3-setuptools
  37 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y  --no-install-recommends --force-yes     clang-9     python3.7     python3-pip     python3-setuptools" did not complete successfully: exit code: 100

Generated Patch Includes Extra Parenthesis

Hi all, I'm facing a strange issue where the generated patch is created exactly how I'd expect it to.
The issue is that there will usually be an accompanying unmatched parenthesis.

To give you an idea of what I'm talking about, I'm working with the iotop-c package as an example.

Patch to generate the upstream

diff --git a/src/configfile.c b/../../../upstreams/iotop/src/configfile.c
index e91f1ea..1b5ed82 100644
--- a/src/configfile.c
+++ b/../../../upstreams/iotop/src/configfile.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later
 
 Copyright (C) 2014  Vyacheslav Trushkin
-Copyright (C) 2020-2023  Boian Bonev
+Copyright (C) 2020-2024  Boian Bonev
 
 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 
@@ -20,7 +20,8 @@ You should have received a copy of the GNU General Public License along with thi
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#define CONFIG_PATH "/.config/iotop"
+#define CONFIG_DIR1 "/.config"
+#define CONFIG_DIR2 "/iotop"
 #define CONFIG_NAME "/iotoprc"
 #define MAX_OPT 50
 
@@ -48,15 +49,25 @@ static inline void mkdir_p(const char *dir) {
 
 static inline FILE *config_file_open(const char *mode) {
 	char path[PATH_MAX];
+	char *xdgconfig;
 	char *home;
 
+	xdgconfig=getenv("XDG_CONFIG_HOME");
 	home=getenv("HOME");
-	if (!home)
-		home="";
 
-	strcpy(path,home);
-	strcat(path,CONFIG_PATH);
-	mkdir_p(path);
+	if (xdgconfig) {
+		strcpy(path,xdgconfig);
+		strcat(path,CONFIG_DIR2);
+		mkdir_p(path);
+	} else {
+		if (home)
+			strcpy(path,home);
+		else
+			strcpy(path,"");
+		strcat(path,CONFIG_DIR1);
+		strcat(path,CONFIG_DIR2);
+		mkdir_p(path);
+	}
 	strcat(path,CONFIG_NAME);
 
 	return fopen(path,mode);
@@ -247,6 +258,9 @@ inline int config_file_save(void) {
 	// --ascii
 	if (!config.f.unicode)
 		fprintf(cf,"--ascii\n");
+	// --hide-time
+	if (config.f.hideclock)
+		fprintf(cf,"--hide-time\n");
 
 	fclose(cf);

(this is part of a larger patch, which I've omitted here for readability)

Upstream patch to backport:

diff --git a/src/configfile.c b/src/configfile.c
index 1b5ed82..effe23f 100644
--- a/src/configfile.c
+++ b/src/configfile.c
@@ -55,20 +55,22 @@ static inline FILE *config_file_open(const char *mode) {
 	xdgconfig=getenv("XDG_CONFIG_HOME");
 	home=getenv("HOME");
 
+	const size_t copy_path_max = PATH_MAX-1;
+	const size_t cat_max_minus_path = PATH_MAX-(strlen(path)+1);
 	if (xdgconfig) {
-		strcpy(path,xdgconfig);
-		strcat(path,CONFIG_DIR2);
+		strncpy(path,xdgconfig, copy_path_max);
+		strncat(path, CONFIG_DIR2, cat_max_minus_path);
 		mkdir_p(path);
 	} else {
 		if (home)
-			strcpy(path,home);
+			strncpy(path,home, copy_path_max);
 		else
-			strcpy(path,"");
-		strcat(path,CONFIG_DIR1);
-		strcat(path,CONFIG_DIR2);
+			strncpy(path,"", PATH_MAX-1);
+		strncat(path,CONFIG_DIR1, cat_max_minus_path);
+		strncat(path,CONFIG_DIR2, cat_max_minus_path);
 		mkdir_p(path);
 	}
-	strcat(path,CONFIG_NAME);
+	strncat(path,CONFIG_NAME, cat_max_minus_path);
 
 	return fopen(path,mode);
 }

Generated Backport Patch:

--- /dirs/iotop-c-c/src/configfile.c	2024-02-20 16:49:48.531837809 +0000
+++ /dirs/iotop-c-c-patch//src/configfile.c	2024-02-20 16:49:48.678840528 +0000
@@ -51,13 +51,17 @@
 	char *home;
 
 	home=getenv("HOME");
+ const size_t copy_path_max = PATH_MAX-1; 
+
+ const size_t cat_max_minus_path = PATH_MAX-(strlen(path)+1); 
+
 	if (!home)
 		home="";
 
-	strcpy(path,home);
-	strcat(path,CONFIG_PATH);
+	strncpy(path,home,  copy_path_max) );
+	strncat(path,CONFIG_PATH,  cat_max_minus_path) );
 	mkdir_p(path);
-	strcat(path,CONFIG_NAME);
+	strncat(path,CONFIG_NAME,  cat_max_minus_path) );
 
 	return fopen(path,mode);
 }

As you can see in this example, there are additional ) characters being added to the function backport where there shouldn't be.

Otherwise, the patch performs as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.