xaizek / pinfo (License: GPLv2 only) (since 2018-12-07)
Console-based info and manual pages reader, which adds interactive navigation to man pages.
Commit 8becb2da8fdbec5252118e2172fcb3f0fca6f041

Fix segfault in src/filehandling_functions.c. We were strdup()ing the result of getenv() without checking whether it was NULL. Further, we were using the result as an array without checking whether *it* was NULL. Both wrapped in a null pointer check.
git-svn-id: svn://svn.debian.org/svn/pinfo/pinfo/trunk@26 ea4b0d59-4df7-0310-a9f9-bf8cbe41ce66
Author: neroden-guest
Author date (UTC): 2005-08-11 11:53
Committer name: neroden-guest
Committer date (UTC): 2005-08-11 11:53
Parent(s): cbf8a1c168598323943bb65d4e5afe8179e5bcd4
Signing key:
Tree: c97419f0efb57113240b20ad2cc42f72bd38f847
File Lines added Lines deleted
src/filehandling_functions.c 18 14
File src/filehandling_functions.c changed (mode: 100644) (index f018ac6..b813f77)
3 3 * *
4 4 * Copyright (C) 1999 Przemek Borys <pborys@dione.ids.pl> * Copyright (C) 1999 Przemek Borys <pborys@dione.ids.pl>
5 5 * Copyright (C) 2005 Bas Zoetekouw <bas@debian.org> * Copyright (C) 2005 Bas Zoetekouw <bas@debian.org>
6 * Copyright (C) 2005 Nathanael Nerode <neroden@gcc.gnu.org>
6 7 * *
7 8 * This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
8 9 * it under the terms of version 2 of the GNU General Public License as * it under the terms of version 2 of the GNU General Public License as
 
... ... initpaths()
850 851 char **paths = NULL; char **paths = NULL;
851 852 char *infopath = NULL, *langpath = NULL; char *infopath = NULL, *langpath = NULL;
852 853 char *c, *dir, *env; char *c, *dir, *env;
853 char *lang, *langshort = NULL;
854 char *rawlang, *lang, *langshort = NULL;
854 855 int ret; int ret;
855 856 unsigned int i, j, maxpaths, numpaths = 0, infolen, langlen; unsigned int i, j, maxpaths, numpaths = 0, infolen, langlen;
856 857 size_t len; size_t len;
 
... ... initpaths()
885 886 } }
886 887
887 888 /* get the current $LANG, if any (to use for localized info pages) */ /* get the current $LANG, if any (to use for localized info pages) */
888 lang = strdup(getenv("LANG"));
889 /* fix the lang string */
890 for (i=0; lang[i]!='\0'; i++)
891 {
892 /* cut off the charset */
893 if (lang[i]=='.')
894 {
895 lang[i]='\0';
896 }
897 /* if lang is sublocalized (nl_BE or so), also use short version */
898 if (lang[i]=='_' && langshort==NULL)
889 rawlang = getenv("LANG");
890 if (rawlang) {
891 lang = strdup(rawlang);
892 /* fix the lang string */
893 for (i=0; lang[i]!='\0'; i++)
899 894 { {
900 langshort = strdup(lang);
901 langshort[i] = '\0';
895 /* cut off the charset */
896 if (lang[i]=='.')
897 {
898 lang[i]='\0';
899 }
900 /* if lang is sublocalized (nl_BE or so), also use short version */
901 if (lang[i]=='_' && langshort==NULL)
902 {
903 langshort = strdup(lang);
904 langshort[i] = '\0';
905 }
902 906 } }
903 907 } }
904 908 /* if we have a LANG defined, add paths with this lang to the paths[] */ /* if we have a LANG defined, add paths with this lang to the paths[] */
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/pinfo

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/pinfo

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master