mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-09 16:01:19 +01:00
Fix a bug in previous commit where pkg_{delete,info} foo-1.0/ would segfault.
Noticed first by: kris
This commit is contained in:
parent
a5d8019e08
commit
61de98348a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56211
@ -89,11 +89,13 @@ main(int argc, char **argv)
|
||||
while( !isalpha(*(pkgs_split+1)) )
|
||||
{
|
||||
*pkgs_split = '\0';
|
||||
pkgs_split = rindex(*argv, (int) '/');
|
||||
if ( (pkgs_split = rindex(*argv, (int) '/')) == NULL )
|
||||
pkgs_split = *argv;
|
||||
}
|
||||
if(pkgs_split != NULL)
|
||||
{
|
||||
pkgs_split++;
|
||||
if (*pkgs_split == '/')
|
||||
pkgs_split++;
|
||||
*pkgs = pkgs_split;
|
||||
pkgs++;
|
||||
}
|
||||
|
@ -151,11 +151,13 @@ main(int argc, char **argv)
|
||||
while( !isalpha(*(pkgs_split+1)) )
|
||||
{
|
||||
*pkgs_split = '\0';
|
||||
pkgs_split = rindex(*argv, (int) '/');
|
||||
if ( (pkgs_split = rindex(*argv, (int) '/')) == NULL)
|
||||
pkgs_split = *argv;
|
||||
}
|
||||
if(pkgs_split != NULL)
|
||||
{
|
||||
pkgs_split++;
|
||||
if (*pkgs_split == '/')
|
||||
pkgs_split++;
|
||||
*pkgs = pkgs_split;
|
||||
pkgs++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user