- Fix possible crasher in libfprint when setting up the fds for polling

This commit is contained in:
Bastien Nocera 2008-11-25 15:59:27 +00:00
parent 72ab0d4937
commit 16446f024d
2 changed files with 36 additions and 2 deletions

View File

@ -0,0 +1,30 @@
From 5534d57ddc156582be5ed68f0e3fb6e23c69f6e9 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 25 Nov 2008 15:54:56 +0000
Subject: [PATCH] Fix fp_get_pollfds()
It was increasing i too early, and writing past the allocated
structures.
---
libfprint/poll.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libfprint/poll.c b/libfprint/poll.c
index a852905..f78b658 100644
--- a/libfprint/poll.c
+++ b/libfprint/poll.c
@@ -308,9 +308,10 @@ API_EXPORTED size_t fp_get_pollfds(struct fp_pollfd **pollfds)
ret = g_malloc(sizeof(struct fp_pollfd) * cnt);
i = 0;
- while ((usbfd = usbfds[i++]) != NULL) {
+ while ((usbfd = usbfds[i]) != NULL) {
ret[i].fd = usbfd->fd;
ret[i].events = usbfd->events;
+ i++;
}
*pollfds = ret;
--
1.6.0.3

View File

@ -1,6 +1,6 @@
Name: libfprint Name: libfprint
Version: 0.1.0 Version: 0.1.0
Release: 2.pre1%{?dist} Release: 3.pre1%{?dist}
Summary: Tool kit for fingerprint scanner Summary: Tool kit for fingerprint scanner
Group: System Environment/Libraries Group: System Environment/Libraries
@ -8,6 +8,7 @@ License: LGPLv2+
URL: http://www.reactivated.net/fprint/wiki/Main_Page URL: http://www.reactivated.net/fprint/wiki/Main_Page
Source0: http://downloads.sourceforge.net/fprint/%{name}-0.1.0-pre1.tar.bz2 Source0: http://downloads.sourceforge.net/fprint/%{name}-0.1.0-pre1.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: 0002-Fix-fp_get_pollfds.patch
# FIXME remove the ImageMagick dependency when we either have the # FIXME remove the ImageMagick dependency when we either have the
# gdk-pixbuf support merged, or disable the driver that requires it (F10) # gdk-pixbuf support merged, or disable the driver that requires it (F10)
@ -32,7 +33,7 @@ developing applications that use %{name}.
%prep %prep
%setup -q -n %{name}-0.1.0-pre1 %setup -q -n %{name}-0.1.0-pre1
%patch0 -p1
%build %build
%configure --disable-static %configure --disable-static
@ -70,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/hal/fdi/information/20thirdparty/10-fingerprint-reader-fprint.fdi %{_datadir}/hal/fdi/information/20thirdparty/10-fingerprint-reader-fprint.fdi
%changelog %changelog
* Tue Nov 25 2008 - Bastien Nocera <bnocera@redhat.com> - 0.1.0-3.pre1
- Fix possible crasher in libfprint when setting up the fds for polling
* Mon Nov 24 2008 - Bastien Nocera <bnocera@redhat.com> - 0.1.0-2.pre1 * Mon Nov 24 2008 - Bastien Nocera <bnocera@redhat.com> - 0.1.0-2.pre1
- And add some API docs - And add some API docs