Index: /trunk/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/resolv_conf_parser.c	(revision 50669)
+++ /trunk/src/VBox/Devices/Network/slirp/resolv_conf_parser.c	(revision 50670)
@@ -29,4 +29,6 @@
 #include "resolv_conf_parser.h"
 
+/* XXX: it's required to add the aliases for keywords and
+ * types to handle conditions more clearly */
 enum RCP_TOKEN
 {
@@ -38,4 +40,5 @@
   tok_ipv6 = -6, /* ipv6 */
   tok_ipv6_port = -7, /* ipv6 port */
+  /* keywords */
   tok_nameserver = -8, /* nameserver */
   tok_port = -9, /* port, Mac OSX specific */
@@ -382,4 +385,5 @@
  * @note: resolv.conf (5) Linux:
  * "The search list is currently limited to six domains with a total of 256 characters."
+ * @note: 'search' parameter could contains numbers only hex or decimal, 1c1e or 111
  */
 static enum RCP_TOKEN rcp_parse_search(struct rcp_parser *parser)
@@ -393,16 +397,29 @@
     st = parser->rcpp_state;
 
-    /**
-     * We asume that duplication of search list in resolv.conf isn't correct.
-     */
     if (   tok == tok_eof
-        || tok == tok_error
-        || tok != tok_string
-        || st->rcps_searchlist[0] != NULL)
+        || tok == tok_error)
         return tok_error;
 
-    i = 0;
-    trailing = RCPS_BUFFER_SIZE;
-    do {
+    /* just ignore "too many search list" */
+    if (st->rcps_num_searchlist >= RCPS_MAX_SEARCHLIST)
+        return rcp_get_token(parser);
+    
+    /* we don't want accept keywords */
+    if (tok <= tok_nameserver)
+        return tok;
+
+    /* if there're several entries of "search" we compose them together */
+    i = st->rcps_num_searchlist;
+    if ( i == 0)
+        trailing = RCPS_BUFFER_SIZE;
+    else
+    {
+        ptr = st->rcps_searchlist[i - 1];
+        trailing = RCPS_BUFFER_SIZE - (ptr -
+                                       st->rcps_searchlist_buffer + strlen(ptr) + 1);
+    }
+
+    while (1)
+    {
         len = strlen(parser->rcpp_str_buffer);
 
@@ -410,4 +427,7 @@
             break; /* not enough room for new entry */
 
+        if (i >= RCPS_MAX_SEARCHLIST)
+            break; /* not enought free entries for 'search' items */
+
         ptr = st->rcps_searchlist_buffer + RCPS_BUFFER_SIZE - trailing;
         strcpy(ptr, parser->rcpp_str_buffer);
@@ -415,8 +435,13 @@
         trailing -= len + 1; /* 1 reserved for '\0' */
 
-        st->rcps_searchlist[i] = ptr;
-
-    } while(  (tok = rcp_get_token(parser)) == tok_string
-            && ++i != RCPS_MAX_SEARCHLIST);
+        st->rcps_searchlist[i++] = ptr;
+        tok = rcp_get_token(parser);
+
+        /* token filter */
+        if (   tok == tok_eof
+            || tok == tok_error
+            || tok <= tok_nameserver)
+            break;
+    }
 
     st->rcps_num_searchlist = i;
