rtspreal: Ensure output value has an assigned value
authorEdward Hervey <edward@collabora.com>
Fri, 26 Jul 2013 14:47:48 +0000 (16:47 +0200)
committerEdward Hervey <edward@collabora.com>
Fri, 26 Jul 2013 14:47:48 +0000 (16:47 +0200)
In the case where this macro was used, that dest was != NULL but that
the strncmp failed, we would end up with dest_len being undefined.

gst/realmedia/rtspreal.c

index c63ed28520f9bcda19c675369012bf5fcbd759ef..c4363b86786d5cf8ec2b93901ec344e6a0ac36cb 100644 (file)
@@ -207,9 +207,9 @@ G_STMT_START {                             \
 #define READ_BUFFER_GEN(src, func, name, dest, dest_len)    \
 G_STMT_START {                                             \
   dest = (gchar *)func (src, name);                         \
+  dest_len = 0;                                                    \
   if (!dest) {                                              \
     dest = (char *) "";                                     \
-    dest_len = 0;                                           \
   }                                                         \
   else if (!strncmp (dest, "buffer;\"", 8)) {               \
     dest += 8;                                              \