BufferOverflowException的目的是什么

时间:2015-06-25 21:29:28

标签: queue

我不太了解BufferOverflowException()的含义/目的; 在我的课程中,我们使用它来编码队列,同时在队列中添加元素,我们使用BufferOverflowException。

根据docs.oracle,它表示"当相对put操作达到目标缓冲区的限制时抛出未经检查的异常。"我仍然不明白它的含义。

<html lang="en" class="app">
<head>
  <meta charset="utf-8" />
  <title>Ron Help</title>
  <meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
  <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

  <!-- Optional theme -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
</head>
<body class="">

<div class="modal fade" id="mypop" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        </div>

      <div class="modal-body">
        <h4>We are unable to locate your device.</h4>
        <h4>Please select your country and language.</h4>
        <div class="form-group col-lg-12 col-md-12 col-xs-12 no_padding">
                <div class="no_padding">
            <label>My Country:</label>
            <select name="countries_popup" id="countries_popup" class="selectBox">
            <option selected="selected">Choose country</option>
                <option>Austria</option>
                <option>United Kingdom</option>
                <option>Ireland</option>
                <option>Romania</option>
            </select>
            </div>
            </div>
            <br>
            <div class="form-group col-lg-12 col-md-12 col-xs-12 no_padding">
                <div class="no_padding">
            <label>My language:</label>
            <select name="language_popup" id="language_popup" class="selectBox">
            <option selected="selected">Choose language</option>
                <option>Austria</option>
                <option>United Kingdom</option>
                <option>Ireland</option>
                <option>Romania</option>
            </select>
            </div>
            </div>

      </div>
      <div class="modal-footer">

        <button type="button" class="btn btn-primary col-xs-12 col-sm-6 gonext">Next</button>
      </div>
    </div>
  </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript">
  $(window).load(function(){ 
  console.log("popup")
  $("#mypop").modal();

       $('.gonext').click(function(){
            var countriesValue = $('select#countries_popup option:selected').val();
           var languageValue = $('select#language_popup option:selected').val();



           $('#countries option').filter(function() { 
                  return ($(this).text() == countriesValue);

              }).prop('selected', true);
           $('#countries option,#language option').prop('disabled', true);
           $('#language option').filter(function() { 
                  return ($(this).text() == languageValue); 
              }).prop('selected', true);


          $('.modal-open #mypop,.modal-backdrop.fade.in').hide();
          $('body').removeClass('modal-open');

       });
  });
</script>
</body>    
</html>

1 个答案:

答案 0 :(得分:1)

缓冲区溢出意味着为应用程序提供了太多数据

示例:将图书文本复制到手机上的“新联系人姓名”。

通常,如果处理不当,则会导致 chrash ...
更重要的是,它可能是一个安全漏洞

额外数据可以存储在程序指定内存之外,额外数据可以是可执行代码。

因此,始终验证用户输入是一种好习惯! :)