[syslinux:elflink] screensize: Dereference pointers when checking cols/rows

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Nov 27 14:15:04 PST 2012


Commit-ID:  4a08db73026a67c8979126008f7801a02ac1647e
Gitweb:     http://www.syslinux.org/commit/4a08db73026a67c8979126008f7801a02ac1647e
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 27 Nov 2012 16:03:36 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 27 Nov 2012 20:48:33 +0000

screensize: Dereference pointers when checking cols/rows

Dereference 'rows' and 'cols' to check whether the data they point to
is zero, which would indicate the screen size is bogus, instead of
checking if they point to NULL.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/lib/sys/screensize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/com32/lib/sys/screensize.c b/com32/lib/sys/screensize.c
index 340227c..bcd4496 100644
--- a/com32/lib/sys/screensize.c
+++ b/com32/lib/sys/screensize.c
@@ -14,7 +14,7 @@ int getscreensize(int fd, int *rows, int *cols)
     *rows = fp->o.rows;
     *cols = fp->o.cols;
 
-    if (!rows || !cols) {
+    if (!*rows || !*cols) {
 	errno = ENOTTY;
 	return -1;
     }


More information about the Syslinux-commits mailing list