summaryrefslogtreecommitdiff
path: root/src/bin/e_fm
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-08 10:41:45 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-08 10:46:25 -0500
commit6ad75a5e854b332c635abab9d0f9402adc1b3573 (patch)
tree2f57b6e7f0471cd3b7794a61088fe190ad6c6171 /src/bin/e_fm
parentb9a9bd1da9f6949b1c1562dd46760db793a57506 (diff)
protect against null deref when emitting efm/eeze error messages
CID 1382954
Diffstat (limited to 'src/bin/e_fm')
-rw-r--r--src/bin/e_fm/e_fm_main_eeze.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/e_fm/e_fm_main_eeze.c b/src/bin/e_fm/e_fm_main_eeze.c
index 0383e8860..baac5dfa5 100644
--- a/src/bin/e_fm/e_fm_main_eeze.c
+++ b/src/bin/e_fm/e_fm_main_eeze.c
@@ -108,14 +108,17 @@ _e_fm_main_eeze_format_error_msg(char **buf,
108 char *tmp; 108 char *tmp;
109 109
110 vu = strlen(v->udi) + 1; 110 vu = strlen(v->udi) + 1;
111 vm = strlen(v->mount_point) + 1; 111 vm = (v->mount_point ? strlen(v->mount_point) : 0) + 1;
112 en = strlen(name) + 1; 112 en = strlen(name) + 1;
113 size = vu + vm + en + strlen(msg) + 1; 113 size = vu + vm + en + strlen(msg) + 1;
114 tmp = *buf = malloc(size); 114 tmp = *buf = malloc(size);
115 115
116 strcpy(tmp, v->udi); 116 strcpy(tmp, v->udi);
117 tmp += vu; 117 tmp += vu;
118 strcpy(tmp, v->mount_point); 118 if (v->mount_point)
119 strcpy(tmp, v->mount_point);
120 else
121 tmp[0] = 0;
119 tmp += vm; 122 tmp += vm;
120 strcpy(tmp, name); 123 strcpy(tmp, name);
121 tmp += en; 124 tmp += en;