aboutsummaryrefslogtreecommitdiff
path: root/modutils/modutils-24.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-13 04:17:35 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-13 04:17:35 +0100
commit07cda2268a6cff59378af16eabc4968d9bebe915 (patch)
treea744208b75f57c6005991e8676aff95ff67d200f /modutils/modutils-24.c
parent9a5b7f636dad35ac84056768b3669bdca02d2700 (diff)
downloadbusybox-w32-07cda2268a6cff59378af16eabc4968d9bebe915.tar.gz
busybox-w32-07cda2268a6cff59378af16eabc4968d9bebe915.tar.bz2
busybox-w32-07cda2268a6cff59378af16eabc4968d9bebe915.zip
fix bug 3223 (parameter loading problem for 2.4 kernels)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/modutils-24.c')
-rw-r--r--modutils/modutils-24.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/modutils/modutils-24.c b/modutils/modutils-24.c
index 2b34954c0..bbc54e316 100644
--- a/modutils/modutils-24.c
+++ b/modutils/modutils-24.c
@@ -2444,14 +2444,12 @@ new_process_module_arguments(struct obj_file *f, const char *options)
2444 bb_error_msg_and_die("symbol for parameter %s not found", param); 2444 bb_error_msg_and_die("symbol for parameter %s not found", param);
2445 2445
2446 /* Number of parameters */ 2446 /* Number of parameters */
2447 min = max = 1;
2447 if (isdigit(*pinfo)) { 2448 if (isdigit(*pinfo)) {
2448 min = strtoul(pinfo, &pinfo, 10); 2449 min = max = strtoul(pinfo, &pinfo, 10);
2449 if (*pinfo == '-') 2450 if (*pinfo == '-')
2450 max = strtoul(pinfo + 1, &pinfo, 10); 2451 max = strtoul(pinfo + 1, &pinfo, 10);
2451 else 2452 }
2452 max = min;
2453 } else
2454 min = max = 1;
2455 2453
2456 contents = f->sections[sym->secidx]->contents; 2454 contents = f->sections[sym->secidx]->contents;
2457 loc = contents + sym->value; 2455 loc = contents + sym->value;
@@ -2473,7 +2471,8 @@ new_process_module_arguments(struct obj_file *f, const char *options)
2473 /* Parse parameter values */ 2471 /* Parse parameter values */
2474 n = 0; 2472 n = 0;
2475 p = val; 2473 p = val;
2476 while (*p != 0) { 2474 while (*p) {
2475 char sv_ch;
2477 char *endp; 2476 char *endp;
2478 2477
2479 if (++n > max) 2478 if (++n > max)
@@ -2482,21 +2481,25 @@ new_process_module_arguments(struct obj_file *f, const char *options)
2482 switch (*pinfo) { 2481 switch (*pinfo) {
2483 case 's': 2482 case 's':
2484 len = strcspn(p, ","); 2483 len = strcspn(p, ",");
2485 p[len] = 0; 2484 sv_ch = p[len];
2485 p[len] = '\0';
2486 obj_string_patch(f, sym->secidx, 2486 obj_string_patch(f, sym->secidx,
2487 loc - contents, p); 2487 loc - contents, p);
2488 loc += tgt_sizeof_char_p; 2488 loc += tgt_sizeof_char_p;
2489 p += len; 2489 p += len;
2490 *p = sv_ch;
2490 break; 2491 break;
2491 case 'c': 2492 case 'c':
2492 len = strcspn(p, ","); 2493 len = strcspn(p, ",");
2493 p[len] = 0; 2494 sv_ch = p[len];
2495 p[len] = '\0';
2494 if (len >= charssize) 2496 if (len >= charssize)
2495 bb_error_msg_and_die("string too long for %s (max %ld)", param, 2497 bb_error_msg_and_die("string too long for %s (max %ld)", param,
2496 charssize - 1); 2498 charssize - 1);
2497 strcpy((char *) loc, p); 2499 strcpy((char *) loc, p);
2498 loc += charssize; 2500 loc += charssize;
2499 p += len; 2501 p += len;
2502 *p = sv_ch;
2500 break; 2503 break;
2501 case 'b': 2504 case 'b':
2502 *loc++ = strtoul(p, &endp, 0); 2505 *loc++ = strtoul(p, &endp, 0);