Bug #6261

Fix for 6198 overlooked NULL abuse in svr4pkg/libinst/mntinfo.c

Added by Dan McDonald almost 3 years ago. Updated almost 3 years ago.

Status:NewStart date:2015-09-24
Priority:LowDue date:
Assignee:-% Done:

0%

Category:nfs - NFS server and client
Target version:-
Difficulty:Bite-size Tags:needs-triage

Description

Richard PALO pointed this additional change that he'd have liked to have seen (slightly modified for correctness) in #6198 :

diff --git a/usr/src/cmd/svr4pkg/libinst/mntinfo.c b/usr/src/cmd/svr4pkg/libinst/mntinfo.c
index 0867628..44fda5c 100644
--- a/usr/src/cmd/svr4pkg/libinst/mntinfo.c
+++ b/usr/src/cmd/svr4pkg/libinst/mntinfo.c
@@ -223,7 +223,7 @@ get_server_host(uint32_t n)
        if (n < fs_tab_used) {
                (void) strcpy(hostname, fs_tab[n]->remote_name);
                if ((host_end = strchr(hostname, ':')) == NULL) {
-                       if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTOFS)) == NULL)
+                       if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTOFS)) == 0)
                                return ("automounter");
                        else
                                return (fs_tab[n]->fstype);
@@ -1121,7 +1121,7 @@ fsys(char *path)
                 * do the string compare. -- JST
                 */
                if ((fs_namelen == 1 && *(fs_tab[i]->name) == '/') ||
-                   ((term_char == '/' || term_char == NULL) &&
+                   ((term_char == '/' || term_char == '\0') &&
                    strncmp(fs_tab[i]->name, path2use, fs_namelen) == 0)) {
                        return (i);
                }

This would make a good bite-sized introduction for someone new to illumos, modulo the possibility svr4pkg isn't removed first.


Related issues

Related to illumos gate - Bug #6198: Let's EOL cachefs Closed 2015-09-02 2015-09-12

History

#1 Updated by Dan McDonald almost 3 years ago

  • Related to Bug #6198: Let's EOL cachefs added

#2 Updated by Richard PALO almost 3 years ago

Thanks, Dan. This is part of merge hell with new/modified bugs on top of 5218...

Also available in: Atom