home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / folklore / computer / 16651 < prev    next >
Encoding:
Text File  |  1992-11-23  |  1.9 KB  |  56 lines

  1. Newsgroups: alt.folklore.computers
  2. Path: sparky!uunet!math.fu-berlin.de!Sirius.dfn.de!tubsibr!pvs9
  3. From: pvs9@ibr.cs.tu-bs.de (Praktikum Verteilte Systeme)
  4. Subject: Re: Re:Re:help friendly alien...
  5. Message-ID: <1992Nov23.135859.26478@ibr.cs.tu-bs.de>
  6. Originator: pvs9@eris.ibr.cs.tu-bs.de
  7. Sender: postnntp@ibr.cs.tu-bs.de (nntp inews entry)
  8. Reply-To: pvs9@ibr.cs.tu-bs.de (Praktikum Verteilte Systeme)
  9. Organization: TU Braunschweig, Informatik (Bueltenweg), Germany
  10. Date: Mon, 23 Nov 1992 13:58:59 GMT
  11. Lines: 43
  12.  
  13.  
  14. In article <1992Nov20.191739.3728@osf.org>, dbrooks@osf.org (David Brooks)
  15. writes :
  16.  
  17. [insignificant stuff deleted]
  18.  
  19. }|> 
  20. }|>           ->Xandribuuu = (Rtoff*)malloc(sizeof(h_andrx));
  21. }
  22. }If I were you (which I'm not, having an invalid arm count), I wouldn't
  23. }trust flight-critical software that doesn't test the return value from
  24. }malloc.  Just a minute...
  25. }
  26. }|>           jogg = (GnoBr (xuuuuuuuu, U_XXilef (_Xanshbr_tvn))?xuuuuuuuu->Zu
  27. }:0);
  28. }|>           xuuuuuuuu->_nHung.MxT->rt->Z_7->__0b->XanBr_->iu[0] = (jogg%37);
  29. }|>           xuuuuuuuu->Shra = Ndelsef (v_78_K);
  30. }|>           return xuuuuuuuu;
  31. }
  32. }Unles you can prove it is checked after returning from all calls to this
  33. }procedure.
  34. }-- 
  35. }David Brooks                    dbrooks@osf.org
  36. }Open Software Foundation            uunet!osf.org!dbrooks
  37. }All|berall und ewig blauen licht die Fernen!  Ewig... ewig... earwig... 
  38. }O!
  39. }
  40.  
  41. You're bloody right ! That piece of code is really distrustful. When I owned
  42. one of these spaceship, I did not only correct the error in the procedure,
  43. but also built in security checks, in this case I changed the malloc line 
  44. into :
  45.  
  46. pt = (Rtoff*)malloc(sizeof(h_andrx));
  47. if (pt==NULL) fatal_error (387);
  48. xuuuuuuuu->...->Xandribuu = pt;
  49.  
  50. Yes, there is *NO* sufficient error detection and treatment in the z-9999q's
  51. software originally, I had to do it on myself ! And if I hadn't done it, I
  52. wouldn't sit here alive writing these lines.
  53.  
  54. May the SCHWARTZ never leave you alone !
  55.  
  56.