Bugs item #1607899, was opened at 2006-12-03 15:47
Message generated for change (Comment added) made by subrata_modak
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103382&aid=1607899&group_id=3382

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Testcases
Group: System Calls
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Nicolas Dade (ndade)
Assigned to: mreed (mreed10)
Summary: exit02 uses strcmp() on unterminated string

Initial Comment:

ltp/testcases/kernel/syscalls/exit/exit02.c reads 4 bytes from a file into 
rbuf[], then calls strcmp(rbuf, wbuf). This is causing the test to fail not 
because it went wrong but because rbuf did not happen to contain a '\0' at 
rbuf[4].

changing to strncmp() fixed this.

--- ltp-full-20060717/testcases/kernel/syscalls/exit/exit02.c.orig      
2006-12-03 06:59:51.000000000 -0800
+++ ltp-full-20060717/testcases/kernel/syscalls/exit/exit02.c   2006-12-03 
07:41:11.000000000 -0800
@@ -168,7 +168,7 @@
                                        tst_resm(TFAIL, "exit error: file "
                                                 "buffer was not flushed");
                                        rval = 1;
-                               } else if (strcmp(rbuf, wbuf) != 0) {
+                               } else if (strncmp(rbuf, wbuf, len) != 0) {
                                        tst_resm(TFAIL, "exit error: file "
                                                 "buffer was not flushed");
                                        rval = 1;


----------------------------------------------------------------------

>Comment By: Subrata (subrata_modak)
Date: 2007-04-13 11:25

Message:
Logged In: YES 
user_id=1737361
Originator: NO

Fixed

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103382&aid=1607899&group_id=3382

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Ltp-list mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to