Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Update
systemd.4328
0003-sd-bus-check-return-value-of-vasprintf.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0003-sd-bus-check-return-value-of-vasprintf.patch of Package systemd.4328
From 8bf13eb1e02b9977ae1cd331ae5dc7305a305a09 Mon Sep 17 00:00:00 2001 From: Daniel Mack <daniel@zonque.org> Date: Tue, 7 Oct 2014 12:10:06 +0200 Subject: [PATCH] sd-bus: check return value of vasprintf Check for OOM situations when vasprintf() returns < 0 in bus_error_setfv(). Spotted by coverity. --- src/libsystemd/sd-bus/bus-error.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git src/libsystemd/sd-bus/bus-error.c src/libsystemd/sd-bus/bus-error.c index abdfd73..5ca974a 100644 --- src/libsystemd/sd-bus/bus-error.c +++ src/libsystemd/sd-bus/bus-error.c @@ -194,8 +194,13 @@ int bus_error_setfv(sd_bus_error *e, const char *name, const char *format, va_li return -ENOMEM; } - if (format) - vasprintf((char**) &e->message, format, ap); + if (format) { + int r; + + r = vasprintf((char**) &e->message, format, ap); + if (r < 0) + return -ENOMEM; + } e->_need_free = 1; -- 1.7.9.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor