From: mreed <mr...@us...> - 2006-07-10 19:27:56
|
Update of /cvsroot/ltp/ltp/testcases/kernel/io/ltp-aiodio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2488 Modified Files: aiodio_append.c Log Message: A patch submitted by Jacky Malcles that fixes the problem where i0_getevents() return value is not checked and may return 0 if no events are available and may generate a SIGSEGV Index: aiodio_append.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/io/ltp-aiodio/aiodio_append.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** aiodio_append.c 19 Apr 2006 22:01:52 -0000 1.2 --- aiodio_append.c 10 Jul 2006 19:27:52 -0000 1.3 *************** *** 141,145 **** n = io_getevents(myctx, 1, 1, &event, &timeout); ! iocbp = (struct iocb *)event.obj; if( n > 0){ --- 141,146 ---- n = io_getevents(myctx, 1, 1, &event, &timeout); ! if (n > 0) { ! iocbp = (struct iocb *)event.obj; if( n > 0){ *************** *** 148,152 **** if ((w = io_submit(myctx, 1, &iocbp)) < 0) { fprintf(stderr, "write %d returned %d\n", i, w); ! } } } --- 149,154 ---- if ((w = io_submit(myctx, 1, &iocbp)) < 0) { fprintf(stderr, "write %d returned %d\n", i, w); ! } ! } } } |