]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
examples:winexe: Initialize integer
authorAndreas Schneider <asn@samba.org>
Tue, 16 Jul 2024 15:03:19 +0000 (17:03 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 18 Jul 2024 12:47:30 +0000 (12:47 +0000)
"Error: UNINIT (CWE-457):
samba-4.20.0rc2/examples/winexe/winexesvc.c:147: var_decl: Declaring variable ""res"" without initializer.
samba-4.20.0rc2/examples/winexe/winexesvc.c:156: uninit_use: Using uninitialized value ""res"".
  154|    GetOverlappedResult(pipe->h, &pipe->o, (LPDWORD)&res, TRUE);
  155|    FlushFileBuffers(pipe->h);
  156|->  return res;
  157|   }
  158|"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
examples/winexe/winexesvc.c

index a1937f9abd985a2111f2367a7ce9dc3f103cd8be..f993c9a9c69a22f04cdbca9ec8c359c1a76c25d0 100644 (file)
@@ -148,7 +148,7 @@ finish:
 
 static int hprintf(OV_HANDLE *pipe, const char *fmt, ...)
 {
-       int res;
+       int res = -1;
        char buf[1024];
        va_list ap;
        va_start(ap, fmt);