projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f75b13
)
gdbus: Fix crash in g_dbus_create_error_valist
author
Szymon Janc
<szymon.janc@tieto.com>
Tue, 7 Apr 2015 20:07:41 +0000
(22:07 +0200)
committer
Marcel Holtmann
<marcel@holtmann.org>
Thu, 9 Apr 2015 14:59:08 +0000
(16:59 +0200)
Passing NULL format parameter to vsnprintf results in invalid argument
error on glibc. But with some other libc libraries (musl and uClibc)
this results in dereferencing NULL pointer and crash due to
segmentation fault.
gdbus/object.c
patch
|
blob
|
history
diff --git
a/gdbus/object.c
b/gdbus/object.c
index 0f42dadf3e3ad041aef99f62843993ff30d446b9..96db5166530121b308cb50b426153569c35751c1 100644
(file)
--- a/
gdbus/object.c
+++ b/
gdbus/object.c
@@
-1412,7
+1412,10
@@
DBusMessage *g_dbus_create_error_valist(DBusMessage *message, const char *name,
{
char str[1024];
- vsnprintf(str, sizeof(str), format, args);
+ if (format)
+ vsnprintf(str, sizeof(str), format, args);
+ else
+ str[0] = '\0';
return dbus_message_new_error(message, name, str);
}