Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102603225
D38615.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
993 B
Referenced Files
None
Subscribers
None
D38615.id.diff
View Options
diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c
--- a/lib/libefivar/efivar-dp-xlate.c
+++ b/lib/libefivar/efivar-dp-xlate.c
@@ -544,23 +544,25 @@
static int
build_dp(const char *efimedia, const char *relpath, efidp *dp)
{
- char *fp, *dptxt = NULL, *cp, *rp;
+ char *fp = NULL, *dptxt = NULL, *cp, *rp = NULL;
int rv = 0;
efidp out = NULL;
size_t len;
- rp = strdup(relpath);
- for (cp = rp; *cp; cp++)
- if (*cp == '/')
- *cp = '\\';
- fp = path_to_file_dp(rp);
- free(rp);
- if (fp == NULL) {
- rv = ENOMEM;
- goto errout;
+ if (relpath != NULL) {
+ rp = strdup(relpath);
+ for (cp = rp; *cp; cp++)
+ if (*cp == '/')
+ *cp = '\\';
+ fp = path_to_file_dp(rp);
+ free(rp);
+ if (fp == NULL) {
+ rv = ENOMEM;
+ goto errout;
+ }
}
- asprintf(&dptxt, "%s/%s", efimedia, fp);
+ asprintf(&dptxt, "%s/%s", efimedia, fp == NULL ? "" : fp);
out = malloc(8192);
len = efidp_parse_device_path(dptxt, out, 8192);
if (len > 8192) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 4:13 PM (17 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14645137
Default Alt Text
D38615.id.diff (993 B)
Attached To
Mode
D38615: efivar: Allow NULL paths in build_dp
Attached
Detach File
Event Timeline
Log In to Comment