svn commit: r345330 - head/stand/common
Ed Maste
emaste at FreeBSD.org
Wed Mar 20 16:24:48 UTC 2019
Author: emaste
Date: Wed Mar 20 16:24:47 2019
New Revision: 345330
URL: https://svnweb.freebsd.org/changeset/base/345330
Log:
loader: fix loading of kernels with . in path
The loader indended to search the kernel file name (only) for . but
instead searched the entire path, so paths like
"boot/test.elfv2/kernel" would not work.
Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: kevans
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19658
Modified:
head/stand/common/load_elf.c
Modified: head/stand/common/load_elf.c
==============================================================================
--- head/stand/common/load_elf.c Wed Mar 20 16:08:07 2019 (r345329)
+++ head/stand/common/load_elf.c Wed Mar 20 16:24:47 2019 (r345330)
@@ -868,14 +868,16 @@ fake_modname(const char *name)
sp++;
else
sp = name;
- ep = strrchr(name, '.');
- if (ep) {
- if (ep == name) {
- sp = invalid_name;
- ep = invalid_name + sizeof(invalid_name) - 1;
- }
- } else
- ep = name + strlen(name);
+
+ ep = strrchr(sp, '.');
+ if (ep == NULL) {
+ ep = sp + strlen(sp);
+ }
+ if (ep == sp) {
+ sp = invalid_name;
+ ep = invalid_name + sizeof(invalid_name) - 1;
+ }
+
len = ep - sp;
fp = malloc(len + 1);
if (fp == NULL)
More information about the svn-src-all
mailing list