Change check_null_empty_path* to check_null_empty_str* throughout.

* path.cc (path_conv::check): Add signal protection here since retrieving info
about remote shares can take some time.
* path.h (check_null_empty_str_errno): Convert to a function prototype.
* path.cc (check_null_empty_str): Move to miscfuncs.cc.
* miscfuncs.cc (check_null_empty_str_errno): New function.
(__check_null_invalid_struct): Ditto.
(__check_null_invalid_struct_errno): Ditto.
(check_null_empty_str): Change from VirtualQuery to IsBadWritePtr.
* thread.cc (check_valid_pointer): Ditto.
* resource.cc (getrlimit): Use check_null_invalid_struct macro for checking
validity of pointer.
(setrlimit): Ditto.
This commit is contained in:
Christopher Faylor
2001-06-28 02:19:57 +00:00
parent c135faa8b3
commit 7a4078ee34
10 changed files with 88 additions and 54 deletions

View File

@@ -290,7 +290,7 @@ extern "C" int
putenv (const char *str)
{
int res;
if ((res = check_null_empty_path (str)))
if ((res = check_null_empty_str (str)))
{
if (res == ENOENT)
return 0;
@@ -312,12 +312,12 @@ extern "C" int
setenv (const char *name, const char *value, int overwrite)
{
int res;
if ((res = check_null_empty_path (value)) == EFAULT)
if ((res = check_null_empty_str (value)) == EFAULT)
{
set_errno (res);
return -1;
}
if ((res = check_null_empty_path (name)))
if ((res = check_null_empty_str (name)))
{
if (res == ENOENT)
return 0;