Looks like flawed reasoning. Here if info_dir is NULL then you are
guaranteed to blow up since you will dereference it. It seems like the
correct thing to do here (what the code author meant to do) was to set
*code_ptr = SS_ET_NO_INFO_DIR if info_dir was NULL or if *info_dir was
an empty string (aka *info_dir == '\0').
Coverity ID: 8: Forward Null
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+2007-03-19 Theodore Tso <tytso@mit.edu>
+
+ * help.c (ss_add_info_dir): Fix error checking for NULL parameter
+ passed via info_dir.
+
2006-11-17 Theodore Tso <tytso@mit.edu>
* get_readline.c (DEFAULT_LIBPATH): Add libreadline.so.5 to the
register char **dirs;
info = ss_info(sci_idx);
- if (info_dir == NULL && *info_dir) {
+ if (info_dir == NULL || *info_dir == '\0') {
*code_ptr = SS_ET_NO_INFO_DIR;
return;
}