Fix for coverity (bail if we can't stat the file in detail_recv)
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 17 Feb 2013 17:17:26 +0000 (12:17 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 17 Feb 2013 17:17:37 +0000 (12:17 -0500)
src/main/detail.c

index 2bee7a1..1b995cf 100644 (file)
@@ -382,7 +382,14 @@ int detail_recv(rad_listen_t *listener)
                        {
                                struct stat buf;
                                
-                               fstat(listener->fd, &buf);
+                               if (fstat(listener->fd, &buf) < 0) {
+                                       radlog(L_ERR, "Failed to stat "
+                                              "detail file %s: %s",
+                                               data->filename,
+                                               strerror(errno));
+                                               
+                                       goto cleanup;
+                               }
                                if (((off_t) ftell(data->fp)) == buf.st_size) {
                                        goto cleanup;
                                }