query_fileowner: avoid buffer overflow
Copying a string into a buffer that has just been determined to not be
able to hold it is obviously incorrect. The actual error handling
appears to have been unintentionally removed in
47762ab687
.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
1bc79cb9a5
commit
a2b776f6c9
1 changed files with 1 additions and 0 deletions
|
@ -204,6 +204,7 @@ static int query_fileowner(alpm_list_t *targets)
|
|||
size_t rlen = strlen(rpath);
|
||||
if(rlen + 2 >= PATH_MAX) {
|
||||
pm_printf(ALPM_LOG_ERROR, _("path too long: %s/\n"), rpath);
|
||||
goto targcleanup;
|
||||
}
|
||||
strcat(rpath + rlen, "/");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue