Coverity #169: Fix potential fgets() into NULL (?!?).
This commit is contained in:
parent
d5bc41b882
commit
7637aa17f2
|
@ -3,6 +3,9 @@
|
||||||
* Xi/exevents.c:
|
* Xi/exevents.c:
|
||||||
Coverity #323, #445, #446, #447: Fix potential NULL dereferences.
|
Coverity #323, #445, #446, #447: Fix potential NULL dereferences.
|
||||||
|
|
||||||
|
* xkb/ddxList.c:
|
||||||
|
Coverity #169: Fix potential fgets() into NULL (?!?).
|
||||||
|
|
||||||
2006-04-07 Aaron Plattner <aplattner@nvidia.com>
|
2006-04-07 Aaron Plattner <aplattner@nvidia.com>
|
||||||
|
|
||||||
* hw/xfree86/common/xf86Module.h:
|
* hw/xfree86/common/xf86Module.h:
|
||||||
|
|
|
@ -169,8 +169,6 @@ char tmpname[PATH_MAX];
|
||||||
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
|
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
|
||||||
buf = Xprintf("%s/%s.dir",XkbBaseDirectory,componentDirs[what]);
|
buf = Xprintf("%s/%s.dir",XkbBaseDirectory,componentDirs[what]);
|
||||||
in= fopen(buf,"r");
|
in= fopen(buf,"r");
|
||||||
xfree (buf);
|
|
||||||
buf = NULL;
|
|
||||||
}
|
}
|
||||||
if (!in) {
|
if (!in) {
|
||||||
haveDir= False;
|
haveDir= False;
|
||||||
|
@ -186,8 +184,6 @@ char tmpname[PATH_MAX];
|
||||||
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
|
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
|
||||||
buf = Xprintf("%s.dir",componentDirs[what]);
|
buf = Xprintf("%s.dir",componentDirs[what]);
|
||||||
in= fopen(buf,"r");
|
in= fopen(buf,"r");
|
||||||
xfree (buf);
|
|
||||||
buf = NULL;
|
|
||||||
}
|
}
|
||||||
if (!in) {
|
if (!in) {
|
||||||
haveDir= False;
|
haveDir= False;
|
||||||
|
@ -224,6 +220,13 @@ char tmpname[PATH_MAX];
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
}
|
}
|
||||||
list->nFound[what]= 0;
|
list->nFound[what]= 0;
|
||||||
|
if (buf) {
|
||||||
|
xfree(buf);
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
|
buf = xalloc(PATH_MAX * sizeof(char));
|
||||||
|
if (!buf)
|
||||||
|
return BadAlloc;
|
||||||
while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
|
while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
|
||||||
unsigned flags;
|
unsigned flags;
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user