Giter Club home page Giter Club logo

phoenix-rtos-utils's People

Contributors

agkaminski avatar anglov avatar astalke avatar badochov avatar cinek28 avatar damianloew avatar darchiv avatar gerard5 avatar jmaksymowicz avatar kajaswat avatar kemonats avatar kwasik avatar lukileczo avatar maciejpurski avatar maska989 avatar nalajcie avatar niewim19 avatar pawelpisarczyk avatar szpejnadawid avatar ziemleszcz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phoenix-rtos-utils's Issues

psh/mem generates warning on stm32l4

phoenix-rtos-utils/core/psh/mem/mem.c: In function 'psh_mem_procprint':
phoenix-rtos-utils/core/psh/mem/mem.c:85:20: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'id_t' {aka 'unsigned int'} [-Wformat=]
   85 |    printf("  %d.%llu", e->oid.port, e->oid.id);
      |                 ~~~^                ~~~~~~~~~
      |                    |                      |
      |                    long long unsigned int id_t {aka unsigned int}
      |                 %u

Example build from ghactions: https://github.com/phoenix-rtos/phoenix-rtos-project/runs/2792844210?check_suite_focus=true#step:4:260

psh: sysexec: "Unknown command" message is misleading

At this moment, when trying to execute a sysexec command with a syspage program, which is not on the white list we print a message Unknown command. It is misleading, as it suggests to the user, that the command itself does not exist or he/she made a mistake when executing the command. We should change it to for example sysexec: Command not allowed or even explicitly: sysexec: Program micropython not found on the whitelist, whichever you prefer.

psh.c: possible buffer overrun and memory leak?

psh/psh.c:

int main(int argc, char **argv)
...
		if ((args = calloc(3000, 1)) == NULL) {  
			printf("psh: out of memory\n");  
			return EXIT_FAILURE;  
		}  
  
		for (c = 1; c < argc; ++c) {  
			strcat(args, argv[c]);  
			strcat(args, " ");  
		}
...

Appending to args is done without any control of the possible args buffer overflow.
What happens if the sum of the length of the arguments is greater than 3000?
Why the number 3000? Can it be greater than 3000 at all?
In psh_run is 128

void psh_run(void)
...
	char buf[128];

It would probably be appropriate to use the :

strncat(char *, const char *, size_t)

but now this function does nothing.
libphoenix/string/string.c

char *strncat(char *s1, const char *s2i, size_t num)  
{  
	return 0;  
}

I also don't see:

free(args);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.