Re: FreeBSD Security Advisory FreeBSD-SA-05:01.telnet

From: Jacques A. Vidrine (nectar_at_FreeBSD.org)
Date: 04/01/05

  • Next message: Jacques A. Vidrine: "Security Officer-supported branches update"
    Date: Fri, 1 Apr 2005 08:18:33 -0600
    To: Roberto <roberto.trovo@redix.it>
    
    

    On Fri, Apr 01, 2005 at 09:29:48AM +0200, Roberto wrote:
    > Actually I've not read the code,

    Then why are you posting your opinion about it? (^_^)

    I guess I'm responding to your post only to prevent others from worrying
    about a non-existent ``problem''.

    > but from these email it seems to me that
    > someone could be confused by this code (at least Steve and I); for example
    > refer to the address "&slc_reply[128];" when slc_reply[127] is the last
    > element.

    There is no reference to ``&slc_reply[128]''. There *is* a pointer
    initialized to the equivalent expression
    ``&slc_reply[sizeof(slc_reply)]'', which is the usual way to designate
    the end of a sequence. For example,

       char buf[...];
       const char *eom = &buf[sizeof(buf)];

       while (p < eom) /* `*p' is valid */;
       size_t n = eom - p; /* There are `n' bytes left */

    If we used a pointer to the last element (instead of one beyond the last
    element), we'd need to adjust many expressions by 1, which is
    error-prone and ugly.

    > I do not want to be offensive in any way, what I want to say is that this
    > code is clear to you (and the person who wrote it) but the next programmer
    > that will reuse the code (because this is a open source) could make a
    > mistake.
    >
    > I think many bugs can derive from code not easy to understand.
    >
    > This is only my opinion.

    I find the tests fairly idiomatic and I find it easy to see their
    correctness. I doubt I'm alone. The suggested fix was reviewed by a
    number of coders from several open source operating system projects and
    caused no confusion. The form was chosen to clearly show how many bytes
    were expected to be written at that point. IMHO, using alternative
    forms invites off-by-one errors.

           if (&slc_replyp[6+2] > slc_reply_eom)
                   return;
           /* past this point, we can write 6+2 bytes, slc_replyp[0]
            * through slc_replyp[7].
            */

    Cheers,

    -- 
    Jacques A Vidrine / NTT/Verio
    nectar@celabo.org / jvidrine@verio.net / nectar@FreeBSD.org
    _______________________________________________
    freebsd-security@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-security
    To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"
    

  • Next message: Jacques A. Vidrine: "Security Officer-supported branches update"

    Relevant Pages

    • Re: FyRE, Im Curious About You Too...
      ... you have a political opinion that open source is ... >software for which better, open source alternatives exist. ... >and configure a SCO product, even if they wrote decent software. ... I advise my customers to be aware of available alternatives, ...
      (comp.unix.sco.misc)
    • Re: Future of Dolphin revisited
      ... I'm a strong advocate to the open source software and I like its principles and strongly dislike the Microsoft policies, but I understand perfectly that a small company as OA may not have option. ... I'm really grateful to Andy by his help to me when I started with Dolphin. ... In my personal opinion, another big concern is precisely Microsoft, and their position respect the not Microsoft development tools. ...
      (comp.lang.smalltalk.dolphin)
    • Re: FyRE, Im Curious About You Too...
      ... >>That experience polarized my opinion of proprietary OS' so much that I ... you have a political opinion that open source is ... developing a "group chat" system using java and a proprietory back-end ... and configure a SCO product, even if they wrote decent software. ...
      (comp.unix.sco.misc)
    • Re: Delphi 8 common quality
      ... >> I am. I'm saying that the form of QC helps people give the information ... >> required to make their bug report useful. ... >> What I say is of course my opinion. ... The confusion seems to exist on your side only. ...
      (borland.public.delphi.non-technical)
    • Re: The _REAL_ media center
      ... >I have no doubt that some of the Linux PVRs are indeed useful. ... >off trying out the Open Source alternatives first. ... in my opinion: Media Center ... and that is in my opinion unique to XP ...
      (microsoft.public.windows.mediacenter)