aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/icedteanp/IcedTeaNPPlugin.cc
diff options
context:
space:
mode:
authorAdam Domurad <[email protected]>2012-05-22 14:19:50 -0400
committerAdam Domurad <[email protected]>2012-05-22 14:19:50 -0400
commit83f9d2e9dd57aac518b2284c9625547cd4f8fd91 (patch)
tree95b4dc76a41f524b0a8c1b9bb6705a1d1f130f71 /plugin/icedteanp/IcedTeaNPPlugin.cc
parenta2cc992a123651041d9890200d8040e188fc9c96 (diff)
Changed usage of sprintf to snprintf. Made some small malloc'd buffers on the stack.
These changes are unlikely to change functionality, for if the buffer is too small to write to, something has already gone wrong. However, they are good as an additional safety guarantee, preventing memory from corruption in the case that something goes wrong.
Diffstat (limited to 'plugin/icedteanp/IcedTeaNPPlugin.cc')
-rw-r--r--plugin/icedteanp/IcedTeaNPPlugin.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc
index 6f49726..657cf07 100644
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc
@@ -1227,9 +1227,9 @@ void consume_message(gchar* message) {
{
// clear the "instance X status" parts
- sprintf(parts[0], "");
- sprintf(parts[1], "");
- sprintf(parts[2], "");
+ snprintf(parts[0], sizeof(""), "");
+ snprintf(parts[1], sizeof(""), "");
+ snprintf(parts[2], sizeof(""), "");
// join the rest
gchar* status_message = g_strjoinv(" ", parts);