Fix a regression accidentally introduced by OpenZFS 7280 in
ed828c0: since
whether to accept NULL as a valid first parameter in strchr() is implementation
specific we add an additional check to avoid crashing.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #5917
"little-endian systems\n");
return (ENOTSUP);
#endif
- if ((varval = strchr(arg, '=')) != NULL) {
+ if (arg != NULL && (varval = strchr(arg, '=')) != NULL) {
*varval = '\0';
varval++;
val = strtoull(varval, NULL, 0);