Program: 172298
Project: 172298
Buggy source:
/** 
 * Run the Winsock NetBIOS listen code
 * @exception Exception If an unhandled error occurs
 */
private final void runWinsock() throws Exception {
  if (logger.isDebugEnabled() && hasDebug())   logger.debug("String_Node_Str");
  NetBIOSSocket sessSock=null;
  try {
    sessSock=m_nbSocket.listen();
  }
 catch (  WinsockNetBIOSException ex) {
    if (ex.getErrorCode() == WinsockError.WsaENetDown) {
      if (isLANAOnline(m_lana) == false) {
        if (m_nbSocket != null) {
          m_nbSocket.closeSocket();
          m_nbSocket=null;
        }
        if (m_wksSocket != null) {
          m_wksSocket.closeSocket();
          m_wksSocket=null;
        }
        m_lanaValid=false;
        if (logger.isDebugEnabled() && hasDebug())         logger.debug("String_Node_Str" + m_lana);
      }
    }
 else {
      if (hasShutdown() == false && logger.isDebugEnabled() && hasDebug())       logger.debug("String_Node_Str" + ex.getMessage());
    }
  }
  if (hasShutdown())   return;
  if (sessSock != null) {
    try {
      if (logger.isDebugEnabled() && hasDebug())       logger.debug("String_Node_Str" + sessSock.getName());
      PacketHandler pktHandler=new WinsockNetBIOSPacketHandler(m_lana,sessSock);
      SMBSrvSession srvSess=new SMBSrvSession(pktHandler,getServer());
      srvSess.setSessionId(getNextSessionId());
      srvSess.setUniqueId(pktHandler.getShortName() + srvSess.getSessionId());
      srvSess.setDebugPrefix("String_Node_Str" + pktHandler.getShortName() + srvSess.getSessionId()+ "String_Node_Str");
      getServer().addSession(srvSess);
      Thread srvThread=new Thread(THREAD_GROUP_SESSION,srvSess);
      srvThread.setDaemon(true);
      srvThread.setName("String_Node_Str" + srvSess.getSessionId());
      srvThread.start();
    }
 catch (    Exception ex) {
      if (logger.isDebugEnabled() && hasDebug())       logger.debug("String_Node_Str" + ex.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Run the Winsock NetBIOS listen code
 * @exception Exception If an unhandled error occurs
 */
private final void runWinsock() throws Exception {
  if (logger.isDebugEnabled() && hasDebug())   logger.debug("String_Node_Str");
  NetBIOSSocket sessSock=null;
  try {
    sessSock=m_nbSocket.listen();
  }
 catch (  WinsockNetBIOSException ex) {
    if (ex.getErrorCode() == WinsockError.WsaENetDown) {
      if (isLANAOnline(m_lana) == false) {
        if (m_nbSocket != null) {
          m_nbSocket.closeSocket();
          m_nbSocket=null;
        }
        if (m_wksSocket != null) {
          m_wksSocket.closeSocket();
          m_wksSocket=null;
        }
        m_lanaValid=false;
        if (logger.isDebugEnabled() && hasDebug())         logger.debug("String_Node_Str" + m_lana);
      }
    }
 else {
      if (hasShutdown() == false && logger.isDebugEnabled() && hasDebug())       logger.debug("String_Node_Str" + ex.getMessage());
    }
  }
  if (hasShutdown())   return;
  if (sessSock != null) {
    try {
      if (logger.isDebugEnabled() && hasDebug())       logger.debug("String_Node_Str" + sessSock.getName());
      PacketHandler pktHandler=new WinsockNetBIOSPacketHandler(m_lana,sessSock);
      SMBSrvSession srvSess=new SMBSrvSession(pktHandler,getServer());
      srvSess.setSessionId(getNextSessionId());
      srvSess.setUniqueId(pktHandler.getShortName() + srvSess.getSessionId());
      getServer().addSession(srvSess);
      Thread srvThread=new Thread(THREAD_GROUP_SESSION,srvSess);
      srvThread.setDaemon(true);
      srvThread.setName("String_Node_Str" + srvSess.getSessionId());
      srvThread.start();
    }
 catch (    Exception ex) {
      if (logger.isDebugEnabled() && hasDebug())       logger.debug("String_Node_Str" + ex.toString());
    }
  }
}