summaryrefslogtreecommitdiff
blob: 2b13787f38c0304553a26b3dc6cf4cb91bd5cf04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- busybox-1.18.3/modutils/modutils-24.c
+++ busybox-1.18.3-modutils24/modutils/modutils-24.c
@@ -2474,6 +2474,7 @@ new_process_module_arguments(struct obj_
 		n = 0;
 		p = val;
 		while (*p != 0) {
+			char sv_ch;
 			char *endp;
 
 			if (++n > max)
@@ -2482,14 +2483,17 @@ new_process_module_arguments(struct obj_
 			switch (*pinfo) {
 			case 's':
 				len = strcspn(p, ",");
+				sv_ch = p[len];
 				p[len] = 0;
 				obj_string_patch(f, sym->secidx,
 						 loc - contents, p);
 				loc += tgt_sizeof_char_p;
 				p += len;
+				*p = sv_ch;
 				break;
 			case 'c':
 				len = strcspn(p, ",");
+				sv_ch = p[len];
 				p[len] = 0;
 				if (len >= charssize)
 					bb_error_msg_and_die("string too long for %s (max %ld)", param,
@@ -2497,6 +2501,7 @@ new_process_module_arguments(struct obj_
 				strcpy((char *) loc, p);
 				loc += charssize;
 				p += len;
+				*p = sv_ch;
 				break;
 			case 'b':
 				*loc++ = strtoul(p, &endp, 0);