diff options
author | Karsten Keil <keil@b1-systems.de> | 2009-06-02 09:37:37 -0400 |
---|---|---|
committer | Karsten Keil <keil@b1-systems.de> | 2009-06-11 13:04:54 -0400 |
commit | 1ce1513f48e3bc4d55ee672f0e39f5063a02ab7a (patch) | |
tree | 1428894cade512b477dcd0ba9641e36faa7cb085 /drivers/isdn | |
parent | 8a745b9d91962991ce87a649a4dc3af3206c2c8b (diff) |
mISDN: Fix overlapping data access
Remove code rewriting a buffer by itself.
This fix bug 12970 on bugzilla.kernel.org.
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/mISDN/dsp_pipeline.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c index ac61f198eb32..e9941678edfa 100644 --- a/drivers/isdn/mISDN/dsp_pipeline.c +++ b/drivers/isdn/mISDN/dsp_pipeline.c | |||
@@ -55,20 +55,19 @@ static ssize_t | |||
55 | attr_show_args(struct device *dev, struct device_attribute *attr, char *buf) | 55 | attr_show_args(struct device *dev, struct device_attribute *attr, char *buf) |
56 | { | 56 | { |
57 | struct mISDN_dsp_element *elem = dev_get_drvdata(dev); | 57 | struct mISDN_dsp_element *elem = dev_get_drvdata(dev); |
58 | ssize_t len = 0; | 58 | int i; |
59 | int i = 0; | 59 | char *p = buf; |
60 | 60 | ||
61 | *buf = 0; | 61 | *buf = 0; |
62 | for (; i < elem->num_args; ++i) | 62 | for (i = 0; i < elem->num_args; i++) |
63 | len = sprintf(buf, "%sName: %s\n%s%s%sDescription: %s\n" | 63 | p += sprintf(p, "Name: %s\n%s%s%sDescription: %s\n\n", |
64 | "\n", buf, | ||
65 | elem->args[i].name, | 64 | elem->args[i].name, |
66 | elem->args[i].def ? "Default: " : "", | 65 | elem->args[i].def ? "Default: " : "", |
67 | elem->args[i].def ? elem->args[i].def : "", | 66 | elem->args[i].def ? elem->args[i].def : "", |
68 | elem->args[i].def ? "\n" : "", | 67 | elem->args[i].def ? "\n" : "", |
69 | elem->args[i].desc); | 68 | elem->args[i].desc); |
70 | 69 | ||
71 | return len; | 70 | return p - buf; |
72 | } | 71 | } |
73 | 72 | ||
74 | static struct device_attribute element_attributes[] = { | 73 | static struct device_attribute element_attributes[] = { |