File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -329,13 +329,13 @@ extensions_to_getdnsdict(PyDictObject *pydict)
329329 } else if (!strncmp (tmpoptionlistkey , "option_data" , strlen ("option_data" ))) {
330330 option_data = (struct getdns_bindata * )malloc (sizeof (struct getdns_bindata ));
331331 option_data -> size = PyObject_Length (optiondictvalue );
332+ printf ("XXX size is %d\n" , (int )option_data -> size );
332333#if PY_MAJOR_VERSION >= 3
333- /* This is almost certainly wrong */
334- option_data -> data = (uint8_t * )PyBytes_AsString (PyObject_Bytes (optiondictvalue ));
334+ option_data -> data = (uint8_t * )PyBytes_AS_STRING (optiondictvalue );
335335#else
336- /* ditto */
337- option_data -> data = (uint8_t * )PyString_AsString (PyObject_Bytes (optiondictvalue ));
336+ option_data -> data = (uint8_t * )PyString_AS_STRING (optiondictvalue );
338337#endif
338+
339339 getdns_dict_set_bindata (tmpoptions_list_dict , "option_data" , option_data );
340340 } else {
341341 PyErr_SetString (getdns_error , GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT );
You can’t perform that action at this time.
0 commit comments