handle negative return values
do not pass negative values to malloc do not pass negative values to strerror do not pass negative values to ftruncate do not pass negative values to fclose Change-Id: I79ebef4e22edd14343ebeebb2ef8308785064fe8
This commit is contained in:
@@ -137,6 +137,8 @@ stdio_trunc(krb5_storage * sp, off_t offset)
|
||||
if (fflush(F(sp)) == EOF)
|
||||
return errno;
|
||||
tmpoff = ftello(F(sp));
|
||||
if (tmpoff < 0)
|
||||
return errno;
|
||||
if (tmpoff > offset)
|
||||
tmpoff = offset;
|
||||
if (ftruncate(fileno(F(sp)), offset) == -1)
|
||||
|
Reference in New Issue
Block a user