[xml] xmlParseMemory core dump



I am using TCP/IP to send XML from one computer to another, as a string of
characters. I then parse it using xmlParseMemory. Unfortunately I have a
small bug in my communication, so sometimes the end of the XML string is
lost, and I call xmlParseMemory with bad XML (Cut short). This makes the
program crash (core dump). Is it "supposed" to be like that, that bad XML
causes a core dump? If so, is there a function I can send the string through
first to check if it is OK? The XML looks like this when it's cut short:

<?xml version="1.0" encoding="UTF-8"?>
<Document SequenceNumber="579986992" Version="2.0"><Service Function="Client
Certificate" FunctionCode="200090"
MessageType="0800"/><Issuer>111999609999010</Issuer><Request><ClientCertific
ate
type="in">MIiDejCCAuOgAwIBAgIBAjANBgkqhkiG9w0BAQQFADB1MQswCQYDVQQGEwJubzESmB
AGA1UECBMJaG9yZGFsYW5kMRcwFQYDVQQKEw5lZGIgZmVsbGVzZGF0YTELMAkGA1UECxMCdHUxDj
AMBgNVBAMTBXNzYWRtMRwwGgYJKoZIhvcNAQkBFg1zc2FkbUBlZGIuY29tMB4XDTAyMDExNTE1MD
Q1MloXDTAzMDExNTE1MDQ1MlowfTELMAkGA1UEBHMCbm8xEjAQBgNVBAgTCWhvcmRhbGFuZDEXMB
UGA1UEChMOZWRiIGZlbGxlc2RhdGExCzAJBgNVBAsTAnR1MRIwEAYDVQQDEwlzc2xjbGllbnQxID
AeBgkqhkiG9w0BCQEWEXNzbGNsaWVudEBlZgiUY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ
KBgQDsiIz6B9HYV66sOpvGyKUFKVNMjzV6uyPUizjy1FGCkMlZuG5M01JrhYO4ujYQbsDi7Kv18i
86csqe+Sv2gMgQX44yWRYdo4m2CrwmeTD9bNo5jKe1qgoV74pEvkvzwxsGCVuLtHZ85uNYkdFfOz
b+k3Zp3r9bjcv3QQ/5PYvsyQIDAQABo4IBEDCCAQwwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHx
YdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFDhktOXsXLgR2H0Pzk3fSd
HEQq3tMIGxBgNVHSMEgakwgaaAFBE/Qd3taqm/RNNIZ6eEnqg7b6l1oYGKpIGHMIGEMQswCQYDVQ
QGEwJubzESMBAGA1UECBMJaG9yZGFsYW5kMQ8wDQYDVQQHEwZiZXJnZW4xFzAVBgNVBAoTDmVkYi
BmZWxsZXNkYXRhMQswCQYDVQQLEwJ0dTENMAsGA1UEAxMEc3NjYTEbMBkGCSqGSIb3DQEJARYMc3
NjYUBlZGIuY29tggEBMA0GCSqGSIb3DQEBBAUAA4GBAJvbQM8LgSccqJvPkVz7D2GDO8zBN4VYBe
WCdtsty9AuE1mw3+dFh6gl3bYdTkKYyDoNvRhVwVEtNDCYQweiwFDaOGvF2AmAEcOc5vgxG9pcnq
jTBlBK41Y1jewIFGpK9GvL5uwL2nC3Dz3iN2yRgxMgZyCQsFhSVm+HNuKNTPO+</ClientCertif
icate></Reque

I realise the communication problem is the real problem, but it would be
nice to not have the program core dump :)

Christian Rygg



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