Skip to content

Commit

Permalink
cgmanager: cgm_get: len = 0 is a query for length only
Browse files Browse the repository at this point in the history
The caller might (like lxc-test-startone does) pass in a valid
(or invalid) buffer and 0 length.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
hallyn authored and stgraber committed Apr 7, 2014
1 parent 13bc2fd commit 6d35844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/cgmanager.c
Expand Up @@ -689,7 +689,7 @@ static int cgm_get(const char *filename, char *value, size_t len, const char *na
cgm_dbus_disconnect();
free(cgroup);
newlen = strlen(result);
if (!value) {
if (!len || !value) {
// user queries the size
nih_free(result);
return newlen+1;
Expand Down

0 comments on commit 6d35844

Please sign in to comment.