Skip to content

Commit

Permalink
Fix unprotected arguments
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>
  • Loading branch information
stewid committed Apr 19, 2017
1 parent 05ef70c commit e5ee888
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/git2r_arg.c
@@ -1,6 +1,6 @@
/*
* git2r, R bindings to the libgit2 library.
* Copyright (C) 2013-2016 The git2r contributors
* Copyright (C) 2013-2017 The git2r contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2,
Expand Down Expand Up @@ -182,6 +182,8 @@ int git2r_arg_check_fetch_heads(SEXP arg)
{
const char *repo = NULL;
size_t i,n;
SEXP s_repo = Rf_install("repo");
SEXP s_path = Rf_install("path");

if (R_NilValue == arg || VECSXP != TYPEOF(arg))
return -1;
Expand All @@ -200,7 +202,7 @@ int git2r_arg_check_fetch_heads(SEXP arg)
if (0 != strcmp(CHAR(STRING_ELT(class_name, 0)), "git_fetch_head"))
return -1;

path = GET_SLOT(GET_SLOT(item, Rf_install("repo")), Rf_install("path"));
path = GET_SLOT(GET_SLOT(item, s_repo), s_path);
if (git2r_arg_check_string(path))
return -1;

Expand Down

0 comments on commit e5ee888

Please sign in to comment.