projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a383ab
)
xenpmd: Fix bogus fgets() size parameter.
author
Keir Fraser
<keir.fraser@citrix.com>
Sat, 13 Dec 2008 17:44:20 +0000
(17:44 +0000)
committer
Keir Fraser
<keir.fraser@citrix.com>
Sat, 13 Dec 2008 17:44:20 +0000
(17:44 +0000)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/xenpmd/xenpmd.c
patch
|
blob
|
history
diff --git
a/tools/xenpmd/xenpmd.c
b/tools/xenpmd/xenpmd.c
index c98e898316ed7cfbf0990914bc7102706cfa8833..28de744ef01694ce22572cda7732998f2f37a746 100644
(file)
--- a/
tools/xenpmd/xenpmd.c
+++ b/
tools/xenpmd/xenpmd.c
@@
-297,7
+297,6
@@
int get_next_battery_info_or_status(DIR *battery_dir,
if ( !info_or_status )
return 0;
- memset(line_info, 0, 256);
if (type == BIF)
memset(info_or_status, 0, sizeof(struct battery_info));
else
@@
-307,11
+306,8
@@
int get_next_battery_info_or_status(DIR *battery_dir,
if ( !file )
return 0;
- while ( fgets(line_info, 1024, file) != NULL )
- {
+ while ( fgets(line_info, sizeof(line_info), file) != NULL )
parse_battery_info_or_status(line_info, type, info_or_status);
- memset(line_info, 0, 256);
- }
fclose(file);
return 1;