summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@MIT.EDU>2009-03-24 23:40:41 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-19 22:00:36 +0400
commit32c976bca43814be70d6062885be80673ffd66fc (patch)
tree1d87e2394cd825dd1a5b7f5f1334348fdb5a46a6 /scripts
parentd75b81a803bd93784d854bea13668db9dd75ff02 (diff)
downloadlinux-32c976bca43814be70d6062885be80673ffd66fc.tar.xz
Staging: rt2860: Don't call sprintf() with overlapping input and output.
The use of sprintf() to append to a buffer, as in sprintf(buf, "%sEntry: %d\n", buf, i) is not valid according to C99 ("If copying takes place between objects that overlap, the behavior is undefined."). It breaks at least in userspace under gcc -D_FORTIFY_SOURCE. Replace this construct with sprintf(buf + strlen(buf), "Entry: %d\n", i) This patch was automatically generated using perl -0pe 's/(sprintf\s*\(\s*([^,]*))(\s*,\s*")%s((?:[^"\\]|\\.)*"\s*,)\s*\2\s*,/$1 + strlen($2)$3$4/g' perl -0pe 's/(snprintf\s*\(\s*([^,]*))(\s*,[^,]*?)(\s*,\s*")%s((?:[^"\\]|\\.)*"\s*,)\s*\2\s*,/$1 + strlen($2)$3 - strlen($2)$4$5/g' Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions