pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/14432


Change subject: logging: Check return error from time() call
......................................................................

logging: Check return error from time() call

Related: OS#4055
Change-Id: Ief155a76169426a677256e09d3e91751c4e2529f
---
M src/logging.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/14432/1

diff --git a/src/logging.c b/src/logging.c
index b8960f9..f8dfd5a 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -362,7 +362,8 @@
                        /* man ctime: user-supplied buffer should have room for 
at least 26 bytes */
                        char ctime_buf[26];
                        time_t tm;
-                       tm = time(NULL);
+                       if ((tm = time(NULL)) == (time_t) -1)
+                               goto err;
                        if (!ctime_r(&tm, ctime_buf))
                                goto err;
                        /* Remove new line char atthe end added by ctime */

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ief155a76169426a677256e09d3e91751c4e2529f
Gerrit-Change-Number: 14432
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to