]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix double initialization 462/head
authorSergei Ianovich <sergei.ianovich@ya.ru>
Tue, 30 Jul 2024 15:04:04 +0000 (15:04 +0000)
committerSergei Ianovich <sergei.ianovich@ya.ru>
Tue, 30 Jul 2024 15:04:04 +0000 (15:04 +0000)
Infer correctly complains that `ptr` is initialized twice before first
use. The fix is trivial.
```
gost12sum.c:253: error: Dead Store
  The value written to `&ptr` is never used.
  251. {
  252.     int i, len;
  253.     char *ptr = filename;
           ^
  254.     char *spacepos = NULL;
  255.
```

gost12sum.c

index e644a613b1285dda78f896eb4e220e8a0b287da7..7e443d30d0e06383cf46ecc922661faa4d37988f 100644 (file)
@@ -250,7 +250,7 @@ int hash_stream(gost_hash_ctx * ctx, int fd, char *sum, int hashsize)
 int get_line(FILE *f, char *hash, char *filename, int verbose, int *size)
 {
     int i, len;
-    char *ptr = filename;
+    char *ptr;
     char *spacepos = NULL;
 
     while (!feof(f)) {