diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-04-24 11:51:48 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-04-24 11:51:48 +0000 |
commit | 486e689913103fa372f7e2c3e054b2bd602546c4 (patch) | |
tree | 5963d7e886c47fe07a96f0c00d324f60e70316f4 /usr/src/uts/common/fs/sockfs/nl7c.c | |
parent | afe3f9d8d23796457bfe72d173ddfad10fb73385 (diff) | |
parent | 296f12dc4bd61fe5e3b1200d2cdf217ed82119a1 (diff) | |
download | illumos-joyent-release-20190425.tar.gz |
[illumos-gate merge]release-20190425
commit 296f12dc4bd61fe5e3b1200d2cdf217ed82119a1
10792 pcie: NULL pointer errors
commit 2002b186f847595188b1fb0b8dd800370aa6107c
10791 dr: NULL pointer errors
commit 8cd1b71859be6a08c9b7a446994fdbca544bb34f
10775 kmech_krb5: NULL pointer errors
commit c48c304592e7c2469d5b721291b1f57069f08d33
10774 pcmcia: NULL pointer errors
commit b38836b5d7f7e27aad97495457921171be74e408
10773 sata: NULL pointer errors
commit e9f74ea56f674c729c7fa4812e7fc668a9c24070
10738 sockfs: NULL pointer errors
commit 0f677ac901babf1fada10fcc386de1c3d4d4ecad
10772 kcf: NULL pointer errors
commit 03b18ed2fedba1f49023f25d34cbb6e4d0d8f435
10771 ibmf: NULL pointer errors
commit 28ec64d9ac03d17ce922c30274d804b981cda66e
10769 ksocket: NULL pointer errors
commit 9c80534542e4b5924bcdb8adee652d01656e4889
10768 kgssapi: NULL pointer errors
commit ee4417888cf835db6efb1e9b8039c90f0674e1cd
10765 acpica: NULL pointer errors
commit 239936d2b877f13d716270a06e56203231806b36
10762 hidparser: NULL pointer errors
commit 0f48f68d9e0ad95b0edf718f68736cf3635a1f79
10758 c2audit: NULL pointer errors
commit a8eee26afa7ddf0c604c989c598251014bdc6e6f
10745 rlmod: NULL pointer errors
commit 1d775d5906fd85b9ab1ac2251af8d38b5567d9a1
10829 zpool-features.5 add missing .RE
commit e14e15a6cbf868bfce31e7f485294c3358f1ae2a
10756 kaio: NULL pointer errors
commit 43bd9002dc964c045e1c90dfc1b08ab9fb316d41
10754 portfs: NULL pointer errors
commit c92b35bb664ce1e1d7dc0a4dcdcc791aef0fe69e
10753 qlc: NULL pointer errors
commit 483e494a59954f25ec067f2dee3cd94a269eaa08
10752 fcsm: NULL pointer errors
commit dd328bf6d39366b8d7bde6a36114538fc14332dd
10731 zfs: NULL pointer errors
commit fd7977362aae2eaa5dcb89671159f4fd82f22ca1
10570 Need workaround to EFI boot on AMI BIOS
Conflicts:
usr/src/uts/common/io/pciex/pcie_fault.c
Diffstat (limited to 'usr/src/uts/common/fs/sockfs/nl7c.c')
-rw-r--r-- | usr/src/uts/common/fs/sockfs/nl7c.c | 51 |
1 files changed, 20 insertions, 31 deletions
diff --git a/usr/src/uts/common/fs/sockfs/nl7c.c b/usr/src/uts/common/fs/sockfs/nl7c.c index 88584eda68..c76dada8d7 100644 --- a/usr/src/uts/common/fs/sockfs/nl7c.c +++ b/usr/src/uts/common/fs/sockfs/nl7c.c @@ -51,6 +51,8 @@ #include <sys/systm.h> #include <sys/strsun.h> #include <sys/strsubr.h> +#include <sys/ddi.h> +#include <sys/sunddi.h> #include <inet/common.h> #include <inet/ip.h> #include <inet/led.h> @@ -267,26 +269,6 @@ nl7c_mi_report_addr(mblk_t *mp) } /* - * ASCII to unsigned. - * - * Note, it's assumed that *p is a valid zero byte terminated string. - */ - -static unsigned -atou(const char *p) -{ - int c; - int v = 0; - - /* Shift and add digit by digit */ - while ((c = *p++) != NULL && isdigit(c)) { - v *= 10; - v += c - '0'; - } - return (v); -} - -/* * Inet ASCII to binary. * * Note, it's assumed that *s is a valid zero byte terminated string, and @@ -417,7 +399,7 @@ ncaportconf_read(void) parse = EOL; } } else if (c == '=') { - if (*tok != NULL) { + if (*tok != '\0') { /* Only know one token, skip */ parse = EOL; break; @@ -435,7 +417,7 @@ ncaportconf_read(void) case ADDR: if (c == '/') { /* addr/port separator, end of addr */ - *stringp = NULL; + *stringp = 0; if (inet_atob(string, addrp)) { /* Bad addr, skip */ parse = EOL; @@ -469,9 +451,16 @@ ncaportconf_read(void) } break; } else if (c == '#' || isspace(c)) { + unsigned long result = 0; + /* End of port number, convert */ - *stringp = NULL; - addrp->port = ntohs(atou(string)); + *stringp = '\0'; + if (ddi_strtoul(string, NULL, 10, &result) + != 0) { + parse = EOL; + break; + } + addrp->port = ntohs(result); /* End of parse, add entry */ nl7c_addr_add(addrp); @@ -582,7 +571,7 @@ ncakmodconf_read(void) * Found EOL, if tok found done, * else start on next-line. */ - if (*tok == NULL) { + if (*tok == '\0') { nl7c_enabled = B_TRUE; goto done; } @@ -721,11 +710,11 @@ ncalogdconf_read(void) * Found tok separator, if tok found get * tok text, else skip rest of line. */ - if (tokstatusp != NULL && *tokstatusp == NULL) + if (tokstatusp != NULL && *tokstatusp == '\0') tok = tokstatus; - else if (toksizep != NULL && *toksizep == NULL) + else if (toksizep != NULL && *toksizep == '\0') tok = toksize; - else if (tokfilep != NULL && *tokfilep == NULL) + else if (tokfilep != NULL && *tokfilep == '\0') tok = tokfile; if (tok != NULL) parse = TEXT; @@ -746,7 +735,7 @@ ncalogdconf_read(void) * (if any) and start on next line. */ if (tok == tokstatus) { - if (*++tokstatusp == NULL) + if (*++tokstatusp == '\0') nl7c_logd_enabled = B_TRUE; } else if (tok == toksize) { file_size = sz; @@ -761,7 +750,7 @@ ncalogdconf_read(void) } parse = START; } else if (tok == tokstatus) { - if (! isalpha(c) || *++tokstatusp == NULL || + if (! isalpha(c) || *++tokstatusp == '\0' || c != *tokstatusp) { /* Not enabled, skip line */ parse = EOL; @@ -921,7 +910,7 @@ nl7c_process(struct sonode *so, boolean_t nonblocking) clock_t timout; rval_t rval; uchar_t pri; - int pflag; + int pflag; int error; boolean_t more; boolean_t ret = B_FALSE; |