Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libvirt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Libvirt Packaging Team
libvirt
Commits
e5ae24b1
Commit
e5ae24b1
authored
15 years ago
by
Guido Günther
Browse files
Options
Downloads
Patches
Plain Diff
Fix on udev backend startup
parent
c5abc2e9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/0005-udev_device_get_devpath-might-return-NULL.patch
+30
-0
30 additions, 0 deletions
...ches/0005-udev_device_get_devpath-might-return-NULL.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
31 additions
and
0 deletions
debian/patches/0005-udev_device_get_devpath-might-return-NULL.patch
0 → 100644
+
30
−
0
View file @
e5ae24b1
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Mon, 7 Dec 2009 19:00:11 +0100
Subject: [PATCH] udev_device_get_devpath might return NULL
Fix crash on strdup in that case.
---
src/node_device/node_device_udev.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 9b48052..c7238fc 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -947,8 +947,14 @@
static int udevProcessStorage(struct udev_device *device,
{
union _virNodeDevCapData *data = &def->caps->data;
int ret = -1;
+ const char* devnode;
- data->storage.block = strdup(udev_device_get_devnode(device));
+ devnode = udev_device_get_devnode(device);
+ if(!devnode) {
+ VIR_DEBUG("No devnode for '%s'\n", udev_device_get_devpath(device));
+ goto out;
+ }
+ data->storage.block = strdup(devnode);
if (udevGetStringProperty(device,
"DEVNAME",
&data->storage.block) == PROPERTY_ERROR) {
--
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
e5ae24b1
...
...
@@ -2,3 +2,4 @@
0002-qemu-disable-network.diff.patch
0003-allow-libvirt-group-to-access-the-socket.patch
0004-fix-Debian-specific-path-to-hvm-loader.patch
0005-udev_device_get_devpath-might-return-NULL.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment