diff options
| author | Faraz Vahedi <kfv@FreeBSD.org> | 2026-09-10 11:08:00 +0000 |
|---|---|---|
| committer | Faraz Vahedi <kfv@FreeBSD.org> | 2026-09-10 11:08:00 +0000 |
| commit | c63b69f82a745c1b905c1050eeff9df96fe18f4c (patch) | |
| tree | 342ba7e602a4d846e1ffbe95f4e3d67966775417 | |
| parent | c6dfeb546d8c45ae30bba15402da8ab0621532a0 (diff) | |
libjail: Preserve const qualifier on strchr(3) and strrchr(3) results
Reviewed by: fuz
Approved by: fuz (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59553
| -rw-r--r-- | lib/libjail/jail.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libjail/jail.c b/lib/libjail/jail.c index c180b8533e97..61ca46007db9 100644 --- a/lib/libjail/jail.c +++ b/lib/libjail/jail.c @@ -402,8 +402,8 @@ jailparam_init(struct jailparam *jp, const char *name) int jailparam_import(struct jailparam *jp, const char *value) { - char *p, *ep, *tvalue; - const char *avalue; + char *ep, *tvalue; + const char *avalue, *p; const struct jp_structdef *jpsdef; int i, nval, fw; @@ -1247,7 +1247,8 @@ kldload_param(const char *name) static char * noname(const char *name) { - char *nname, *p; + char *nname; + const char *p; nname = malloc(strlen(name) + 3); if (nname == NULL) { @@ -1265,7 +1266,8 @@ noname(const char *name) static char * nononame(const char *name) { - char *p, *nname; + char *nname; + const char *p; p = strrchr(name, '.'); if (strncmp(p ? p + 1 : name, "no", 2)) { |
