Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] result_normal_plus[2]='\0' likely clobbers payload



>>>>> "Jim" == Jim  <jep200404@example.com> writes:

    Jim> "Stephen J. Turnbull" wrote:

    >> Have you tried

    >> result_normal_plus[2] = '\0'; printf ("header = '%s'\n",
    >> result_normal_plus);

    Jim> Unless a backup copy of result_normal_plus[2] is made first,
    Jim> result_normal_plus[2]='\0'; is likely to clobber the binary
    Jim> data payload.

Be careful!  If the double is normalized, it's *guaranteed* to clobber
the data.[1]

But this nuisance code is not going to be in the production version
anyway, it's just a check.



Footnotes: 
[1]  sez the 48-year-old snot-nosed brat. :-)

-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links