From 094d6eb1e3f699fee222a542eda4959e58f7a3cb Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 10 Jun 2005 17:54:10 +0000 Subject: [PATCH] Fixed NULL ptr refernece that could occur if a client sets negotiation option but do not include character set negotiation record. --- etc/voyager.xml | 5 +++-- src/yaz-proxy.cpp | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/etc/voyager.xml b/etc/voyager.xml index aee91a6..c28da9e 100644 --- a/etc/voyager.xml +++ b/etc/voyager.xml @@ -1,5 +1,5 @@ - + - 2 + 0 @@ -210,4 +210,5 @@ client-requests server-requests + diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 9280b83..45fe382 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy.cpp,v 1.30 2005-06-08 13:29:03 adam Exp $ +/* $Id: yaz-proxy.cpp,v 1.31 2005-06-10 17:54:11 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -2682,13 +2682,15 @@ void Yaz_Proxy::handle_init(Z_APDU *apdu) m_initRequest_maximumRecordSize = *apdu->u.initRequest-> maximumRecordSize; *apdu->u.initRequest->maximumRecordSize = 1024*1024; + + Z_CharSetandLanguageNegotiation *charSetandLangRecord = + yaz_get_charneg_record(*oi); // Save proposal charsets and langs. if (ODR_MASK_GET(apdu->u.initRequest->options, - Z_Options_negotiationModel)) + Z_Options_negotiationModel) + && charSetandLangRecord) { - Z_CharSetandLanguageNegotiation *charSetandLangRecord = - yaz_get_charneg_record(*oi); yaz_get_proposal_charneg(m_referenceId_mem, charSetandLangRecord, -- 1.7.10.4