VirtualBox

Changeset 36638 in vbox


Ignore:
Timestamp:
Apr 11, 2011 9:51:59 AM (13 years ago)
Author:
vboxsync
Message:

addendum to r71078: there is another limit of 15 bytes required

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/string.h

    r36625 r36638  
    24292429
    24302430/** The maximum size argument of a memchr call. */
    2431 #define RTSTR_MEMCHR_MAX            (~(size_t)0 >> 1)
     2431#define RTSTR_MEMCHR_MAX            ((~(size_t)0 >> 1) - 15)
    24322432
    24332433/**
     
    24432443DECLINLINE(char const *) RTStrEnd(char const *pszString, size_t cchMax)
    24442444{
    2445     /* Avoid potential issues with memchr seen in glibc. */
    2446     if (cchMax > RTSTR_MEMCHR_MAX)
     2445    /* Avoid potential issues with memchr seen in glibc.
     2446     * See sysdeps/x86_64/memchr.S in glibc versions older than 2.11 */
     2447    while (cchMax > RTSTR_MEMCHR_MAX)
    24472448    {
    24482449        char const *pszRet = (char const *)memchr(pszString, '\0', RTSTR_MEMCHR_MAX);
     
    24602461#endif
    24612462{
    2462     /* Avoid potential issues with memchr seen in glibc. */
    2463     if (cchMax > RTSTR_MEMCHR_MAX)
     2463    /* Avoid potential issues with memchr seen in glibc.
     2464     * See sysdeps/x86_64/memchr.S in glibc versions older than 2.11 */
     2465    while (cchMax > RTSTR_MEMCHR_MAX)
    24642466    {
    24652467        char *pszRet = (char *)memchr(pszString, '\0', RTSTR_MEMCHR_MAX);
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp

    r36529 r36638  
    5858DECLINLINE(char const *) RTStrEnd(char const *pszString, size_t cchMax)
    5959{
    60     /* Avoid potential issues with memchr seen in glibc. */
    61     if (cchMax > RTSTR_MEMCHR_MAX)
     60    /* Avoid potential issues with memchr seen in glibc.
     61     * See sysdeps/x86_64/memchr.S in glibc versions older than 2.11 */
     62    while (cchMax > RTSTR_MEMCHR_MAX)
    6263    {
    6364        char const *pszRet = (char const *)memchr(pszString, '\0', RTSTR_MEMCHR_MAX);
     
    7273DECLINLINE(char *) RTStrEnd(char *pszString, size_t cchMax)
    7374{
    74     /* Avoid potential issues with memchr seen in glibc. */
    75     if (cchMax > RTSTR_MEMCHR_MAX)
     75    /* Avoid potential issues with memchr seen in glibc.
     76     * See sysdeps/x86_64/memchr.S in glibc versions older than 2.11 */
     77    while (cchMax > RTSTR_MEMCHR_MAX)
    7678    {
    7779        char *pszRet = (char *)memchr(pszString, '\0', RTSTR_MEMCHR_MAX);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette