List Info

Thread: fixes for gtkcard




fixes for gtkcard
user name
2006-04-25 20:21:21
I found a few issues with gtkcard, please
review attached patch.

1.) enrollInfo in CreateWindows.c is malloc'ed and filled
but never used.

2.) P11.c has several off by one error. one is fixed with
setting j to 31, but two lines below that tokenString[32]
is also off by one.

3.) newObject is not free()d in error handling parts.
malloc'ing it later solves that issue.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
fixes for gtkcard
user name
2006-04-25 20:58:51
On 25/04/06, Andreas Jellinghaus <ajdungeon.inka.de> wrote:
> I found a few issues with gtkcard, please
> review attached patch.
>
> 1.) enrollInfo in CreateWindows.c is malloc'ed and
filled
> but never used.

Exact.

> 2.) P11.c has several off by one error. one is fixed
with
> setting j to 31, but two lines below that
tokenString[32]
> is also off by one.

Line 50 we have:
    char itokenString[33];
so tokenString[32] is valid (even if a bit surprising)

A better idea would be to replace 32 by
sizeof(tokenString)-1.

> 3.) newObject is not free()d in error handling parts.
> malloc'ing it later solves that issue.

Exact.

Feel free to commit your patches.

Thanks,

--
 Dr Ludovic Rousseau
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
fixes for gtkcard
user name
2006-04-25 21:42:55
Am Dienstag, 25. April 2006 22:58 schrieb Ludovic Rousseau:
> > 2.) P11.c has several off by one error. one is
fixed with
> > setting j to 31, but two lines below that
tokenString[32]
> > is also off by one.
>
> Line 50 we have:
>     char itokenString[33];
> so tokenString[32] is valid (even if a bit surprising)

yes, I was confused. still j needs to be initialized with
31, as
j+1 is used somewhere below.

> Feel free to commit your patches.

thanks, done.

Andreas
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )