Browse Source

fix scan-build bug/warning in tv_gen

Karel Miko 8 years ago
parent
commit
3ddb45a6b7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      demos/tv_gen.c

+ 4 - 0
demos/tv_gen.c

@@ -527,6 +527,10 @@ void ccm_gen(void)
             printf("Error CCM'ing: %s\n", error_to_string(err));
             exit(EXIT_FAILURE);
          }
+         if (len == 0) {
+            printf("Error CCM'ing: zero length\n");
+            exit(EXIT_FAILURE);
+         }
          fprintf(out, "%3d: ", y1);
          for (z = 0; z < y1; z++) {
             fprintf(out, "%02X", plaintext[z]);