提交 0fe3340e 编写于 作者: J Jim Meyering

plug two config-parsing leaks

* src/storage_conf.c (virStoragePoolDefParsePerms): Free mode string.
(virStorageVolDefParsePerms): Likewise.
* AUTHORS: Update.
Patch by Ryota Ozaki.
上级 07696eb3
......@@ -59,6 +59,7 @@ Patches have also been contributed by:
Itamar Heim <iheim@redhat.com>
Dave Allan <dallan@redhat.com>
Markus Armbruster <armbru@redhat.com>
Ryota Ozaki <ozaki.ryota@gmail.com>
[....send patches to get your name here....]
......
Mon Mar 2 10:16:04 +0100 2009 Jim Meyering <meyering@redhat.com>
plug two config-parsing leaks
* src/storage_conf.c (virStoragePoolDefParsePerms): Free mode string.
(virStorageVolDefParsePerms): Likewise.
Patch by Ryota Ozaki.
* AUTHORS: Update.
don't dereference uninitialized pointer
* src/storage_conf.c (virStoragePoolDefParsePerms): Initialize
"ptr" to NULL.
......
......@@ -383,6 +383,7 @@ virStoragePoolDefParsePerms(virConnectPtr conn,
} else {
char *end = NULL;
perms->mode = strtol(mode, &end, 8);
VIR_FREE(mode);
if (*end || perms->mode < 0 || perms->mode > 0777) {
virStorageReportError(conn, VIR_ERR_XML_ERROR,
"%s", _("malformed octal mode"));
......@@ -812,6 +813,7 @@ virStorageVolDefParsePerms(virConnectPtr conn,
} else {
char *end = NULL;
perms->mode = strtol(mode, &end, 8);
VIR_FREE(mode);
if (*end || perms->mode < 0 || perms->mode > 0777) {
virStorageReportError(conn, VIR_ERR_XML_ERROR,
"%s", _("malformed octal mode"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册