Commit b8a28fcb authored by Jelte Jansen's avatar Jelte Jansen
Browse files

applied patch for sunstudio problem as described in ticket #271


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@2409 e5f2f494-b856-4b98-b285-d166d9295462
parent e966674a
......@@ -14,7 +14,11 @@
// $Id$
#include <vector>
#include <dns/rrttl.h>
using namespace std;
using namespace isc::dns;
//
......@@ -160,14 +164,15 @@ RRTTL_init(s_RRTTL* self, PyObject* args) {
PyErr_Clear();
self->rrttl = new RRTTL(i);
return (0);
} else if (PyArg_ParseTuple(args, "O", &bytes) && PySequence_Check(bytes)) {
} else if (PyArg_ParseTuple(args, "O", &bytes) &&
PySequence_Check(bytes)) {
Py_ssize_t size = PySequence_Size(bytes);
uint8_t data[size];
int result = readDataFromSequence(data, size, bytes);
vector<uint8_t> data(size);
int result = readDataFromSequence(&data[0], size, bytes);
if (result != 0) {
return (result);
}
InputBuffer ib(data, size);
InputBuffer ib(&data[0], size);
self->rrttl = new RRTTL(ib);
PyErr_Clear();
return (0);
......
......@@ -14,7 +14,11 @@
// $Id$
#include <vector>
#include <dns/rrtype.h>
using namespace std;
using namespace isc::dns;
//
......@@ -203,12 +207,12 @@ RRType_init(s_RRType* self, PyObject* args) {
return (0);
} else if (PyArg_ParseTuple(args, "O", &bytes) && PySequence_Check(bytes)) {
Py_ssize_t size = PySequence_Size(bytes);
uint8_t data[size];
int result = readDataFromSequence(data, size, bytes);
vector<uint8_t> data(size);
int result = readDataFromSequence(&data[0], size, bytes);
if (result != 0) {
return (result);
}
InputBuffer ib(data, size);
InputBuffer ib(&data[0], size);
self->rrtype = new RRType(ib);
PyErr_Clear();
return (0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment