File: python-iwlib/iwlib.c
Function: get_iwconfig
Error: ob_refcnt of PyStringObject is 1 too high
184 static PyObject *
185 get_iwconfig (PyObject * self, PyObject * args)
186 {
187   char *devname;
188   int skfd;		/* generic raw socket desc.	*/
189   char buffer[1024];
190   int eno = 0;
191   struct wireless_info	info;
192   PyObject * dict;
193     
194   if (!PyArg_ParseTuple(args, "s", &devname)) {
when PyArg_ParseTuple() succeeds
taking False path
195     return NULL;
196   }
197 
198   /* Create a channel to the NET kernel. */
199   if((skfd = iw_sockets_open()) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
200     eno = errno;
201     sprintf(buffer, "iw_sockets_open [Errno %d] %s", eno, strerror(eno));
202     PyErr_SetString(PyExc_IOError, buffer);
203     return NULL;
204   }
205 
206   eno = get_info(skfd, devname, &info);
207 
208   close(skfd);
209 
210   if (eno < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
211     eno = -eno;
212     sprintf(buffer, "get_info [Errno %d] %s", eno, strerror(eno));
213     PyErr_SetString(PyExc_IOError, buffer);
214     return NULL;
215   }
216 
217   dict = PyDict_New();
when PyDict_New() succeeds
218   if (info.b.has_mode)
when considering range: -0x80000000 <= value <= -1
taking True path
219     PyDict_SetItem(dict, PyString_FromString("Mode"), 
when treating unknown const char * const from python-iwlib/iwlib.c:219 as non-NULL
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
PyStringObject allocated at:     PyDict_SetItem(dict, PyString_FromString("Mode"),
ob_refcnt is now refs: 1 + N where N >= 0
ob_refcnt is now refs: 1 + N where N >= 1
220 		   PyString_FromString(iw_operation_mode[info.b.mode]));
221   if (info.b.essid_on) {
when considering range: -0x80000000 <= value <= -1
taking True path
222     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString(info.b.essid));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
223   } else {
224     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString("Auto"));
225   }
226   if (info.b.has_nwid) {
when considering range: -0x80000000 <= value <= -1
taking True path
227     if(info.b.nwid.disabled)
when considering value == (__u8)0 from python-iwlib/iwlib.c:227
taking False path
228       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromString("Auto"));
229     else
230       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromFormat("%X", info.b.nwid.value));
when PyString_FromFormat() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
231   }
232 
233   /* Display frequency / channel */
234   if(info.b.has_freq)
when considering range: -0x80000000 <= value <= -1
taking True path
235     {
236       iw_print_freq_value(buffer, sizeof(buffer), info.b.freq);
237       PyDict_SetItem(dict, PyString_FromString("Frequency"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
238     }
239 
240   /* Display the address of the current Access Point */
241   if(info.has_ap_addr)
when considering range: -0x80000000 <= value <= -1
taking True path
242     {
243       iw_saether_ntop((struct sockaddr *)info.ap_addr.sa_data, buffer);
244       /* Oups ! No Access Point in Ad-Hoc mode */
245       if((info.b.has_mode) && (info.b.mode == IW_MODE_ADHOC))
when considering range: -0x80000000 <= value <= -1
taking True path
when considering range: -0x80000000 <= value <= 0
taking False path
246 	PyDict_SetItem(dict, PyString_FromString("Cell"), PyString_FromString(buffer));
247       else
248 	PyDict_SetItem(dict, PyString_FromString("Access Point"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
249     }
250 
251   /* Display the currently used/set bit-rate */
252   if(info.has_bitrate)
when considering range: -0x80000000 <= value <= -1
taking True path
253     {
254       /* Display it */
255       iw_print_bitrate(buffer, sizeof(buffer), info.bitrate.value);
256       PyDict_SetItem(dict, PyString_FromString("BitRate"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
257 /*       printf("Bit Rate%c%s   ", (info.bitrate.fixed ? '=' : ':'), buffer); */
258     }
259 
260   /* Display encryption information */
261   /* Note : we display only the "current" key, use iwlist to list all keys */
262   if(info.b.has_key)
when considering range: 1 <= value <= 0x7fffffff
taking True path
263     {
264       if((info.b.key_flags & IW_ENCODE_DISABLED) || (info.b.key_size == 0))
when considering value == (int)0 from python-iwlib/iwlib.c:264
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
265 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString("off"));
266       else
267 	{
268 	  /* Display the key */
269 	  iw_print_key(buffer, sizeof(buffer), info.b.key, info.b.key_size, info.b.key_flags);
270 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
271 
272   	} 
273     }
274 
275   return(dict);
276 
277 }
ob_refcnt of PyStringObject is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 179 similar trace(s) to this

File: python-iwlib/iwlib.c
Function: get_iwconfig
Error: calling PyDict_SetItem with NULL as argument 2 (D.15549) at python-iwlib/iwlib.c:270
184 static PyObject *
185 get_iwconfig (PyObject * self, PyObject * args)
186 {
187   char *devname;
188   int skfd;		/* generic raw socket desc.	*/
189   char buffer[1024];
190   int eno = 0;
191   struct wireless_info	info;
192   PyObject * dict;
193     
194   if (!PyArg_ParseTuple(args, "s", &devname)) {
when PyArg_ParseTuple() succeeds
taking False path
195     return NULL;
196   }
197 
198   /* Create a channel to the NET kernel. */
199   if((skfd = iw_sockets_open()) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
200     eno = errno;
201     sprintf(buffer, "iw_sockets_open [Errno %d] %s", eno, strerror(eno));
202     PyErr_SetString(PyExc_IOError, buffer);
203     return NULL;
204   }
205 
206   eno = get_info(skfd, devname, &info);
207 
208   close(skfd);
209 
210   if (eno < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
211     eno = -eno;
212     sprintf(buffer, "get_info [Errno %d] %s", eno, strerror(eno));
213     PyErr_SetString(PyExc_IOError, buffer);
214     return NULL;
215   }
216 
217   dict = PyDict_New();
when PyDict_New() succeeds
218   if (info.b.has_mode)
when considering range: -0x80000000 <= value <= -1
taking True path
219     PyDict_SetItem(dict, PyString_FromString("Mode"), 
when treating unknown const char * const from python-iwlib/iwlib.c:219 as non-NULL
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
220 		   PyString_FromString(iw_operation_mode[info.b.mode]));
221   if (info.b.essid_on) {
when considering range: -0x80000000 <= value <= -1
taking True path
222     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString(info.b.essid));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
223   } else {
224     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString("Auto"));
225   }
226   if (info.b.has_nwid) {
when considering range: -0x80000000 <= value <= -1
taking True path
227     if(info.b.nwid.disabled)
when considering value == (__u8)0 from python-iwlib/iwlib.c:227
taking False path
228       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromString("Auto"));
229     else
230       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromFormat("%X", info.b.nwid.value));
when PyString_FromFormat() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
231   }
232 
233   /* Display frequency / channel */
234   if(info.b.has_freq)
when considering range: -0x80000000 <= value <= -1
taking True path
235     {
236       iw_print_freq_value(buffer, sizeof(buffer), info.b.freq);
237       PyDict_SetItem(dict, PyString_FromString("Frequency"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
238     }
239 
240   /* Display the address of the current Access Point */
241   if(info.has_ap_addr)
when considering range: -0x80000000 <= value <= -1
taking True path
242     {
243       iw_saether_ntop((struct sockaddr *)info.ap_addr.sa_data, buffer);
244       /* Oups ! No Access Point in Ad-Hoc mode */
245       if((info.b.has_mode) && (info.b.mode == IW_MODE_ADHOC))
when considering range: -0x80000000 <= value <= -1
taking True path
when considering range: -0x80000000 <= value <= 0
taking False path
246 	PyDict_SetItem(dict, PyString_FromString("Cell"), PyString_FromString(buffer));
247       else
248 	PyDict_SetItem(dict, PyString_FromString("Access Point"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
249     }
250 
251   /* Display the currently used/set bit-rate */
252   if(info.has_bitrate)
when considering range: -0x80000000 <= value <= -1
taking True path
253     {
254       /* Display it */
255       iw_print_bitrate(buffer, sizeof(buffer), info.bitrate.value);
256       PyDict_SetItem(dict, PyString_FromString("BitRate"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
257 /*       printf("Bit Rate%c%s   ", (info.bitrate.fixed ? '=' : ':'), buffer); */
258     }
259 
260   /* Display encryption information */
261   /* Note : we display only the "current" key, use iwlist to list all keys */
262   if(info.b.has_key)
when considering range: 1 <= value <= 0x7fffffff
taking True path
263     {
264       if((info.b.key_flags & IW_ENCODE_DISABLED) || (info.b.key_size == 0))
when considering value == (int)0 from python-iwlib/iwlib.c:264
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
265 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString("off"));
266       else
267 	{
268 	  /* Display the key */
269 	  iw_print_key(buffer, sizeof(buffer), info.b.key, info.b.key_size, info.b.key_flags);
270 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() fails
calling PyDict_SetItem with NULL as argument 2 (D.15549) at python-iwlib/iwlib.c:270
PyDict_SetItem() invokes Py_TYPE() on the pointer via the PyString_CheckExact() macro, thus accessing (NULL)->ob_type
found 5 similar trace(s) to this
271 
272   	} 
273     }
274 
275   return(dict);
276 
277 }

File: python-iwlib/iwlib.c
Function: get_iwconfig
Error: calling PyDict_SetItem with NULL as argument 3 (D.15548) at python-iwlib/iwlib.c:270
184 static PyObject *
185 get_iwconfig (PyObject * self, PyObject * args)
186 {
187   char *devname;
188   int skfd;		/* generic raw socket desc.	*/
189   char buffer[1024];
190   int eno = 0;
191   struct wireless_info	info;
192   PyObject * dict;
193     
194   if (!PyArg_ParseTuple(args, "s", &devname)) {
when PyArg_ParseTuple() succeeds
taking False path
195     return NULL;
196   }
197 
198   /* Create a channel to the NET kernel. */
199   if((skfd = iw_sockets_open()) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
200     eno = errno;
201     sprintf(buffer, "iw_sockets_open [Errno %d] %s", eno, strerror(eno));
202     PyErr_SetString(PyExc_IOError, buffer);
203     return NULL;
204   }
205 
206   eno = get_info(skfd, devname, &info);
207 
208   close(skfd);
209 
210   if (eno < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
211     eno = -eno;
212     sprintf(buffer, "get_info [Errno %d] %s", eno, strerror(eno));
213     PyErr_SetString(PyExc_IOError, buffer);
214     return NULL;
215   }
216 
217   dict = PyDict_New();
when PyDict_New() succeeds
218   if (info.b.has_mode)
when considering range: -0x80000000 <= value <= -1
taking True path
219     PyDict_SetItem(dict, PyString_FromString("Mode"), 
when treating unknown const char * const from python-iwlib/iwlib.c:219 as non-NULL
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
220 		   PyString_FromString(iw_operation_mode[info.b.mode]));
221   if (info.b.essid_on) {
when considering range: -0x80000000 <= value <= -1
taking True path
222     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString(info.b.essid));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
223   } else {
224     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString("Auto"));
225   }
226   if (info.b.has_nwid) {
when considering range: -0x80000000 <= value <= -1
taking True path
227     if(info.b.nwid.disabled)
when considering value == (__u8)0 from python-iwlib/iwlib.c:227
taking False path
228       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromString("Auto"));
229     else
230       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromFormat("%X", info.b.nwid.value));
when PyString_FromFormat() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
231   }
232 
233   /* Display frequency / channel */
234   if(info.b.has_freq)
when considering range: -0x80000000 <= value <= -1
taking True path
235     {
236       iw_print_freq_value(buffer, sizeof(buffer), info.b.freq);
237       PyDict_SetItem(dict, PyString_FromString("Frequency"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
238     }
239 
240   /* Display the address of the current Access Point */
241   if(info.has_ap_addr)
when considering range: -0x80000000 <= value <= -1
taking True path
242     {
243       iw_saether_ntop((struct sockaddr *)info.ap_addr.sa_data, buffer);
244       /* Oups ! No Access Point in Ad-Hoc mode */
245       if((info.b.has_mode) && (info.b.mode == IW_MODE_ADHOC))
when considering range: -0x80000000 <= value <= -1
taking True path
when considering range: -0x80000000 <= value <= 0
taking False path
246 	PyDict_SetItem(dict, PyString_FromString("Cell"), PyString_FromString(buffer));
247       else
248 	PyDict_SetItem(dict, PyString_FromString("Access Point"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
249     }
250 
251   /* Display the currently used/set bit-rate */
252   if(info.has_bitrate)
when considering range: -0x80000000 <= value <= -1
taking True path
253     {
254       /* Display it */
255       iw_print_bitrate(buffer, sizeof(buffer), info.bitrate.value);
256       PyDict_SetItem(dict, PyString_FromString("BitRate"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
257 /*       printf("Bit Rate%c%s   ", (info.bitrate.fixed ? '=' : ':'), buffer); */
258     }
259 
260   /* Display encryption information */
261   /* Note : we display only the "current" key, use iwlist to list all keys */
262   if(info.b.has_key)
when considering range: 1 <= value <= 0x7fffffff
taking True path
263     {
264       if((info.b.key_flags & IW_ENCODE_DISABLED) || (info.b.key_size == 0))
when considering value == (int)0 from python-iwlib/iwlib.c:264
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
265 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString("off"));
266       else
267 	{
268 	  /* Display the key */
269 	  iw_print_key(buffer, sizeof(buffer), info.b.key, info.b.key_size, info.b.key_flags);
270 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString(buffer));
when PyString_FromString() fails
when PyString_FromString() succeeds
calling PyDict_SetItem with NULL as argument 3 (D.15548) at python-iwlib/iwlib.c:270
PyDict_SetItem() invokes Py_INCREF() on the pointer, thus accessing (NULL)->ob_refcnt
found 2 similar trace(s) to this
271 
272   	} 
273     }
274 
275   return(dict);
276 
277 }

File: python-iwlib/iwlib.c
Function: get_iwconfig
Error: calling PyDict_SetItem with NULL as argument 2 (D.15547) at python-iwlib/iwlib.c:265
184 static PyObject *
185 get_iwconfig (PyObject * self, PyObject * args)
186 {
187   char *devname;
188   int skfd;		/* generic raw socket desc.	*/
189   char buffer[1024];
190   int eno = 0;
191   struct wireless_info	info;
192   PyObject * dict;
193     
194   if (!PyArg_ParseTuple(args, "s", &devname)) {
when PyArg_ParseTuple() succeeds
taking False path
195     return NULL;
196   }
197 
198   /* Create a channel to the NET kernel. */
199   if((skfd = iw_sockets_open()) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
200     eno = errno;
201     sprintf(buffer, "iw_sockets_open [Errno %d] %s", eno, strerror(eno));
202     PyErr_SetString(PyExc_IOError, buffer);
203     return NULL;
204   }
205 
206   eno = get_info(skfd, devname, &info);
207 
208   close(skfd);
209 
210   if (eno < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
211     eno = -eno;
212     sprintf(buffer, "get_info [Errno %d] %s", eno, strerror(eno));
213     PyErr_SetString(PyExc_IOError, buffer);
214     return NULL;
215   }
216 
217   dict = PyDict_New();
when PyDict_New() succeeds
218   if (info.b.has_mode)
when considering range: -0x80000000 <= value <= -1
taking True path
219     PyDict_SetItem(dict, PyString_FromString("Mode"), 
when treating unknown const char * const from python-iwlib/iwlib.c:219 as non-NULL
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
220 		   PyString_FromString(iw_operation_mode[info.b.mode]));
221   if (info.b.essid_on) {
when considering range: -0x80000000 <= value <= -1
taking True path
222     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString(info.b.essid));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
223   } else {
224     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString("Auto"));
225   }
226   if (info.b.has_nwid) {
when considering range: -0x80000000 <= value <= -1
taking True path
227     if(info.b.nwid.disabled)
when considering value == (__u8)0 from python-iwlib/iwlib.c:227
taking False path
228       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromString("Auto"));
229     else
230       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromFormat("%X", info.b.nwid.value));
when PyString_FromFormat() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
231   }
232 
233   /* Display frequency / channel */
234   if(info.b.has_freq)
when considering range: -0x80000000 <= value <= -1
taking True path
235     {
236       iw_print_freq_value(buffer, sizeof(buffer), info.b.freq);
237       PyDict_SetItem(dict, PyString_FromString("Frequency"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
238     }
239 
240   /* Display the address of the current Access Point */
241   if(info.has_ap_addr)
when considering range: -0x80000000 <= value <= -1
taking True path
242     {
243       iw_saether_ntop((struct sockaddr *)info.ap_addr.sa_data, buffer);
244       /* Oups ! No Access Point in Ad-Hoc mode */
245       if((info.b.has_mode) && (info.b.mode == IW_MODE_ADHOC))
when considering range: -0x80000000 <= value <= -1
taking True path
when considering range: -0x80000000 <= value <= 0
taking False path
246 	PyDict_SetItem(dict, PyString_FromString("Cell"), PyString_FromString(buffer));
247       else
248 	PyDict_SetItem(dict, PyString_FromString("Access Point"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
249     }
250 
251   /* Display the currently used/set bit-rate */
252   if(info.has_bitrate)
when considering range: -0x80000000 <= value <= -1
taking True path
253     {
254       /* Display it */
255       iw_print_bitrate(buffer, sizeof(buffer), info.bitrate.value);
256       PyDict_SetItem(dict, PyString_FromString("BitRate"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
257 /*       printf("Bit Rate%c%s   ", (info.bitrate.fixed ? '=' : ':'), buffer); */
258     }
259 
260   /* Display encryption information */
261   /* Note : we display only the "current" key, use iwlist to list all keys */
262   if(info.b.has_key)
when considering range: 1 <= value <= 0x7fffffff
taking True path
263     {
264       if((info.b.key_flags & IW_ENCODE_DISABLED) || (info.b.key_size == 0))
when considering value == (int)0 from python-iwlib/iwlib.c:264
taking False path
when considering value == (int)0 from python-iwlib/iwlib.c:264
taking True path
265 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString("off"));
when PyString_FromString() succeeds
when PyString_FromString() fails
calling PyDict_SetItem with NULL as argument 2 (D.15547) at python-iwlib/iwlib.c:265
PyDict_SetItem() invokes Py_TYPE() on the pointer via the PyString_CheckExact() macro, thus accessing (NULL)->ob_type
found 5 similar trace(s) to this
266       else
267 	{
268 	  /* Display the key */
269 	  iw_print_key(buffer, sizeof(buffer), info.b.key, info.b.key_size, info.b.key_flags);
270 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString(buffer));
271 
272   	} 
273     }
274 
275   return(dict);
276 
277 }

File: python-iwlib/iwlib.c
Function: get_iwconfig
Error: calling PyDict_SetItem with NULL as argument 3 (D.15546) at python-iwlib/iwlib.c:265
184 static PyObject *
185 get_iwconfig (PyObject * self, PyObject * args)
186 {
187   char *devname;
188   int skfd;		/* generic raw socket desc.	*/
189   char buffer[1024];
190   int eno = 0;
191   struct wireless_info	info;
192   PyObject * dict;
193     
194   if (!PyArg_ParseTuple(args, "s", &devname)) {
when PyArg_ParseTuple() succeeds
taking False path
195     return NULL;
196   }
197 
198   /* Create a channel to the NET kernel. */
199   if((skfd = iw_sockets_open()) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
200     eno = errno;
201     sprintf(buffer, "iw_sockets_open [Errno %d] %s", eno, strerror(eno));
202     PyErr_SetString(PyExc_IOError, buffer);
203     return NULL;
204   }
205 
206   eno = get_info(skfd, devname, &info);
207 
208   close(skfd);
209 
210   if (eno < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
211     eno = -eno;
212     sprintf(buffer, "get_info [Errno %d] %s", eno, strerror(eno));
213     PyErr_SetString(PyExc_IOError, buffer);
214     return NULL;
215   }
216 
217   dict = PyDict_New();
when PyDict_New() succeeds
218   if (info.b.has_mode)
when considering range: -0x80000000 <= value <= -1
taking True path
219     PyDict_SetItem(dict, PyString_FromString("Mode"), 
when treating unknown const char * const from python-iwlib/iwlib.c:219 as non-NULL
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
220 		   PyString_FromString(iw_operation_mode[info.b.mode]));
221   if (info.b.essid_on) {
when considering range: -0x80000000 <= value <= -1
taking True path
222     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString(info.b.essid));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
223   } else {
224     PyDict_SetItem(dict, PyString_FromString("ESSID"), PyString_FromString("Auto"));
225   }
226   if (info.b.has_nwid) {
when considering range: -0x80000000 <= value <= -1
taking True path
227     if(info.b.nwid.disabled)
when considering value == (__u8)0 from python-iwlib/iwlib.c:227
taking False path
228       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromString("Auto"));
229     else
230       PyDict_SetItem(dict, PyString_FromString("NWID"), PyString_FromFormat("%X", info.b.nwid.value));
when PyString_FromFormat() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
231   }
232 
233   /* Display frequency / channel */
234   if(info.b.has_freq)
when considering range: -0x80000000 <= value <= -1
taking True path
235     {
236       iw_print_freq_value(buffer, sizeof(buffer), info.b.freq);
237       PyDict_SetItem(dict, PyString_FromString("Frequency"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
238     }
239 
240   /* Display the address of the current Access Point */
241   if(info.has_ap_addr)
when considering range: -0x80000000 <= value <= -1
taking True path
242     {
243       iw_saether_ntop((struct sockaddr *)info.ap_addr.sa_data, buffer);
244       /* Oups ! No Access Point in Ad-Hoc mode */
245       if((info.b.has_mode) && (info.b.mode == IW_MODE_ADHOC))
when considering range: -0x80000000 <= value <= -1
taking True path
when considering range: -0x80000000 <= value <= 0
taking False path
246 	PyDict_SetItem(dict, PyString_FromString("Cell"), PyString_FromString(buffer));
247       else
248 	PyDict_SetItem(dict, PyString_FromString("Access Point"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
249     }
250 
251   /* Display the currently used/set bit-rate */
252   if(info.has_bitrate)
when considering range: -0x80000000 <= value <= -1
taking True path
253     {
254       /* Display it */
255       iw_print_bitrate(buffer, sizeof(buffer), info.bitrate.value);
256       PyDict_SetItem(dict, PyString_FromString("BitRate"), PyString_FromString(buffer));
when PyString_FromString() succeeds
when PyString_FromString() succeeds
when PyDict_SetItem() succeeds
257 /*       printf("Bit Rate%c%s   ", (info.bitrate.fixed ? '=' : ':'), buffer); */
258     }
259 
260   /* Display encryption information */
261   /* Note : we display only the "current" key, use iwlist to list all keys */
262   if(info.b.has_key)
when considering range: 1 <= value <= 0x7fffffff
taking True path
263     {
264       if((info.b.key_flags & IW_ENCODE_DISABLED) || (info.b.key_size == 0))
when considering value == (int)0 from python-iwlib/iwlib.c:264
taking False path
when considering value == (int)0 from python-iwlib/iwlib.c:264
taking True path
265 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString("off"));
when PyString_FromString() fails
when PyString_FromString() succeeds
calling PyDict_SetItem with NULL as argument 3 (D.15546) at python-iwlib/iwlib.c:265
PyDict_SetItem() invokes Py_INCREF() on the pointer, thus accessing (NULL)->ob_refcnt
found 2 similar trace(s) to this
266       else
267 	{
268 	  /* Display the key */
269 	  iw_print_key(buffer, sizeof(buffer), info.b.key, info.b.key_size, info.b.key_flags);
270 	PyDict_SetItem(dict, PyString_FromString("Key"), PyString_FromString(buffer));
271 
272   	} 
273     }
274 
275   return(dict);
276 
277 }