bug-commoncpp
[Top][All Lists]
Advanced

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

Segmentation fault when deleting TTYStream object


From: pendledrake
Subject: Segmentation fault when deleting TTYStream object
Date: Thu, 20 May 2004 13:45:22 +0200
User-agent: Mozilla Thunderbird 0.6 (Windows/20040502)

I get a segmentation fault when I delete an object derived from a TTYStream.
The attached patch fix it.
System: commoncpp 1.1.8, SuSE 7.1, Linux 2.4.7 i686, gcc 2.95.3

Strangely, I got no segfault with commoncpp 1.1.1, though I can't see
the reason in the source.

Greetings,
Jens Theeß


--- commoncpp2-1.1.8/src/serial.cpp     Thu May 13 18:39:22 2004
+++ commoncpp2-1.1.8.patched/src/serial.cpp     Tue May 18 15:01:41 2004
@@ -277,7 +277,7 @@
        if(original)
                delete (DCB *)original;
 #else
-       if(dev < 0)
+       if(dev < 0 && original)
                tcsetattr(dev, TCSANOW, (struct termios *)original);
 
        if(current)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]