[Libreoffice-commits] core.git: dtrans/source sal/osl

Jochen Nitschke j.nitschke+logerrit at ok.de
Wed May 18 20:56:53 UTC 2016


 dtrans/source/cnttype/wbench/testcnttype.cxx |    2 +-
 sal/osl/unx/process.cxx                      |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 90891602fc826d11985910fc8e892706cd419539
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Tue May 17 09:55:13 2016 +0200

    limit scanf string field width
    
    Change-Id: I9070bae914d923171b6eaf8209de00922dc87be7
    Reviewed-on: https://gerrit.libreoffice.org/25052
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jochen Nitschke <j.nitschke+logerrit at ok.de>

diff --git a/dtrans/source/cnttype/wbench/testcnttype.cxx b/dtrans/source/cnttype/wbench/testcnttype.cxx
index f6482c2..b4cfb7a 100644
--- a/dtrans/source/cnttype/wbench/testcnttype.cxx
+++ b/dtrans/source/cnttype/wbench/testcnttype.cxx
@@ -71,7 +71,7 @@ sal_Bool readCntTypesFromFileIntoVector( char* fname, vector< string >& vecData
     fseek( fstream, 0L, SEEK_SET );
 
     char line[1024];
-    while ( fscanf( fstream, "%[^\n]s", line ) != EOF )
+    while ( fscanf( fstream, "%1023[^\n]s", line ) != EOF )
     {
         vecData.push_back( line );
         fgetc( fstream );
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index 391b160..4d372a3 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -899,7 +899,7 @@ bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat)
                "%lu %li %li %li"
                "%lu %lu %li %lu"
                "%lu %lu %lu %lu %lu"
-               "%s %s %s %s"
+               "%23s %23s %23s %23s"
                "%lu %lu %lu",
                &procstat->state,
                &procstat->ppid,      &procstat->pgrp,    &procstat->session,    &procstat->tty,         &procstat->tpgid,
@@ -975,7 +975,7 @@ bool osl_getProcStatus(pid_t pid, struct osl_procStat* procstat)
         tmp = strstr(prstatusbuf,"SigPnd:");
         if(tmp)
         {
-            sscanf(tmp, "SigPnd: %s SigBlk: %s SigIgn: %s %*s %s",
+            sscanf(tmp, "SigPnd: %23s SigBlk: %23s SigIgn: %23s %*s %23s",
                    procstat->signal, procstat->blocked, procstat->sigignore, procstat->sigcatch
                 );
         }


More information about the Libreoffice-commits mailing list