Package: lsat
Version: 0.9.7.1-1
Severity: normal
Tags: patch
Uninitialized local variable "fileval" is passed to close - random file
descriptor is closed.
strace shows:
close(134556941) = -1 EBADF (Bad file descriptor)
--- checkpasswd.c.orig 2009-06-15 12:12:47.000000000 +0200
+++ checkpasswd.c 2009-06-15 12:13:03.000000000 +0200
# uninitialized local variable "fileval"
# sample run with strace shows:
# close(134556941) = -1 EBADF (Bad file descriptor)
@@ -38,7 +38,6 @@
char temparray[2][128]; /*temparray. */
int j=0; /* counter variable */
int field; /* field counter */
- int fileval; /* return val */
const char * tmp_file = "/tmp/lsat2.lsat"; /* temp file for storage */
const char * tempfile =NULL;
@@ -153,7 +152,6 @@
remove(tempfile);
/* close the tmpfile */
fclose(fileptr);
- close(fileval);
/* note dostuff below will rm tmpfile */
header = "Please consider removing these system accounts.\nCheck to see if you need them for your system applications before removing.\nAlso, consult the securitylinks.txt file for more information.\n";