Skip to content

ESP8266HTTPUpdateServer::setup should make copy of username and password #4034

Closed
@9a4gl

Description

@9a4gl

Bellow code will not work because username and password strings are later gone from stack. ESP8266HTTPUpdateServer should make copy of username and password and later use that.

void setup() {
  String username = F("admin");
  String password = F("password");
  httpUpdater.setup(&httpServer, username.c_str(), password.c_str());
}

We should replace in header (and adapt NULLs and checks)

  private:
    char * _username;
    char * _password;

with

    String _username;
    String _password;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions