summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2013-01-03 20:44:28 -0800
committerPhilip Langdale <philipl@overt.org>2013-01-11 20:31:52 -0800
commit5ae18e30fab90ceabe051c6789791dae13014c3d (patch)
tree82281edc9ae2b2b5260d58c45edace295ecbf7f2 /monitor
parentc63b132a2eee21233dc7a02bfeed09438f1daa4f (diff)
downloadgvfs-5ae18e30fab90ceabe051c6789791dae13014c3d.tar.gz
MTP: Review Feedback: Remove use of static buffer.
Use a dynamically allocated buffer instead to avoid any multi-threading dangers.
Diffstat (limited to 'monitor')
-rw-r--r--monitor/mtp/gmtpvolume.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/monitor/mtp/gmtpvolume.c b/monitor/mtp/gmtpvolume.c
index c59bba10..bfb453ae 100644
--- a/monitor/mtp/gmtpvolume.c
+++ b/monitor/mtp/gmtpvolume.c
@@ -105,13 +105,15 @@ static int hexdigit (char c)
static const char*
udev_decode_string (const char* encoded)
{
- static char decoded[4096];
int len;
const char* s;
+ char *decoded;
if (encoded == NULL)
return NULL;
+ decoded = g_malloc(4096);
+
for (len = 0, s = encoded; *s && len < sizeof (decoded) - 1; ++len, ++s) {
/* need to check for NUL terminator in advance */
if (s[0] == '\\' && s[1] == 'x' && s[2] >= '0' && s[3] >= '0') {