Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2-libc
  Commit: d3dea661da9ae4a3421a80905e75a8dc77aa980e
      
https://github.com/tianocore/edk2-libc/commit/d3dea661da9ae4a3421a80905e75a8dc77aa980e
  Author: Jayaprakash, N <[email protected]>
  Date:   2023-07-31 (Mon, 31 Jul 2023)

  Changed paths:
    M StdLib/BsdSocketLib/res_init.c

  Log Message:
  -----------
  edk2-libc/StdLib: Fix uninitialized global variable

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4506

res_init() is called from different places in sockets library. It depends
on global _res variable containing a state.
The problem is that if __BIND_RES_TEXT macro is not defined, _res is not
initialized.
Depending on compiler and build optimization this can fill the
variable with garbage that is later used by res_init().
Fix is trivial - explicitly initialize _res.

Cc: Rebecca Cran <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Jayaprakash Nevara <[email protected]>
Signed-off-by: Kloper Dimitry <[email protected]>
Reviewed-by: Jayaprakash Nevara <[email protected]>




_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to