diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-05-01 03:09:54 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-05-01 03:09:54 +0200 |
| commit | 05ae400830cba731ad8a423c54d23876bace59c4 (patch) | |
| tree | fc7304d152b884f50bbecc12d870270d5cbdff36 /util-linux/mdev.c | |
| parent | 47aaa2bee6b0c36634e8acb4aff98d22f9f6a128 (diff) | |
| download | busybox-w32-05ae400830cba731ad8a423c54d23876bace59c4.tar.gz busybox-w32-05ae400830cba731ad8a423c54d23876bace59c4.tar.bz2 busybox-w32-05ae400830cba731ad8a423c54d23876bace59c4.zip | |
mdev: fix a case where we mangle device_path string and then use it.
Diffstat (limited to 'util-linux/mdev.c')
| -rw-r--r-- | util-linux/mdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 8fc8a3df4..e23828eea 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
| @@ -564,7 +564,10 @@ int mdev_main(int argc UNUSED_PARAM, char **argv) | |||
| 564 | make_device(temp, 1); | 564 | make_device(temp, 1); |
| 565 | } | 565 | } |
| 566 | else if (strcmp(action, "add") == 0) { | 566 | else if (strcmp(action, "add") == 0) { |
| 567 | make_device(temp, 0); | 567 | /* make_device mangles its parameter, use a copy */ |
| 568 | char *s = xstrdup(temp); | ||
| 569 | make_device(s, 0); | ||
| 570 | free(s); | ||
| 568 | if (ENABLE_FEATURE_MDEV_LOAD_FIRMWARE) { | 571 | if (ENABLE_FEATURE_MDEV_LOAD_FIRMWARE) { |
| 569 | if (fw) | 572 | if (fw) |
| 570 | load_firmware(fw, temp); | 573 | load_firmware(fw, temp); |
