Index: src/java/org/apache/lucene/search/Query.java
===================================================================
--- src/java/org/apache/lucene/search/Query.java	(revision 911405)
+++ src/java/org/apache/lucene/search/Query.java	(working copy)
@@ -69,7 +69,7 @@
    *  <li>If the query was created by the parser, the printed
    *  representation may not be exactly what was parsed. For example,
    *  characters that need to be escaped will be represented without
-   *  the required backslash.</li>
+   *  the required backslash.</li>                 
    * <li>Some of the more complicated queries (e.g. span queries)
    *  don't have a representation that can be parsed by QueryParser.</li>
    * </ul>
@@ -99,6 +99,8 @@
     Weight weight = query.createWeight(searcher);
     float sum = weight.sumOfSquaredWeights();
     float norm = getSimilarity(searcher).queryNorm(sum);
+    if (Float.isInfinite(norm) || Float.isNaN(norm))
+      norm = 1.0f;
     weight.normalize(norm);
     return weight;
   }
