Zero-initialize the reply struct
authorMartin Storsjö <martin@martin.st>
Sun, 4 Apr 2010 21:59:06 +0000 (21:59 +0000)
committerMartin Storsjö <martin@martin.st>
Sun, 4 Apr 2010 21:59:06 +0000 (21:59 +0000)
The status_code field is read in the fail codepath, where it could be
read uninitialized earlier. Found by clang.

Originally committed as revision 22801 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/rtsp.c

index 18538c7..643e4d5 100644 (file)
@@ -1442,7 +1442,7 @@ int ff_rtsp_connect(AVFormatContext *s)
     char *option_list, *option, *filename;
     URLContext *rtsp_hd;
     int port, err, tcp_fd;
-    RTSPMessageHeader reply1, *reply = &reply1;
+    RTSPMessageHeader reply1 = {}, *reply = &reply1;
     int lower_transport_mask = 0;
     char real_challenge[64];
     struct sockaddr_storage peer;