Bugs item #3165083, was opened at 2011-01-25 06:24
Message generated for change (Tracker Item Submitted) made by dalke
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428740&aid=3165083&group_id=40728

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: File Translation
Group: 2.3.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Andrew Dalke (dalke)
Assigned to: Nobody/Anonymous (nobody)
Summary: minor buffer overflow in SMILES parser

Initial Comment:
atomic weight information leaks over into the atomic symbol in 
OBSmilesParser::ParseComplex .

Here are two reproducibles

>>> mol = pybel.readstring("smi", "[987U]")
>>> mol.atoms[0].OBAtom.GetType()
'U87'


>>> pybel.readstring("smi", "[1234z]").write("smi")
==============================
*** Open Babel Warning  in ParseComplex
  Illegal aromatic element z]34

This is because the 'char symbol[7]' is used for isotope parsing then reused 
for symbol parsing but without properly clearing the field.

The solution is to put a memset(symbol, '\0', 7*sizeof(char)) after
    isotope = atoi(symbol);



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428740&aid=3165083&group_id=40728

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to