HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 0423 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 0423.


Report 0423 Actions


    Problem Report Number 0423
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0042
    Raised 1993-11-16 08:00
    Updated 2003-03-13 08:00
    Published null
    Product Standard Internationalised System Calls and Libraries (XPG4)
    Certification Program The Open Brand certification program
    Test Suite VSX4 version 4.2.4
    Test Identification XPG4.os/wstring/wcsncpy 1
    Problem Summary PG4R.042 This test does the following (simplified variable contents are used for illustration): 1. Obtains a "real" wide character string and determines its length. wsfrom = "abcdefghijklm" wslen = length of w...
    Problem Text
    This test does the following (simplified variable contents are used for
    illustration):

    1. Obtains a "real" wide character string and determines its length.

    wsfrom = "abcdefghijklm"
    wslen = length of wsfrom

    2. Mallocs two buffers, wsto and expws. The contents of a malloced
    buffer are indeterminate. (XSH4 page 261)

    wsto = "xxxxxxxxxxxxxxxxxxxxxxxxx"
    expws = "qqqqqqqqqqqqqqqqqqqqqqqqq"

    3. Copies the first wslen wide characters from wsto into expws.

    expws = "xxxxxxxxxxxxxqqqqqqqqqqqq"

    4. Null terminates the wide character string in expws at the point where
    it stopped copying.

    expws = "xxxxxxxxxxxxx"

    5. Calculates 2/3 length of wsfrom.

    num = (2 * wslen) / 3

    6. Copies the first num wide characters from wsfrom into expws.

    expws = "abcdefghxxxxx"

    7. Null terminates the wide character string in expws at the point where
    it stopped copying, and null terminates the wide character string in
    wsfrom at the same point.

    expws = "abcdefgh"
    wsfrom = "abcdefgh"

    8. Calls wcsncpy(wsto, wsfrom, num), and wonders why the wide character
    strings in expws and wsto do not match.

    wsto = "abcdefghxxxxxxxxxxxxxxxxx"
    expws = "abcdefgh"

    The test null terminates the wide character string in expws twice, but
    never null terminates the wide character string in wsto. The VSX test
    description states that the call to wcsncpy() leaves wsto (or s1)
    without a terminating null wide character. Once wcsncpy() copies num wide
    characters into wsto, it is not allowed to add the terminating null wide
    character. (XSH4 page 513) Unless the test itself adds the terminating
    null wide character, it does not get added.

    This test is poorly written. The only way this test could ever pass on
    a conforming implementation is if the malloced buffer pointed to by wsto
    just happens to contain zeroes. For this reason, a permanent waiver is
    requested.
    Test Output
    /tset/XPG4.os/wstring/wcsncpy/T.wcsncpy 1 Failed

    Test Description:
    When s2 has greater than n wide characters in length, then a call to
    wcsncpy() copies n wide characters from string s2 to s1, leaves s1
    without a terminating null wide character and returns s1.

    Test Strategy:
    OBTAIN a sample string of wide characters by calling the routine
    wcharstr().
    SET the locale for LC_ALL to LOCALE1.
    VERIFY that only the number of wide-characters requested are copied
    when the string being copied is longer than the number of wide-
    characters requested.

    Test Information:
    wcsncpy did not copy data correctly
    Current language is WCL1
    Current category is LC_ALL
    expected result : 0x 15e 593c 15f 593d 15f 593d 15e 593c 29f 59ea 27f
    59e9 15f 593d 163 5941 174
    actual result : 0x 15e 593c 15f 593d 15f 593d 15e 593c 29f 59ea 27f
    59e9 15f 593d 163 5941 174 da70 21 da80 21 da90 21 daa0 21 dab0
    21 dac0 21 dad0 21 dae0 21 daf0 21 db00 21 db10 21 db20 21 db30
    21 db40 21 db50 21 db60 21 db70 21 db80 21 db90 21 dba0

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    Pleases refer to TSD4.102.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion
    This request is refused, please refer to TSD4.102.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority