buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52059, httpd/makefsdata assumes UNICODE

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #52059: httpd/makefsdata assumes UNICODE

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Tue 19 Sep 2017 02:04:03 PM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  dziegel
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Tue 19 Sep 2017 06:12:23 PM UTC, comment #1: 

Broken by 772bf96: "Fix makefsdata.c on Win32 after moving to tinydir.h" ;-)

Simon Goldschmidt <goldsimon>
Group administrator
Tue 19 Sep 2017 02:04:03 PM UTC, original submission:  

Simple fix (by gisle vanem on lwip-devel):

--- a/src/apps/httpd/makefsdata/makefsdata.c 2017-09-18 19:58:19
+++ b/src/apps/httpd/makefsdata/makefsdata.c 2017-09-18 21:23:35
@@ -421,7 +421,7 @@
          ret = tinydir_readfile_n(&dir, &file, i);

          if (ret == 0) {
-#if (defined MSC_VER || defined __MINGW32_)
+#if (defined MSC_VER || defined __MINGW32_) && (defined _UNICODE)
            size_t   i;
            char currName[256];
            wcstombs_s(&i, currName, sizeof(currName), file.name, sizeof(currName));
@@ -461,12 +461,12 @@

          if (ret == 0) {
            if (!file.is_dir) {
-#if (defined MSC_VER || defined __MINGW32_)
+#if (defined MSC_VER || defined __MINGW32_) && defined _UNICODE
              size_t   i;
              char curName[256];
              wcstombs_s(&i, curName, sizeof(curName), file.name, sizeof(curName));
  #else
-            const char *currName = file.name;
+            const char *curName = file.name;
  #endif

              if (strcmp(curName, "fsdata.tmp") == 0) {




Note the code's use of 'currName' and 'curName'.


Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dziegel (Updated the item)
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-20 dziegel StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-09-19 goldsimon StatusNone Confirmed
        Assigned toNone dziegel

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code