#71 Safer code

Aberto
10 meses atrás foi aberto por nuclearkev · 1 comentários

After look at some of mg(1)'s code for reference, I discovered that there is a lot of code that I've written (and the previous 2 authors) that is kind of unsafe. Granted there are some things that don't really matter such as using sprintf(3) instead of asprintf(3) in the modeline but it would be nice to make sure that the memory is handle correctly.

I don't have this in a milestone because I don't know when I would do this.

After look at some of mg(1)'s code for reference, I discovered that there is a lot of code that I've written (and the previous 2 authors) that is kind of unsafe. Granted there are _some_ things that don't really matter such as using `sprintf(3)` instead of `asprintf(3)` in the modeline but it would be nice to make sure that the memory is handle correctly. I don't have this in a milestone because I don't know when I would do this.
Kevin "The Nuclear" Bloom comentado 5 meses atrás
Proprietário

While I've began part of this, it won't be completed for a long time. There are many uses of asprintf, str[n]dup, memcpy, and memccpy that aren't properly error checked. I'd like to make sure that any error like that is handle correctly, just in case. Something like what is below:

if((buf = strdup(str)) == NULL) {
  fatal("%s, out of memory");
}
While I've began part of this, it won't be completed for a long time. There are many uses of `asprintf`, `str[n]dup`, `memcpy`, and `memccpy` that aren't properly error checked. I'd like to make sure that any error like that is handle correctly, just in case. Something like what is below: ``` if((buf = strdup(str)) == NULL) { fatal("%s, out of memory"); } ```
Faça login para participar desta conversação.
Carregando...
Cancelar
Salvar
Ainda não há conteúdo.