bk: 56a9be7ad1JGBmfacSMb7cTbPOpr-g
* [Bug 2994] Systems with HAVE_SIGNALED_IO fail to compile. perlinger@ntp.org
* [Bug 2995] Fixes to compile on Windows
+* [Bug 2999] out-of-bounds access in 'is_safe_filename()'. perlinger@ntp.org
---
(4.2.8p6) 2016/01/20 Released by Harlan Stenn <stenn@ntp.org>
};
u_int widx, bidx, mask;
- if (!*name)
+ if ( ! (name && *name))
return FALSE;
mask = 1u;
while (0 != (widx = (u_char)*name++)) {
bidx = (widx & 15) << 1;
widx = widx >> 4;
- if (widx >= sizeof(chclass))
+ if (widx >= sizeof(chclass)/sizeof(chclass[0]))
return FALSE;
if (0 == ((chclass[widx] >> bidx) & mask))
return FALSE;
- mask |= 2u;
+ mask = 2u;
}
return TRUE;
}