Skip to content

Commit

Permalink
Cygwin: commune_process: don't use IsBadStringPtr
Browse files Browse the repository at this point in the history
IsBadStringPtr is deprecated and just gives a wrong sense
of memory safety.  Replace with check for NULL pointer.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
  • Loading branch information
github-cygwin committed Jan 31, 2024
1 parent b2476bc commit 61fd870
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions winsup/cygwin/pinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,7 @@ commune_process (void *arg)

for (int i = 0; i < __argc_safe; i++)
{
if (IsBadStringPtr (__argv[i], INT32_MAX))
argv[i] = "";
else
argv[i] = __argv[i];
argv[i] = __argv[i] ?: "";
n += strlen (argv[i]) + 1;
}
argv[__argc_safe] = NULL;
Expand Down

0 comments on commit 61fd870

Please sign in to comment.